error : no module named arcpy

3851
12
Jump to solution
01-06-2016 04:31 PM
ben_abdallahmhd
New Contributor III

Hi, i have a problem with arcpy when i try to import it in a script with idle the message

no "module named arcpy" appear. But when i run it directly in arcgis.

The second problem is the no recognition of the feqtureclqss . the message that appearr is : the featureclass doesntexist.

Remarque I use ArcSDE connection and ArcGIS 10.1

Thank you

0 Kudos
1 Solution

Accepted Solutions
RebeccaStrauch__GISP
MVP Emeritus

I don't use Pyscripter (I use Wing as my external IDE), but check out this link for setting to a different path

http://stackoverflow.com/questions/18279915/how-to-change-pyscripter-to-use-python-installed-in-non-...

The basics of the thread that I see

Go to PyScripter>>Tools>>Options...>>Custom Parameters... and add the following values 

     1. PythonDir = C:\Program Files\CustomPythonInstallation 2. PythonExe = C:\Program Files\CustomPythonInstallation\python.exe 3. PythonVer = 3.3.3 Note: Adapt the Name = Value pairs above to your case. 

And close the window with OK button. Now select PyScripter>>Run>>Python Engine>>Remote and your are ready to go.


WAY 2 (The more temporary solution)

  • Go to PyScripter>>Run>>Configure External Run...
  • set the "Application:" field to your python.exe file
  • Close the window with OK button.
  • Make sure you run your scripts with PyScripter>>Run>>External Run (Alt+F9)

I hope this helped, good luck.

View solution in original post

0 Kudos
12 Replies
DanPatterson_Retired
MVP Emeritus

What IDE are you using outside of ArcMap?  It is not installed properly in any event.

Show your code, if you have any, so that the problem to the path to the featureclass can be determined.

0 Kudos
ben_abdallahmhd
New Contributor III

hi dan, thank you

i use IDLE (python GUI) and Pyscripter.

My code is correct and debugging.

0 Kudos
DanPatterson_Retired
MVP Emeritus

make sure that you have the version of python installed with arcmap.  check your python path and note them here if needed.  Just reinstalling arcmap isn't going to help if you have an old or different python kicking around.  Pyscripter installs flawlessly over python, you can find the python path within pyscripter (can't remember which menu option off-hand), you can view it from their

0 Kudos
ben_abdallahmhd
New Contributor III

Hi dan,

These are the python path illustrated with Pyscripter

0 Kudos
DanPatterson_Retired
MVP Emeritus

did you also verify stuff in the link Rebecca sent you?  You have to check other things as well.  Read carefully, it may help

Locating Python and adding it to your system Path | Python, GIS and stuff…

RebeccaStrauch__GISP
MVP Emeritus

I don't use Pyscripter (I use Wing as my external IDE), but check out this link for setting to a different path

http://stackoverflow.com/questions/18279915/how-to-change-pyscripter-to-use-python-installed-in-non-...

The basics of the thread that I see

Go to PyScripter>>Tools>>Options...>>Custom Parameters... and add the following values 

     1. PythonDir = C:\Program Files\CustomPythonInstallation 2. PythonExe = C:\Program Files\CustomPythonInstallation\python.exe 3. PythonVer = 3.3.3 Note: Adapt the Name = Value pairs above to your case. 

And close the window with OK button. Now select PyScripter>>Run>>Python Engine>>Remote and your are ready to go.


WAY 2 (The more temporary solution)

  • Go to PyScripter>>Run>>Configure External Run...
  • set the "Application:" field to your python.exe file
  • Close the window with OK button.
  • Make sure you run your scripts with PyScripter>>Run>>External Run (Alt+F9)

I hope this helped, good luck.

0 Kudos
ben_abdallahmhd
New Contributor III

hi rebecca,

thank for the link.

no the sccript run from pyscripter as external run.

No the problem is the Access to the clasa. The class exist but the message is the class "does not exist"

0 Kudos
ben_abdallahmhd
New Contributor III

Hi rebecca,

I solved the problem of "no module named arcpy" by the link given by you and i run the script in pyscripter with external run.

The second "problem" of the class "does not exist" i solved it by re-writing the path of connection file in the script.

Final thank you very much for your help

0 Kudos
ben_abdallahmhd
New Contributor III

Hi dan, I solved the problem of "no module named arcpy" by the link given by rebecca and i run the script in pyscripter with external run.

The second "problem" of the class "does not exist" i solved it by re-writing the path of connection file in the script.

Final thank you very muchforyour help