将烧瓶应用程序部署到heroku错误

将烧瓶应用程序部署到heroku错误

本文介绍了将烧瓶应用程序部署到heroku错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

直到今天它给我这样的错误,我已经将这个特定的应用程序多次推向heroku了,直到今天它没有出现任何问题

I have pushed this particular app so many times to heroku without any issues until today when it gave me errors like this

Counting objects: 14, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (14/14), done.
Writing objects: 100% (14/14), 2.49 KiB | 0 bytes/s, done.
Total 14 (delta 7), reused 0 (delta 0)
remote: Compressing source files... done.
remote: Building source:
remote:
remote: -----> Python app detected
remote: -----> Installing python-3.5.1
remote:  !     Requested runtime (python-3.5.1) is not available for this stack (heroku-16).
remote:  !     Aborting.  More info:https://devcenter.heroku.com/articles/python-support
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy....
remote:
remote: !       Push rejected to serene-temple-30062.
remote:
To https://git.heroku.com/serene-temple-30062.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/serene-temple-30062.git'

然后我将runtime.txt更改为python-3.6.0,因为那是受支持的运行时,现在我得到了这样的错误

Then i changed the runtime.txt to python-3.6.0 since that was the supported runtime now i get errors like this

remote:          Found existing installation: appdirs 1.4.3
remote:            Uninstalling appdirs-1.4.3:
remote:              Successfully uninstalled appdirs-1.4.3
remote:          Rolling back uninstall of appdirs
remote:        Exception:
remote:        Traceback (most recent call last):
remote:          File "/app/.heroku/python/lib/python3.6/site-   packages/pkg_resources/__init__.py", line 2813, in _dep_ma
p
remote:            return self.__dep_map
remote:          File "/app/.heroku/python/lib/python3.6/site- packages/pkg_resources/__init__.py", line 2624, in __getat
tr__
remote:            raise AttributeError(attr)
remote:        AttributeError: _DistInfoDistribution__dep_map
remote:
remote:        During handling of the above exception, another exception occurred:
remote:
remote:        Traceback (most recent call last):
remote:          File "/app/.heroku/python/lib/python3.6/site- packages/pkg_resources/__init__.py", line 2804, in _parsed
_pkg_info
remote:            return self._pkg_info
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2624, in __getat
tr__
remote:            raise AttributeError(attr)
remote:        AttributeError: _pkg_info
remote:
remote:        During handling of the above exception, another exception    occurred:
remote:
remote:        Traceback (most recent call last):
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pip/basecommand.py", line 215, in main
remote:            status = self.run(options, args)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pip/commands/install.py", line 342, in run
remote:            prefix=options.prefix_path,
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pip/req/req_set.py", line 784, in install
remote:            **kwargs
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pip/req/req_install.py", line 851, in install
remote:            self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pip/req/req_install.py", line 1064, in move_wheel
_files
remote:            isolated=self.isolated,
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pip/wheel.py", line 247, in move_wheel_files
remote:            prefix=prefix,
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pip/locations.py", line 140, in distutils_scheme
remote:            d = Distribution(dist_args)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/dist.py", line 320, in __init__
remote:            _Distribution.__init__(self, attrs)
remote:          File  "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 281, in __init__
remote:            self.finalize_options()
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/dist.py", line 386, in finalize_option
s
remote:            ep.require(installer=self.fetch_build_egg)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2324, in require

remote:            items = working_set.resolve(reqs, env, installer, extras=self.extras)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 862, in resolve
remote:            new_requirements = dist.requires(req.extras)[::-1]
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2568, in require
s
remote:            dm = self._dep_map
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2815, in _dep_ma
p
remote:            self.__dep_map = self._compute_dependencies()
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2824, in _comput
e_dependencies
remote:            for req in self._parsed_pkg_info.get_all('Requires-Dist') or []:
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 2806, in _parsed
_pkg_info
remote:            metadata = self.get_metadata(self.PKG_INFO)
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1468, in get_met
adata
remote:            value = self._get(self._fn(self.egg_info, name))
remote:          File "/app/.heroku/python/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1577, in _get
remote:            with open(path, 'rb') as stream:
remote:        FileNotFoundError: [Errno 2] No such file or directory:  '/tmp/build_d5216bcdf3f42398e57859a9302dd93f/.her
oku/python/lib/python3.6/site-packages/appdirs-1.4.3.dist-info/METADATA'
remote:  !     Push rejected, failed to compile Python app.
remote:
remote:  !     Push failed
remote: Verifying deploy...
remote:
remote: !       Push rejected to serene-temple-30062.
remote:
To https://git.heroku.com/serene-temple-30062.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/serene-temple-30062.git'

请提供任何帮助,谢谢

推荐答案

我最近遇到了这个问题.这似乎是一个问题,尤其是对于appdirs.我已经解决了这个问题,只需升级appdirs,更新我的requirements.txt文件,然后重新部署到heroku.

I faced this issue recently. This seems to be an issue particularly with appdirs. I've resolved this issue by just simply upgrading appdirs, updating my requirements.txt and then redeploying to heroku.

pip install appdirs --upgrade
pip freeze > requirements.txt

这篇关于将烧瓶应用程序部署到heroku错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 14:06