2017-07-02 171 views
0

我第一次嘗試從GitHub安裝某些東西,但在這裏和谷歌搜索後找不到簡單的解決方案。通過Jupyter筆記本從GitHub安裝模塊

我使用Jupyter筆記本電腦,並試圖安裝該模塊:

https://github.com/Expt-David/NumSchrodingerEq

我試着寫這裏面的筆記本:

!pip install git+git://github.com/Expt-David/NumSchrodingerEq.git 

,但我發現了以下錯誤:

Collecting git+git://github.com/Expt-David/NumSchrodingerEq.git 
    Cloning git://github.com/Expt-David/NumSchrodingerEq.git to c:\users\greatg~1\appdata\local\temp\pip-1w_dpw43-build 
    Error [WinError 2] The system cannot find the file specified while executing command git clone -q git://github.com/Expt-David/NumSchrodingerEq.git C:\Users\GREATG~1\AppData\Local\Temp\pip-1w_dpw43-build 
Cannot find command 'git' 
You are using pip version 8.1.2, however version 9.0.1 is available. 
You should consider upgrading via the 'python -m pip install --upgrade pip' command. 

ED IT

似乎再次和手動安裝混帳刪除路徑和編輯自己工作過這個問題,但現在我越來越:

Collecting git+https://github.com/Expt-David/NumSchrodingerEq.git 
    Cloning https://github.com/Expt-David/NumSchrodingerEq.git to c:\users\greatg~1\appdata\local\temp\pip-zpuki8tu-build 
    Complete output from command python setup.py egg_info: 
    Traceback (most recent call last): 
     File "<string>", line 1, in <module> 
     File "d:\anaconda3\lib\tokenize.py", line 454, in open 
     buffer = _builtin_open(filename, 'rb') 
    FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\GREATG~1\\AppData\\Local\\Temp\\pip-zpuki8tu-build\\setup.py' 

    ---------------------------------------- 
Command "python setup.py egg_info" failed with error code 1 in C:\Users\GREATG~1\AppData\Local\Temp\pip-zpuki8tu-build\ 

而且我已經安裝和更新setuptools的。

我在做什麼錯?

謝謝!

+1

你的系統上沒有安裝git。安裝git。錯誤是指定它:'無法找到命令'git'' – idjaw

+0

在您的系統上安裝命中,如果已經將其添加到路徑 –

+0

我安裝了git桌面(用於Windows),但仍然出現該錯誤。我應該將它導入筆記本嗎? – ValientProcess

回答

1

確保您從會話中運行Jupyter Notebook,其中PATH包含Git安裝的路徑。

而且check out pip issue 2109

在我的情況下,問題是我必須的路徑,在Windows上的我的道路環境中定義的git的方式。

the function find_command declared in pip.util fails in handle paths with quote, like:

PATH=...;c:\python27\scripts;"c:\Program Files\git\cmd";C:\Tcl\bin;... 

when it appends the git.exe filename to check its existence it keeps the " symbol and the check fails.

這應固定在最新版本的點子,但再次,仔細檢查你的%PATH%


如果還是失敗,請嘗試使用簡化路徑,並安裝在一個較短的路徑的Git沒有空間:

關於PATH問題,類型(在CMD):

set PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\ 
set GH=C:\Git2.13.2 
set PATH=%GH%\bin;%GH%\usr\bin;%GH%\mingw64\bin;%PATH% 

添加到PATH您所需要的蟒蛇/ PIP。
然後再試一次。


對於你的第二個錯誤信息,認爲 「pip installation error 「No such file or directory: setup.py」,並仔細檢查你的Python版本:pip是蟒蛇2。pip3是python 3.

+0

我試過了,不起作用 – ValientProcess

+0

@ValientProcess你的PATH是什麼樣子的?你能從命令行輸入'git version'嗎? – VonC

+0

路徑沒問題(沒有「),但現在我得到另一個錯誤\ Command」python setup.py egg_info「失敗,錯誤代碼1在C:\ Users \ GREATG〜1 \ AppData \ Local \ Temp \ pip -zpuki8tu-build \ – ValientProcess