# ValueError with pip virtualenv

**URL:** <https://forum.ansible.com/t/valueerror-with-pip-virtualenv/14595>\
**Category:** Ansible Project\
**Created:** [February 18, 2014, 10:14pm UTC](https://forum.ansible.com/t/valueerror-with-pip-virtualenv/14595 "2014-02-18T22:14:04Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kesten\_Broughton2](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Kesten\_Broughton2](https://forum.ansible.com/u/Kesten_Broughton2)\
**Post date:** [February 18, 2014, 10:14pm UTC](https://forum.ansible.com/t/valueerror-with-pip-virtualenv/14595/1 "2014-02-18T22:14:04Z")

</div>

This is my first time using virtualenv options with pip.  
I was finding that i got errors about wheel if i installed pip without the no-use-wheel, so i pass it in as extra\_args

- name: Upgrade setuptools  
pip: virtualenv=“{{default\_virtualenv}}”  
name=setuptools extra\_args=upgrade,no-use-wheel

Which gives error:

TASK: [linux\_osx\_common | Upgrade setuptools] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

failed: [prod-pivot] =\> {“cmd”: “ENV1/bin/pip install upgrade,no-use-wheel --use-mirrors setuptools”, “failed”: true, “item”: “”}

msg: stdout: New python executable in ENV1/bin/python

Installing setuptools, pip…done.

–use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.

Exception:

Traceback (most recent call last):

File “/tmp/ENV1/lib/python2.6/site-packages/pip/basecommand.py”, line 122, in main

status = self.run(options, args)

File “/tmp/ENV1/lib/python2.6/site-packages/pip/commands/install.py”, line 253, in run

InstallRequirement.from\_line(name, None))

File “/tmp/ENV1/lib/python2.6/site-packages/pip/req.py”, line 172, in from\_line

return cls(req, comes\_from, url=url, prereleases=prereleases)

File “/tmp/ENV1/lib/python2.6/site-packages/pip/req.py”, line 70, in **init**

req = pkg\_resources.Requirement.parse(req)

File “/tmp/ENV1/lib/python2.6/site-packages/pip/\_vendor/pkg\_resources.py”, line 2606, in parse

reqs = list(parse\_requirements(s))

File “/tmp/ENV1/lib/python2.6/site-packages/pip/\_vendor/pkg\_resources.py”, line 2544, in parse\_requirements

line, p, specs = scan\_list(VERSION,LINE\_END,line,p,(1,2),“version spec”)

File “/tmp/ENV1/lib/python2.6/site-packages/pip/\_vendor/pkg\_resources.py”, line 2512, in scan\_list

raise ValueError(“Expected “+item\_name+” in”,line,“at”,line[p:])

ValueError: (‘Expected version spec in’, ‘upgrade,no-use-wheel’, ‘at’, ‘,no-use-wheel’)

Storing debug log for failure in /root/.pip/pip.log

FATAL: all hosts have already failed – aborting

(ENV1)**[\*\*root@prod-pivot:**~\*\*\*\*]\*\* pip install setuptools --upgrade --no-use-wheel

Downloading/unpacking setuptools from [https://pypi.python.org/packages/source/s/setuptools/setuptools-2.2.tar.gz#md5=04a7664538957b832710653fd7d5b4e6](https://pypi.python.org/packages/source/s/setuptools/setuptools-2.2.tar.gz#md5=04a7664538957b832710653fd7d5b4e6)

Downloading setuptools-2.2.tar.gz (786kB): 786kB downloaded

Running setup.py (path:/root/venvs/ENV1/build/setuptools/setup.py) egg\_info for package setuptools

---

<div class="post-metadata">

**Author:** ![Michael\_DeHaan1](https://avatars.discourse-cdn.com/v4/letter/m/5e9695/32.png) [@Michael\_DeHaan1](https://forum.ansible.com/u/Michael_DeHaan1)\
**Post date:** [February 18, 2014, 10:16pm UTC](https://forum.ansible.com/t/valueerror-with-pip-virtualenv/14595/2 "2014-02-18T22:16:13Z")

</div>

Can you please file a github ticket on this?

Thanks!

---

<div class="post-metadata">

**Author:** ![Scott\_Sturdivant](https://avatars.discourse-cdn.com/v4/letter/s/f14d63/32.png) [@Scott\_Sturdivant](https://forum.ansible.com/u/Scott_Sturdivant)\
**Post date:** [February 19, 2014, 3:14pm UTC](https://forum.ansible.com/t/valueerror-with-pip-virtualenv/14595/3 "2014-02-19T15:14:26Z")

</div>

Kesten,

Have you tried ‘extra\_args=“–upgrade --no-use-wheel”’ ?

---

<div class="post-metadata">

**Author:** ![Kesten\_Broughton2](https://avatars.discourse-cdn.com/v4/letter/k/ecc23a/32.png) [@Kesten\_Broughton2](https://forum.ansible.com/u/Kesten_Broughton2)\
**Post date:** [February 19, 2014, 7:32pm UTC](https://forum.ansible.com/t/valueerror-with-pip-virtualenv/14595/4 "2014-02-19T19:32:59Z")

</div>

I tried it. The error is slightly different but similar

Filing a ticket.

TASK: [linux\_osx\_common | Upgrade setuptools] \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*

failed: [prod-pivot] =\> {“cmd”: “ENV1/bin/pip install upgrade no-use-wheel --use-mirrors setuptools”, “failed”: true, “item”: “”}

msg: stdout: New python executable in ENV1/bin/python

Installing setuptools, pip…done.

–use-mirrors has been deprecated and will be removed in the future. Explicit uses of --index-url and/or --extra-index-url is suggested.

Downloading/unpacking upgrade

Could not find any downloads that satisfy the requirement upgrade

Cleaning up…

No distributions at all found for upgrade

Storing debug log for failure in /root/.pip/pip.log

FATAL: all hosts have already failed – aborting
