简体   繁体   English

Python错误:没有名为RuntimeError的模块

[英]Python error: No module named RuntimeError

Im trying to figured out this problem. 我试图找出这个问题。 Yesterday I installed PyScripter and since then, scripts doesnt work. 昨天我安装了PyScripter,此后脚本不起作用。 When I run any script (in PyScripter or IDLE) and trying to "import arcpy", it gets this error: 当我运行任何脚本(在PyScripter或IDLE中)并尝试“导入arcpy”时,出现此错误:

import arcpy

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import arcpy
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\__init__.py", line 17, in <module>
    from geoprocessing import gp
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\__init__.py", line 14, in <module>
    from _base import *
  File "C:\Program Files (x86)\ArcGIS\Desktop10.0\arcpy\arcpy\geoprocessing\_base.py", line 14, in <module>
    import arcgisscripting
  File "C:\Python26\ArcGIS10.0\lib\arcgisscripting.py", line 81, in <module>
    from RuntimeError import RuntimeError
ImportError: No module named RuntimeError

Have somebody any suggestion how to fix it? 有任何建议如何解决吗?

Thanks to all very much! 非常感谢大家!

Sounds like the module is not installed properly (or at all). 听起来好像模块未正确安装(或根本未安装)。 To verify, do the following: 要验证,请执行以下操作:

  1. open a shell and start the python shell by typing python (If this doesn't display an error, check that python is added to your system path or if it is even installed at all. But if you've used Python on said machine maybe system path issue) 打开一个外壳并通过键入python启动python外壳(如果不显示错误,请检查python是否已添加到您的系统路径中,或者是否已经安装了python。但是,如果您在上述计算机上使用过Python,则可能系统路径问题)

  2. enter the commmand help('modules') 输入命令help('modules')

  3. review the list of modules that's returned to see whether arcpy is included if not, then you may have to reinstall the module 查看返回的模块列表,以查看是否包含arcpy (如果没有),则可能必须重新安装模块

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM