Pregunta

I'm confused. I've got a working pip install command (meaning: it installs a version of a library from Github which works for me), and I have a non-working (meaning: it installs a version of a library which does not work for me) way of putting that requirement into a requirements.txt file.

More concrete:

If I type on the command line

pip install -e 'git://github.com/mozilla/elasticutils.git#egg=elasticutils'

and then test my program, all works fine. If I put this line into my requirements.txt:

-e git://github.com/mozilla/elasticutils.git#egg=elasticutils

and then run my program, it breaks with an error (only the library should have changed, so I guess sth has changed in that library between the two versions).

But shouldn't both versions do exactly the same?? (Of course I've done my best to remove the installed version of the library between the two tests again, using pip uninstall elasticutils.)

Any information welcome …

¿Fue útil?

Solución

Yep, as I wrote in my comment above, there seems to be a dependency-override when the requirements.txt states different than the dependencies in the packages. In my case installing the package manually also installed the (newer) version of requests, namely 1.2.0. Using the requirements.txt always installed (due to the override) the version 0.14.2 of requests.

Problem solved by updating the requests version in the requirements.txt :-)

Otros consejos

Well I don't know exactly what's the difference, but when I want something to be installed from the requirements.txt and it's a git repo I do the following line:

#git+https://github.com/user/package_name.git

and then installing as following:

pip install -r requirements.txt
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top