Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Heroku TypeError: parse_requirements() missing 1 required keyword argument: 'session'

Tags:

python

pip

heroku

I am trying to migeate an app to the cedar-14 stack from cedar on Heroku. In my requirements.txt file I have:

....
robobrowser==0.5.1
....

When I try to deploy by pushing the project to heroku I get:

Collecting robobrowser==0.5.1 (from -r requirements.txt (line 17))
     Downloading robobrowser-0.5.1.tar.gz
       Traceback (most recent call last):
         File "<string>", line 20, in <module>
         File "/tmp/pip-build-PqCF2A/robobrowser/setup.py", line 38, in <module>
           for requirement in parse_requirements('requirements.txt')
         File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_file.py", line 19, in parse_requirements
           "parse_requirements() missing 1 required keyword argument: "
       TypeError: parse_requirements() missing 1 required keyword argument: 'session'
       Complete output from command python setup.py egg_info:
       Traceback (most recent call last):

         File "<string>", line 20, in <module>

         File "/tmp/pip-build-PqCF2A/robobrowser/setup.py", line 38, in <module>

           for requirement in parse_requirements('requirements.txt')

         File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/req/req_file.py", line 19, in parse_requirements

           "parse_requirements() missing 1 required keyword argument: "

       TypeError: parse_requirements() missing 1 required keyword argument: 'session'

       ----------------------------------------
       Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-PqCF2A/robobrowser

How can I fix this?

like image 233
user1592380 Avatar asked Jan 09 '15 21:01

user1592380


3 Answers

I ran into this problem installing wabbit_wappa for Python. I 'fixed' it by changing a line in setup.py from:

install_reqs = parse_requirements('requirements.txt')

to

install_reqs = parse_requirements('requirements.txt', session=False)

and it installed just fine.

like image 56
zbinsd Avatar answered Oct 19 '22 20:10

zbinsd


There is an open issue and a pull request in the robobrowser's github issue tracker:

  • Updated requirements for pip 6.0+ to include a session

Either wait for it being merged, or install robobrowser from the fork:

$ pip install git+https://github.com/xxinfinityxx/robobrowser

Downgrading pip could also be an option, but I'm not sure if you have control over which pip version to use on heroku.

like image 5
alecxe Avatar answered Oct 19 '22 18:10

alecxe


Try updating pip:

sudo pip install --upgrade pip

This fixed the problem for me.

like image 4
meduvigo Avatar answered Oct 19 '22 20:10

meduvigo