Select to view content in your preferred language

Could you help with importing numpy and arcpy on Pycharm?

1981
13
02-03-2019 10:34 PM
TshepoHlako
Emerging Contributor

I'm struggling with running/importing 'numpy and arcpy' on pycharm, which points to python.exe in the Python 27 directory where ArcGIS 10.4 is installed. How else can i try importing the two modules as it gives the errors "ImportError: No module named arcpy" for both arcpy and numpy.

Thanks,
Charlie

0 Kudos
13 Replies
FrédéricPRALLY
Esri Contributor

Hi Charlie,

Are you using a 32-bit environment about PyCharm?

I'm not using PyCharm actually, I use PyScripter to debug ArcPy code. So I've installed a PyScripter 32-bit and nor 64-bits versions.

A trick to identify your 32 or 64 bit environment is to jump on Python Console. You must have :

Python 2.7.14 (v2.7.14:84471935ed, Sep 16 2017, 20:19:30) [MSC v.1500 32 bit (Intel)] on win32. ***

Regards,

Fred

0 Kudos
TshepoHlako
Emerging Contributor

Thanks Fred, it seemed to be running from another version of python that i had on the machine, 3.7 I'm now trying to fix that.

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

I regularly use PyCharm with ArcMap's and ArcGIS Pro's bundled Python interpreter.  In the settings, what do you have defined for the Project Interpreters?

TshepoHlako
Emerging Contributor

Hi Joshua, my Project Interpreter points to "Drive:\Python27\ArcGIS10.4"

0 Kudos
JoshuaBixby
MVP Esteemed Contributor

Is "Drive" literally what is says, or is it referring to C:, D:, or some other drive?

0 Kudos
TshepoHlako
Emerging Contributor

That is referring to whether it's C:, 😧 etc.

0 Kudos
DanPatterson_Retired
MVP Emeritus

If you have control over your machine...

/blogs/dan_patterson/2018/12/28/clone 

/blogs/dan_patterson/2018/12/13/spyder 

Spyder, IPython and the Jupyters are all distributed with the Anaconda distribution of Python and hence ArcGIS Pro

TshepoHlako
Emerging Contributor

Hi Dan,

Unfortunately, i've no control over the machine, its used by other colleagues besides myself. Thanks

0 Kudos
DanPatterson_Retired
MVP Emeritus

You can try the 'Clone' option then

0 Kudos