2016-11-18 262 views
0

我試圖爲arcpy安裝pip(在Windows 7上爲arcgis 10.2)。運行get-pip.py會導致以下錯誤消息:爲arcpy安裝pip

X:\python>python get-pip.py 
Traceback (most recent call last): 
    File "get-pip.py", line 20061, in <module> 
    main() 
    File "get-pip.py", line 194, in main 
    bootstrap(tmpdir=tmpdir) 
    File "get-pip.py", line 82, in bootstrap 
    import pip 
    File "c:\temp\tmpou5fje\pip.zip\pip\__init__.py", line 26, in <module> 
    File "c:\temp\tmpou5fje\pip.zip\pip\utils\__init__.py", line 27, in <module> 
    File "c:\temp\tmpou5fje\pip.zip\pip\_vendor\pkg_resources\__init__.py", line 73, in <module> 
    File "c:\temp\tmpou5fje\pip.zip\pip\_vendor\packaging\specifiers.py", line 275, in <module> 
    File "c:\temp\tmpou5fje\pip.zip\pip\_vendor\packaging\specifiers.py", line 373, in Specifier 
    File "C:\Python27\ArcGIS10.2\Lib\re.py", line 190, in compile 
    return _compile(pattern, flags) 
    File "C:\Python27\ArcGIS10.2\Lib\re.py", line 242, in _compile 
    raise error, v # invalid expression 
sre_constants.error: nothing to repeat 

使用管理員命令提示符不起作用。我真正的目標是讓win32com在arcpy下工作。我通常只需將相應的目錄從c:\ python27 \ lib \ site-packages複製到c:\ python27 \ arcgis10.2 \ lib \ site-packages以在arcpy下安裝一個軟件包(爲什麼arcpy沒有帶pip? )但這不適用於win32com,大概是對一個缺少的DLL或其他特定於Windows的文件做的。

回答

-1

嘗試打開一個命令提示符,然後輸入:

C:\Python27\ArcGIS10.2\python.exe -m pip install -U pip 
0

我想提出以下建議:

  1. 獲取setuptools模塊
  2. 獲取pip module`

而且然後在命令行(假設窗口)運行以下內容

path-to-python path-to-setuptools install

path-to-python path-to-pip install

我一個封閉的網絡上工作(遠離舊的interwebs),不能使用get-pip.py所以我覺得最好還是簡單地下載實際模塊和硬盤安裝。

讓我們貼!