如果内存服务,当我在PATH
和/或错误的PYTHONHOME
变量中有多个Python文件夹时遇到此问题。尝试打开cmd shell并确保PATH和PYTHONHOME清除了竞争的python条目,然后再次运行pip。
set path=C:\Python27\ArcGIS10.1\Scripts
set pythonhome=C:\Python27\ArcGIS10.1
pip --version
如果失败尝试升级/与get-pip替换PIP(可能必须先删除Python\Scripts
文件夹pip.exe)。
如果它工作,你需要清理PATH,以便只有Python文件夹在里面。
如果只有一个python文件夹在Windows\System32
中查找像python27.dll
这样的python文件 - 与C:\Python27\ArcGIS10.1
比较。如果有不同大小和/或日期戳的重复文件,则会出现问题。
临提示:使用where
命令搜索路径对于一个给定的可执行文件或DLL:
C:\> where python*
D:\b\osgeo\bin\python.exe
D:\b\osgeo\bin\python27.dll
D:\b\osgeo\bin\pythonw.exe
C:\Windows\System32\python27.dll
C:\Windows\System32\python34.dll
上述系统是成熟的意想不到的问题。他们python的不匹配:
Directory of c:\windows\system32
30-Jun-14 04:08 PM 3,009,536 python27.dll
18-May-14 10:45 AM 4,047,872 python34.dll
Directory of d:\b\osgeo\bin
06-Apr-13 07:55 PM 26,624 python.exe
06-Apr-13 07:55 PM 2,448,384 python27.dll
06-Apr-13 07:55 PM 27,136 pythonw.exe