How to Install Python Package from Github

How to install Python package from GitHub?

You need to use the proper git URL:

pip install git+https://github.com/jkbr/httpie.git#egg=httpie

Also see the VCS Support section of the pip documentation.

Don’t forget to include the egg=<projectname> part to explicitly name the project; this way pip can track metadata for it without having to have run the setup.py script.

How to install Python package from GitHub that doesn't have setup.py in it

Looks like the developer didn't bother to package it properly. It it was me using it, I would fork it on GH, add the setup.py and use the fork. Maybe a good exercise for you?

Meanwhile, to just get it to work, in your project "root":

git clone https://github.com/LBank-exchange/lbank-api-sdk-v2.git
ln -s lbank-api-sdk-v2/python-sdk-api/LBank ./LBank

Then in your code just import LBank. This will leave the cloned repo untouched (so you can git pull to update it later) and just link the module directory to the root. Alternatively you can just include the api directory in sys.path for imports to work.

How to install local python packages when building jobs under Github Actions?

The "package under test", potion in your case, should not be part of the requirements.txt. Instead, simply add your line

pip install -e .

after the line with pip install -r requirements.txt in it. That installs the already checked out package in development mode and makes it available locally for an import.

Alternatively, you could put that line at the latest needed point, i.e. right before you run pytest.

Installing Python Package from Github Using PIP

The -e flag tells pip to install it as "editable", i.e. keep the source around. Drop the -e flag and it should do about what you expect.

sudo pip install git+git://github.com/myuser/myproject.git#egg=myproject

If that doesn't work try using https instead of git.

sudo pip install git+https://github.com/myuser/myproject.git#egg=myproject


Related Topics



Leave a reply



Submit