Could you help with importing numpy and arcpy on Pycharm?

539
13
02-03-2019 10:34 PM
Highlighted
New Contributor II

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

Reply
0 Kudos
13 Replies
Highlighted
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

Reply
0 Kudos
Highlighted
New Contributor II

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.

Reply
0 Kudos
Highlighted
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?

Highlighted
New Contributor II

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

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

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

Reply
0 Kudos
Highlighted
New Contributor II

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

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

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

Highlighted
New Contributor II

Hi Dan,

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

Reply
0 Kudos
Highlighted
MVP Esteemed Contributor

You can try the 'Clone' option then

Reply
0 Kudos