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.
bearcub
  • 313
  • 4
  • 11

1 Answers1

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.

Grativo
  • 58
  • 4
  • 3
    "*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. – phd Dec 28 '19 at 13:04
  • 1
    I agree, I'll be careful of my answers in the future. Thanks for the comment! – Grativo Dec 30 '19 at 05:01