简体   繁体   中英

How to specify a specific github repo version in requirements.txt?

I want to be able to install a specific version of a github repo. I followed the instructions given here and my file requirements.txt looks as follows:

git://github.com/twoolie/NBT@f9e892e

I also tried the following versions:

git+git://github.com/twoolie/NBT@f9e892e
git+git://github.com/twoolie/NBT.git@f9e892e
git://github.com/twoolie/NBT.git@f9e892e

but in every case when I try to install the actual package, which requires the repository NBT from commit hash f9e892e, I get the error message

error in PyBlock setup command: 'install_requires' must be a string or list of strings containing valid project/version requirement specifiers; Invalid requirement, parse error at "'://githu'"

So how to do it correctly?

I solved the problem by adding the following argument to the setup method in `setup.py':

install_requires=['NBT@git+git://github.com/twoolie/NBT@f9e892'],

and using an empty requirements.txt file. With these setting the install of the specific version of the package did work finally.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM