2014-01-11 251 views
20

我在用最近安裝在Windows 7計算機上的Cygwin上運行得很糟糕。我寫的是希望任何人都能夠正確地安裝這些軟件包,從而告訴我我做得不正確。PIP安裝在Windows 7上無法正常工作Cygwin安裝

要開始,我跟本網站上的說明:

http://www.pip-installer.org/en/latest/installing.html

一起點子安裝之前安裝setuptools的。我遵循的步驟,運行這個命令:

[email protected] ~ 
$ python get-pip.py 

得到這個輸出:

Downloading/unpacking pip 
Downloading pip-1.5.tar.gz (898kB): 898kB downloaded 
    Running setup.py egg_info for package pip 

    warning: no files found matching 'pip/cacert.pem' 
    warning: no files found matching '*.html' under directory 'docs' 
    warning: no previously-included files matching '*.rst' found under direct 
    no previously-included directories found matching 'docs/_build/_sources' 
Installing collected packages: pip 
    Running setup.py install for pip 

    warning: no files found matching 'pip/cacert.pem' 
    warning: no files found matching '*.html' under directory 'docs' 
    warning: no previously-included files matching '*.rst' found under direct 
    no previously-included directories found matching 'docs/_build/_sources' 
    Installing pip script to /usr/bin 
    Installing pip2.7 script to /usr/bin 
    Installing pip2 script to /usr/bin 
Successfully installed pip 
Cleaning up... 

你瞧,跑PIP用這個命令:

[email protected] ~ 
$ pip install --upgrade setuptools 

導致絕對沒有輸出。下面出現一個空白行,持續3-4秒,然後輸入提示再次出現,沒有任何事實上pip。我做了更多的測試,以確認我的機器上有某種稱爲點的東西,但無論何時它運行,它本質上什麼都不做。它沒有下載或安裝任何程序。

我試着在卸載第一個版本後嘗試另一種方式安裝pip。這一次,我想:

$ easy_install pip 

,得到了以下的輸出:

Searching for pip 
Best match: pip 1.5 
Adding pip 1.5 to easy-install.pth file 
Installing pip script to /usr/bin 
Installing pip2.7 script to /usr/bin 
Installing pip2 script to /usr/bin 

Using /usr/lib/python2.7/site-packages 
Processing dependencies for pip 
Finished processing dependencies for pip 

同樣,使用PIP安裝的virtualenv使用此命令嘗試:

$ pip install virtualenv 

,並暫停3- 4秒鐘,然後再次提供命令提示符。完全像以前那樣。當我檢查是否安裝了virtualenv時,事實並非如此。

本質上,我試過,並試圖得到點和運行在我的Windows 7 Cygwin安裝,但無濟於事。我意識到我可以使用其他軟件包來安裝插件等等,但是如果有人知道爲什麼會發生這種情況,我會非常感激,所以當我嘗試在下面進行更深入的安裝時,它不會讓我困擾該線。

任何幫助將不勝感激!

+1

出於好奇,給你想要做什麼,爲什麼你想做到這一點只在Cygwin的?考慮到Cygwin是一個「DLL(cygwin1.dll)」,它充當了提供大量Linux API功能的Linux API層「,所以最好簡單地安裝用於Windows *的Python *,並安裝」pip「和」virtualenv「辦法。或者,將Python安裝在基於Virutal環境/ * nix的操作系統中。 – jrd1

+0

嗯,我已經有一個安裝在Windows中的Python版本配置,我喜歡它。當我嘗試使用它時(例如導入numpy或其他東西),安裝的功能不起作用。我假設這是因爲我的路徑文件鏈接到python上的cygwin版本,而不是以前安裝的Windows版本。 你會如何建議我得到Cygwin使用我的Windows安裝?只需卸載cygwin python並修改路徑文件以包含windows文件夾,其中包含我的windows python install? – rrphenix

+0

您可以通過直接調用Windows安裝來繞過Cygwin安裝。你有沒有嘗試使用Windows的'cmd'提示符(按Win + R鍵入'cmd',然後按Enter鍵),並調用你的Windows安裝的Python和'pip'這樣安裝? (例如:'C:\ Python27 \ Scripts \ pip.exe install virtualenv') – jrd1

回答

24

有64位Cygwin的導致ctypes.util試圖找到libuuid/usr/bin/cyguuid-1.dll)時,段錯誤的錯誤(?)。修復方法是從Cygwin安裝程序安裝libuuid-devel。我從an issue filed against requests.py中發現了這個,但它在其他幾個地方也被注意到了(並且以不同的方式解決了這個問題)。

+3

男人你是天賜之物! – CMCDragonkai

+0

這也解決了我的問題。謝謝!但我之前已經安裝了binutils,所以我不知道,如果它也是必需的。 –

+0

@DawidFerenczy:我不確定......我也已經安裝了binutils :-)另外:謝謝!你只是推動了我超過1000代表! –

4

遇到同樣的問題。安裝binutils cygwin包爲我解決了它。

+0

我不知道爲什麼以前的答案是如此之低。我在這裏試圖找出爲什麼pip install -r REQUIREMENTS.txt在Cygwin64上完全沒有任何功能(甚至沒有錯誤信息)。我安裝了binutils軟件包,奇蹟般地開始工作。 – cardonator

0

有一個解決此問題的方法:您可以將輸出管道傳輸到另一個進程或將其重定向到文件。

例如:

pip | more 

Usage: 
    pip <command> [options] 

Commands: 
    install      Install packages. 
    uninstall     Uninstall packages. 
    freeze      Output installed packages in requirements format. 
    list      List installed packages. 
    show      Show information about installed packages. 
    search      Search PyPI for packages. 
    wheel      Build wheels from your requirements. 
    help      Show help for commands. 

這將使看到標準輸出,而不是標準錯誤。爲了看到標準錯誤也應該被重定向:

pip 2>&1 | more