2016-07-05 80 views
4

我想部署烧瓶应用Heroku。这个程序是在本地细运行时,我使用heroku local web错误,同时部署烧瓶应用Heroku

运行它,但是当我尝试部署使用git push heroku master它,我得到错误

AttributeError: 'module' object has no attribute 'HTTPSConnection' 

我核实,我安装了

python -c "import hashlib; print dir(hashlib)" 
python -c "import httplib; print dir(httplib)" 
python -c "import httplib; print dir(httplib.HTTPSConnection)" 
适当HTTPS绑定

错误的完善的日志: -

git push heroku master 
Counting objects: 29, done. 
Delta compression using up to 4 threads. 
Compressing objects: 100% (26/26), done. 
Writing objects: 100% (29/29), 5.15 KiB | 0 bytes/s, done. 
Total 29 (delta 12), reused 0 (delta 0) 
remote: Compressing source files... done. 
remote: Building source: 
remote: 
remote: -----> Python app detected 
remote: ERROR:root:code for hash md5 was not found. 
remote: Traceback (most recent call last): 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:  globals()[__func_name] = __get_hash(__func_name) 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:  raise ValueError('unsupported hash type ' + name) 
remote: ValueError: unsupported hash type md5 
remote: ERROR:root:code for hash sha1 was not found. 
remote: Traceback (most recent call last): 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:  globals()[__func_name] = __get_hash(__func_name) 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:  raise ValueError('unsupported hash type ' + name) 
remote: ValueError: unsupported hash type sha1 
remote: ERROR:root:code for hash sha224 was not found. 
remote: Traceback (most recent call last): 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:  globals()[__func_name] = __get_hash(__func_name) 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:  raise ValueError('unsupported hash type ' + name) 
remote: ValueError: unsupported hash type sha224 
remote: ERROR:root:code for hash sha256 was not found. 
remote: Traceback (most recent call last): 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:  globals()[__func_name] = __get_hash(__func_name) 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:  raise ValueError('unsupported hash type ' + name) 
remote: ValueError: unsupported hash type sha256 
remote: ERROR:root:code for hash sha384 was not found. 
remote: Traceback (most recent call last): 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:  globals()[__func_name] = __get_hash(__func_name) 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:  raise ValueError('unsupported hash type ' + name) 
remote: ValueError: unsupported hash type sha384 
remote: ERROR:root:code for hash sha512 was not found. 
remote: Traceback (most recent call last): 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:  globals()[__func_name] = __get_hash(__func_name) 
remote: File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:  raise ValueError('unsupported hash type ' + name) 
remote: ValueError: unsupported hash type sha512 
remote: Traceback (most recent call last): 
remote: File "/app/.heroku/python/bin/pip", line 9, in <module> 
remote:  load_entry_point('pip==1.3.1', 'console_scripts', 'pip')() 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py", line 343, in load_entry_point 
remote:  return get_distribution(dist).load_entry_point(group, name) 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py", line 2309, in load_entry_point 
remote:  return ep.load() 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py", line 2015, in load 
remote:  entry = __import__(self.module_name, globals(),globals(), ['__name__']) 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/__init__.py", line 11, in <module> 
remote:  from pip.vcs import git, mercurial, subversion, bazaar # noqa 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/vcs/mercurial.py", line 9, in <module> 
remote:  from pip.download import path_to_url2 
remote: File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/download.py", line 72, in <module> 
remote:  class VerifiedHTTPSConnection(httplib.HTTPSConnection): 
remote: AttributeError: 'module' object has no attribute 'HTTPSConnection' 
remote:  $ pip install -r requirements.txt 
remote:  ERROR:root:code for hash md5 was not found. 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:   globals()[__func_name] = __get_hash(__func_name) 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:   raise ValueError('unsupported hash type ' + name) 
remote:  ValueError: unsupported hash type md5 
remote:  ERROR:root:code for hash sha1 was not found. 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:   globals()[__func_name] = __get_hash(__func_name) 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:   raise ValueError('unsupported hash type ' + name) 
remote:  ValueError: unsupported hash type sha1 
remote:  ERROR:root:code for hash sha224 was not found. 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:   globals()[__func_name] = __get_hash(__func_name) 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:   raise ValueError('unsupported hash type ' + name) 
remote:  ValueError: unsupported hash type sha224 
remote:  ERROR:root:code for hash sha256 was not found. 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:   globals()[__func_name] = __get_hash(__func_name) 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:   raise ValueError('unsupported hash type ' + name) 
remote:  ValueError: unsupported hash type sha256 
remote:  ERROR:root:code for hash sha384 was not found. 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:   globals()[__func_name] = __get_hash(__func_name) 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:   raise ValueError('unsupported hash type ' + name) 
remote:  ValueError: unsupported hash type sha384 
remote:  ERROR:root:code for hash sha512 was not found. 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 139, in <module> 
remote:   globals()[__func_name] = __get_hash(__func_name) 
remote:   File "/app/.heroku/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor 
remote:   raise ValueError('unsupported hash type ' + name) 
remote:  ValueError: unsupported hash type sha512 
remote:  Traceback (most recent call last): 
remote:   File "/app/.heroku/python/bin/pip", line 9, in <module> 
remote:   load_entry_point('pip==1.3.1', 'console_scripts', 'pip')() 
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py", line 343, in load_entry_point 
remote:   return get_distribution(dist).load_entry_point(group, name) 
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py", line 2309, in load_entry_point 
remote:   return ep.load() 
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/distribute-0.6.36-py2.7.egg/pkg_resources.py", line 2015, in load 
remote:   entry = __import__(self.module_name, globals(),globals(), ['__name__']) 
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/__init__.py", line 11, in <module> 
remote:   from pip.vcs import git, mercurial, subversion, bazaar # noqa 
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/vcs/mercurial.py", line 9, in <module> 
remote:   from pip.download import path_to_url2 
remote:   File "/app/.heroku/python/lib/python2.7/site-packages/pip-1.3.1-py2.7.egg/pip/download.py", line 72, in <module> 
remote:   class VerifiedHTTPSConnection(httplib.HTTPSConnection): 
remote:  AttributeError: 'module' object has no attribute 'HTTPSConnection' 
remote: 
remote: !  Push rejected, failed to compile Python app 

回答

6

这个错误是由heroku产生的。事实证明,我没有使用正确的配置来构建应用程序。一些我如何错过runtime.txt文件,其中包含以下文本。

python-2.7.11