numpy not importing for arcpy

1203
3
09-01-2017 08:19 AM
TomDeBaun1
New Contributor

In a similar vein to this thread How do you get Python 3.4 to see ArcGIS Pro arcpy?  I was having issues with pyscripter not importing arcpy from ArcGIS Pro. I was able to get it to find arcpy by following the suggestions in that thread, however it now throws an error telling me that it cannot access numpy. I have tried both of the following paths to lead pyscripter to the versions of numpy on my computer that were included with arcGIS Pro

sys.path.append("C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages")
sys.path.append("C:\Program Files\ArcGIS\Pro\bin\Python\envs\arcgispro-py3\Lib\site-packages\numpy")

additionally I have attempted using the following path to access numpy from anaconda's library.

sys.path.append("C:\Anaconda\Lib\site-packages")

when I attempt to use this path it thros an error stating that I am attempting to import a failed build of numpy.

I have also tried reinstalling all instances of python on my computer, as wel as reinstalling ArcGIS Pro.

for reference I am running ArcGIS Pro version 2.01 and running pyscripter with python version 3.4.3

0 Kudos
3 Replies
DanPatterson_Retired
MVP Esteemed Contributor

If you are not adverse to change, I would suggest that you consider Spyder as your IDE since it is packaged with the Anaconda distribution of Arc* I have several blog posts on its use.  I find it great (this is my 8th python IDE... I know, I know... but I like xyz ) and it is incorporated well with the package.  Besides... Pyscripter appears to have ceased active development unless that changed recently,

TomDeBaun1
New Contributor

Ok, so I've switched over to attempting to use Spyder instead, while all the packages are importing correctly but its throwing me this error instead now 

ImportError: arcpy needs to run within an active ArcGIS Conda environment

looking at your guide, it shows spyder being included with ArcGIS Pros installation of python, however Its not there leading me to believe it is not included with Pro anymore as of 2.0.

0 Kudos
DanPatterson_Retired
MVP Esteemed Contributor

Included... but needs to be installed, if you didn't install it

From the project window, go to your package manager

Check to see if it is installed...

And if it isn't listed go to Add Packages and install it from there... you don't install Spyder separately, it needs to be installed from within the Anaconda distribution issues by Pro..

Then you can install some shortcuts as in one of my other blogs....