1

WHAT am I doing wrong?

This doesn't help: Installing module from GitHub through Jupyter notebook

I just want to import this python module. Just the one. It's at

http://github.com/peterroelants/peterroelants.github.io/tree/master/notebooks/gaussian_process/rational_quadratic.py


!pip install git+http://github.com/peterroelants/peterroelants.github.io/tree/master/notebooks/gaussian_process/rational_quadratic.git



​

Collecting git+http://github.com/peterroelants/peterroelants.github.io/tree/master/notebooks/gaussian_process/rational_quadratic.git
  Cloning http://github.com/peterroelants/peterroelants.github.io/tree/master/notebooks/gaussian_process/rational_quadratic.git to /private/var/folders/xq/0txkbk490zl1y5wp5vd3bhhnpw3bp9/T/pip-req-build-pzltmobn
  Running command git clone -q http://github.com/peterroelants/peterroelants.github.io/tree/master/notebooks/gaussian_process/rational_quadratic.git /private/var/folders/xq/0txkbk490zl1y5wp5vd3bhhnpw3bp9/T/pip-req-build-pzltmobn
  fatal: repository 'http://github.com/peterroelants/peterroelants.github.io/tree/master/notebooks/gaussian_process/rational_quadratic.git/' not found
ERROR: Command errored out with exit status 128: git clone -q http://github.com/peterroelants/peterroelants.github.io/tree/master/notebooks/gaussian_process/rational_quadratic.git /private/var/folders/xq/0txkbk490zl1y5wp5vd3bhhnpw3bp9/T/pip-req-build-pzltmobn Check the logs for full command output.

1 Answer 1

1

You would usually clone the root repository including all the files, but also the repository does not seem to be a Python Package. The reason you are getting the error is because pip works through PyPi which hosts all the python packages, and the mentioned repository is not hosted on there. However, in your case you could just clone the repository or copy,download the rational_quadratic.py to your project directory and import the module. This post may be able to help.

Sign up to request clarification or add additional context in comments.

2 Comments

"pip works through PyPi" That's not exactly true. pip looks at PyPI when asked to install a package by name (pip install numpy). But it can install packages from URLs. In the case of the OP the URL points to a branch at Github (which is an error — the URL must point to the root of the repo + it's possible to select a commit, a tag or a branch) at a repository that's not a pip-installable package (which is an error 2 here). The rest of your answer is ok.
I agree, I'll be careful of my answers in the future. Thanks for the comment!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.