Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python Django requirements.txt

I have a requirements.txt file containing all my dependencies but it is not processed correctly :

After a pip install -r requirements.txt, I get the following pip freeze :

argparse==1.2.1
wsgiref==0.1.2

But when I do a pip install of :

numpy==1.6.2
Django==1.4.2
django-tastypie==0.9.14
pyes==0.19.1

And then run my pip install -r requirements.txt . Then it works.

Here is what my requirements.txt contains :

numpy==1.6.2
Django==1.4.2
django-tastypie==0.9.14
urllib3==1.5
pyes==0.19.1
BeautifulSoup==3.2.1
MySQL-python==1.2.3
IMAPClient==0.9.1
Jinja2==2.6
Pillow==2.0.0
amqp==1.0.9
anyjson==0.3.3
billiard==2.7.3.22
celery==3.0.16
django-celery==3.0.11
django-compressor==1.3
django-concurrency
django-extensions==1.1.1
https://codeload.github.com/toastdriven/django-haystack/zip/master#egg=django-haystack
django-model-utils==1.2.0
django-multiforloop==0.2.1
django-social-auth==0.7.22
html5lib==0.95
httplib2==0.8
kombu==2.5.7
logilab-astng==0.24.2
logilab-common==0.59.0
oauth2==1.5.211
ordereddict==1.1
pycrypto==2.6
pylint==0.27.0
python-dateutil==1.5
python-openid==2.2.5
pytz==2013b
six==1.3.0
unittest2==0.5.1
wsgiref==0.1.2
xlrd==0.9.0
xmltodict==0.4.6
django-storages>=1.1.8
boto==2.8.0
lxml==3.1.0
pyelasticsearch==0.4.1
django-tastypie-elasticsearch==0.1.0

Would anyone have a solution ?

like image 441
Mibou Avatar asked Apr 19 '13 13:04

Mibou


People also ask

What is Requirements txt file in Django?

The requirements. txt file is a very important document in a Python Data Science or Machine Learning project since it lists not only the packages necessary to run the code but also registers their respective versions.

How do I Install txt requirements in Python?

Use the pip install -r requirements. txt command to install all of the Python modules and packages listed in your requirements. txt file.

What are txt requirements in Python?

The requirements. txt is a file listing all the dependencies for a specific Python project. It may also contain dependencies of dependencies, as discussed previously. The listed entries can be pinned or non-pinned.


3 Answers

I tried this out and the problem is with django-tastypie-elasticsearch. There is a known issue, whereby installation with pip fails if Django hasn't been installed yet. Here is the issue report:

https://github.com/llonchj/django-tastypie-elasticsearch/issues/1

Looks like django-tastypie-elastic has only two contributors, so you're probably on your own. The good news is that it wasn't your fault!

like image 97
Nathan Gould Avatar answered Oct 23 '22 02:10

Nathan Gould


On mac:

To get your already installed dependencies

pip3 freeze > requirements.txt

from: Automatically create requirements.txt


Then if you want to install them, and you are using a virtual environment

pip3 install -r requirements.txt

from: How can I install packages using pip according to the requirements.txt file from a local directory?


If you want to update them

I just know how to do it with pip-review. https://pypi.org/project/pip-review/#description

pip3 install pip-review or pip install pip-review

then pip-review --local --auto

from: How to upgrade all Python packages with pip

like image 26
AnonymousUser Avatar answered Oct 23 '22 03:10

AnonymousUser


The "https://codeload.github.com/toastdriven/django-haystack/zip/master#egg=django-haystack" line is not a valid pip requirement. It should read "-e git+https://codeload.github.com/toastdriven/django-haystack/zip/master#egg=django-haystack"

like image 1
bruno desthuilliers Avatar answered Oct 23 '22 04:10

bruno desthuilliers