Installing module from GitHub through Jupyter notebook

My first time trying to install something from GitHub, but couldn’t find a simple solution after searching here and on google.

I’m using Jupyter notebook and trying to install this module:

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

i’ve tried to write this inside the notebook:

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

but i’m getting the following error:

Collecting git+git://github.com/Expt-David/NumSchrodingerEq.git
  Cloning git://github.com/Expt-David/NumSchrodingerEq.git to c:usersgreatg~1appdatalocaltemppip-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:UsersGREATG~1AppDataLocalTemppip-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.

EDIT

Seems that installing git again and manually delete the path and edit myself worked for that issue, but now i’m getting:

Collecting git+https://github.com/Expt-David/NumSchrodingerEq.git
  Cloning https://github.com/Expt-David/NumSchrodingerEq.git to c:usersgreatg~1appdatalocaltemppip-zpuki8tu-build
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "d:anaconda3libtokenize.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:UsersGREATG~1AppDataLocalTemppip-zpuki8tu-build

And I have setuptools installed and updated.

What am I doing wrong ?

Thanks!

Answers:

Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.

Method 1

Make sure you run your Jupyter Notebook from a session where PATH does include the path to your Git installation.

And check out pip issue 2109:

In my case the problem was the way I had the path to git defined in my path environment on windows.

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

PATH=...;c:python27scripts;"c:Program Filesgitcmd";C:Tclbin;...

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

That should be fixed in recent version of pip, but again, double-check your %PATH%.


If that still fails, try with a simplified path, and Git installed in a short PATH without space:

Regarding the PATH issue, type (in a CMD):

set PATH=C:WINDOWSsystem32;C:WINDOWS;C:WINDOWSSystem32Wbem;C:WINDOWSSystem32WindowsPowerShellv1.0
set GH=C:Git2.13.2
set PATH=%GH%bin;%GH%usrbin;%GH%mingw64bin;%PATH%

Add to that PATH what you need for python/pip.
Then try again.


For your second error message, consider “pip installation error “No such file or directory: setup.py“, and double-check your version of Python: pip is for python 2. pip3 is for python 3.


All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

0 0 votes
Article Rating
Subscribe
Notify of
guest

0 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x