Python - arcpy problems

1213
6
03-26-2012 12:59 PM
GrzegorzStanny
New Contributor
Hi

After big crash at my laptop my PythonWin doesnt work propertly. Anything what I want to do form arcpy doesnt work. Anybody knows what to do?
For example:

"import arcpy
from arcpy import env"

and python answer is:
"Traceback (most recent call last):
  File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
    exec codeObject in __main__.__dict__
  File "D:\GIS\Cwiczenia\Python\arcpy.py", line 2, in <module>
    from arcpy import env
ImportError: cannot import name env"

or another example:

"import arcpy
from arcpy import sys"

and python answer is:
"Traceback (most recent call last):
  File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
    exec codeObject in __main__.__dict__
  File "D:\GIS\Cwiczenia\Python\arcpy.py", line 2, in <module>
    from arcpy import sys
ImportError: cannot import name sys"


I reinstal PythonWin, repair ArcGis but nothing works. Still the same.
Anything, what I want to do connect with arcpy give the same error "File "C:\Python26\ArcGIS10.0\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 325, in RunScript
    exec codeObject in __main__.__dict__and..."

Anybody knows what to fix it.
Tags (2)
0 Kudos
6 Replies
MathewCoyle
Frequent Contributor
Does it work in IDLE?

If you keep using PythonWin for arcpy processing you are going to have a bad day. Give PyScripter a whirl.

http://code.google.com/p/pyscripter/
0 Kudos
GrzegorzStanny
New Contributor
Hi

I try it in PyScripter and IDLE and still the same error. I think that problem is in scriptutils.py but I have no idea how to fix it. I took this file from friend from another laptop but still the same. Do You have some idea how to fix it.

G.
0 Kudos
DanPatterson_Retired
MVP Emeritus
reinstall pythonwin from your ArcMap installation disk
0 Kudos
GrzegorzStanny
New Contributor
Sorry that I not respond earlier but I was away. I reinstall pythonwin from me ArcMap installation disk but doesnt work. Later I reinstal Python, pythonwin and repair ArcGis instalation but still nothing, still the same error. Should I reinstal whole ArcGis (I lose my licences? or what to do reinstalation to not lose licences)
Sorry for my simple questions but I`m new in this environment.

G
0 Kudos
Zeke
by
Regular Contributor III
Have you checked your PATH file to make sure everything's pointing to the right directories?
0 Kudos
GrzegorzStanny
New Contributor
Hi
What do You mean "checked your PATH file". I`m new in using python so if You can please explain me what to do and where I find path file.

Have a nice day
Greg
0 Kudos