【问题标题】:Error while deploying flask app to Heroku将烧瓶应用程序部署到 Heroku 时出错
【发布时间】:2016-07-05 06:51:56
【问题描述】:

我正在尝试将烧瓶应用程序部署到 Heroku。当我使用 heroku local web 运行这个应用程序时,它在本地运行良好

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

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

我已验证我已安装正确的 https 绑定

python -c "import hashlib; print dir(hashlib)"
python -c "import httplib; print dir(httplib)"
python -c "import httplib; print dir(httplib.HTTPSConnection)"

完整的错误日志:-

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

【问题讨论】:

    标签: python heroku flask


    【解决方案1】:

    heroku 正在生成此错误。事实证明,我没有使用正确的配置来构建应用程序。有些我错过了runtime.txt 文件,其中包含以下文本。

    python-2.7.11
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-01-06
      • 1970-01-01
      • 2020-10-19
      • 1970-01-01
      • 2020-11-08
      相关资源
      最近更新 更多