Darwin Tech
Darwin Tech

Reputation: 18929

Missing distribution spec error using pip install from requirements

I have just created a fresh virtualenv into which I want to run my pip install. However, I'm getting this error:

raise ValueError("Missing distribution spec", line)
ValueError: ('Missing distribution spec', '/path/to/dir/requirements.txt')

My requirements.txt:

Django==1.3
Jinja2==2.6
MySQL-python==1.2.3
PIL==1.1.7
Pygments==1.5
Sphinx==1.1.3
Werkzeug==0.8.3
django-debug-toolbar==0.9.4
django-excel-response==1.0
django-extensions==0.8
docutils==0.9.1
ipython==0.12
wsgiref==0.1.2

What is going wrong?

Upvotes: 14

Views: 13310

Answers (4)

Allen Geng
Allen Geng

Reputation: 53

if you are pushing to Azure, even with utf-8 you might also run into this problem:

ValueError: ('Missing distribution spec', '\xef\xbb\xbfDjango==1.11.4')

the safe way is to save as requirements.txt as ansi file.

well, given you are running on windows

Upvotes: 0

holl
holl

Reputation: 308

My issue ending up being that in some terminals, – and - look exactly the same. I had –r and it threw this error. You want -r.

Upvotes: 2

Justmaker
Justmaker

Reputation: 1371

I'd like to complete the answer if anyone runs in the same variant as I did: I was running everything on a Windows environment (windows 7). Under powershell, I had ran

pip freeze > requirements.txt

When I tested on a new virtualenv, I had the same error as above. The problem was an encoding issue (ugh): make sure the requirements.txt file is written in UTF-8 (without BOM). Notepad++ or sublime text can make sure of that.

Hope it helps anyone else for the which the answer above was not enough.

Upvotes: 15

Vinicius Cainelli
Vinicius Cainelli

Reputation: 847

You must be doing something wrong. Something like: pip install path/to/requirements.txt, but the requirements file must be passed with -r argument:

pip install -r path/to/requirements.txt

Hugs.

Upvotes: 19

Related Questions