Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ImportError: No module named 'pip._vendor.requests' #30

Open
davidbilik opened this issue Mar 21, 2016 · 1 comment
Open

ImportError: No module named 'pip._vendor.requests' #30

davidbilik opened this issue Mar 21, 2016 · 1 comment

Comments

@davidbilik
Copy link

Hi, I've been using your buildpack for a last month and it's been working fine but when I want to create new application it fails on this:

2016-03-21T17:30:07.31+0100 [STG/210]    OUT -----> Downloaded app package (20K)
2016-03-21T17:30:07.46+0100 [STG/0]      ERR Cloning into '/tmp/buildpacks/heroku-buildpack-scipy'...
2016-03-21T17:30:26.36+0100 [STG/0]      OUT -----> Installing runtime (python-2.7.10)
2016-03-21T17:30:42.41+0100 [STG/0]      OUT -----> Installing dependencies with pip
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ERROR:root:code for hash md5 was not found.
2016-03-21T17:30:42.63+0100 [STG/0]      ERR Traceback (most recent call last):
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     globals()[__func_name] = __get_hash(__func_name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     raise ValueError('unsupported hash type ' + name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ValueError: unsupported hash type md5
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ERROR:root:code for hash sha1 was not found.
2016-03-21T17:30:42.63+0100 [STG/0]      ERR Traceback (most recent call last):
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     globals()[__func_name] = __get_hash(__func_name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     raise ValueError('unsupported hash type ' + name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ValueError: unsupported hash type sha1
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ERROR:root:code for hash sha224 was not found.
2016-03-21T17:30:42.63+0100 [STG/0]      ERR Traceback (most recent call last):
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     globals()[__func_name] = __get_hash(__func_name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     raise ValueError('unsupported hash type ' + name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ValueError: unsupported hash type sha224
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ERROR:root:code for hash sha256 was not found.
2016-03-21T17:30:42.63+0100 [STG/0]      ERR Traceback (most recent call last):
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     globals()[__func_name] = __get_hash(__func_name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     raise ValueError('unsupported hash type ' + name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ValueError: unsupported hash type sha256
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ERROR:root:code for hash sha384 was not found.
2016-03-21T17:30:42.63+0100 [STG/0]      ERR Traceback (most recent call last):
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     globals()[__func_name] = __get_hash(__func_name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     raise ValueError('unsupported hash type ' + name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ValueError: unsupported hash type sha384
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ERROR:root:code for hash sha512 was not found.
2016-03-21T17:30:42.63+0100 [STG/0]      ERR Traceback (most recent call last):
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 147, in <module>
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     globals()[__func_name] = __get_hash(__func_name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 97, in __get_builtin_constructor
2016-03-21T17:30:42.63+0100 [STG/0]      ERR     raise ValueError('unsupported hash type ' + name)
2016-03-21T17:30:42.63+0100 [STG/0]      ERR ValueError: unsupported hash type sha512
2016-03-21T17:30:42.77+0100 [STG/0]      ERR Traceback (most recent call last):
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "/app/.heroku/python/bin/pip", line 9, in <module>
2016-03-21T17:30:42.77+0100 [STG/0]      ERR     load_entry_point('pip==6.0.6', 'console_scripts', 'pip')()
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 519, in load_entry_point
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2630, in load_entry_point
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2310, in load
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "build/bdist.linux-x86_64/egg/pkg_resources/__init__.py", line 2316, in resolve
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/__init__.py", line 15, in <module>
2016-03-21T17:30:42.77+0100 [STG/0]      ERR     from pip.vcs import git, mercurial, subversion, bazaar  # noqa
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/vcs/mercurial.py", line 11, in <module>
2016-03-21T17:30:42.77+0100 [STG/0]      ERR     from pip.download import path_to_url
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/download.py", line 30, in <module>
2016-03-21T17:30:42.77+0100 [STG/0]      ERR     from pip._vendor import requests, six
2016-03-21T17:30:42.77+0100 [STG/0]      ERR   File "/app/.heroku/python/lib/python2.7/site-packages/pip-6.0.6-py2.7.egg/pip/_vendor/__init__.py", line 81, in load_module
2016-03-21T17:30:42.77+0100 [STG/0]      ERR     raise ImportError("No module named '%s'" % (name,))
2016-03-21T17:30:42.77+0100 [STG/0]      ERR ImportError: No module named 'pip._vendor.requests'
2016-03-21T17:30:42.80+0100 [STG/0]      OUT Staging failed: Buildpack compilation step failed
2016-03-21T17:30:42.99+0100 [API/0]      ERR encountered error: App staging failed in the buildpack compile phase

The content of requirements.txt doesn't matter, if i have that file empty the build still fails. I think that it has something to do with new stack cf_linuxfs2 based on this issue https://developer.ibm.com/answers/questions/236264/bluemix-and-python-deploy-error-after-platform-upg.html but I dont really know what that means or how to fix it. My knowledge of buildpacks is basically none.

One last thing - if i try to print state of my app the log says

$ cf app my_app
Showing health and status for app my_app in org ... / space ... as ...
FAILED
Server error, status code: 400, error code: 170004, message: App staging failed in the buildpack compile phase
@branliu0
Copy link
Owner

Hi, thanks for including all this information.

Did you change anything recently that caused this error?

Basically it looks like this is a problem with your Python linking properly to openssl packages, which is a lower-level issue. But I guess the buildpack might have to install Python differently on the CF stack, which explains why CF has their own fork of the base python buildpack.

I don't have the bandwidth to investigate this further right now, and fix... The answer would probably involve looking at how the CF buildpack installs Python differently from the vanilla python buildpack.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants