Installing module from GitHub through Jupyter notebook
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:\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.
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:
- use the latest Git for Windows (uncompress Git 2.13
PortableGit-2.13.2-64-bit.7z.exe
anywhere you want, for instance inC:\Git2.13.2
) - set a simplified
PATH
.
Regarding the PATH
issue, type (in a 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%
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.
how to use module from github to jupyter notebook
Try using the http copy url from the Github site and use that with
!git clone <https://github.com...>
in a jupyter notebook cell
then you can do !ls
to check that the repository downloaded. The exclamation points mean that you can do command line commands from your notebook!
Alternatively, you could try unzipping and moving the repo to the same directory where you are running jupyter and search for it with an !ls
How to use Github Package in Jupyter Notebooks
You need to add a system path (or install the package to the default python libary) before using "import dygraphs.graph". See the example .
Add something like this in your jupyter notebook:
sys.path.append("../")
Then change "../" to the relative path to "dygraphs" folder you downloaded.
How to install module in Jupyter Notebooks for iPython
Run ! pip install <package>
within the jupyter notebook.
The ! tells the notebook to run the command in bash, just make sure the pip you are using is the same interpreter the notebook is using
Use package from Github in Conda Virtual Environment
I ended up doing the following:
- Install git in the virtual environment: (conda install git)
- Clone the project. (git clone [URL])
- Install the package (cd to package directory that contains setup.py.
- Then run "python setup.py install").
Found the answer in the first part in this video: How to Install Python Package from GitHub
Related Topics
Multiprocessing VS Multithreading VS Asyncio in Python 3
Pandas: Convert Dtype 'Object' to Int
Printing Without Newline (Print 'A',) Prints a Space, How to Remove
Why Do I Get "Pickle - Eoferror: Ran Out of Input" Reading an Empty File
Reset Color Cycle in Matplotlib
Set Up Python 3 Build System with Sublime Text 3
My Py2App App Will Not Open. What's the Problem
Numpy.Where() Detailed, Step-By-Step Explanation/Examples
Create a Main Loop with Tkinter
Get List of All Routes Defined in the Flask App
Minimum Euclidean Distance Between Points in Two Different Numpy Arrays, Not Within
How to Wrap Every Method of a Class
Matrix Multiplication in Pure Python
Python's Sum VS. Numpy's Numpy.Sum
How to Do N-D Distance and Nearest Neighbor Calculations on Numpy Arrays