python - 错误:包目录“PSM”不存在推送失败
问题描述
第一次尝试将我的烧瓶应用程序推送到 heroku 时出现此错误:
-----> Python app detected
-----> Installing python-3.6.6
-----> Installing pip
-----> Installing SQLite3
-----> Installing requirements with pip
Obtaining file:///tmp/build_4ef7a6c864d09dbc04794509b4531098 (from -r /tmp/build_4ef7a6c864d09dbc04794509b4531098/requirements.txt (line 1))
Complete output from command python setup.py egg_info:
running egg_info
writing PSM.egg-info/PKG-INFO
writing dependency_links to PSM.egg-info/dependency_links.txt
writing requirements to PSM.egg-info/requires.txt
writing top-level names to PSM.egg-info/top_level.txt
error: package directory 'PSM' does not exist
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /tmp/build_4ef7a6c864d09dbc04794509b4531098/
! Push rejected, failed to compile Python app.
! Push failed
这是我的文件结构:
PSM/
.vscode/
flask_session/
psm/(all python, JS, html etc. in here)
PSM.egg-info/
procfile
requirements.txt
setup.py
还有我的 setup.py:
from setuptools import setup
setup(
name='PSM',
packages=['psm'],
include_package_data=True,
install_requires=[
'flask',
],
)
即使我更改了文件夹(PSM & psm)和 setup.py 的名称并重新制作了 egg 信息,它仍然显示:
error: package directory 'PSM' does not exist
我已经按照此处的建议升级了设置工具,并分别按照以下链接中的建议安装了 ez setup:
命令“python setup.py egg_info”失败,错误代码为 1
“python setup.py egg_info”失败,错误代码为 1
编辑 1:开始阅读设置工具文档。希望我能在那里找到答案。
解决方案
为了解决这个问题,我做了一个新项目。首先,我按照烧瓶安装说明进行操作:
然后我按照快速入门指南进行操作:
最后,我将它转换为一个大型应用程序,因此它是一个包。
然后,我用我的应用程序名称复制了我的子目录:即
PSM/
.vscode/
flask_session/
psm/(all python, JS, html etc. in here)<----COPY THIS
PSM.egg-info/
procfile
requirements.txt
setup.py
到这里
PSM2/
.vscode/
flask_session/
psm2/<--- Replaced this folder with old folder
PSM2.egg-info/
procfile
requirements.txt
setup.py
我不确定原始项目出了什么问题,但希望如果他们遇到同样的问题,这可能会对某人有所帮助!
推荐阅读
- java - Spring WebClient - 如何根据响应标头延迟重试
- r - 转向具有重复列名的宽数据框
- python - 当缺少值但散点图工作正常时,pandas DataFrame 线图不起作用
- ecmascript-next - 空值合并后缀运算符?
- python - 关于从维基百科抓取子弹信息的问题
- sql - 如何从一列中计算过去 X 周数据的百分比?
- javascript - 如何正确映射 url 数组并使数据进入状态?
- mongodb - 为什么 Mongodb 创建一个带有 ObjectsId 的数组而不是一个简单的对象数组?
- python - 无法为 api 请求设置参数
- wagtail - 覆盖 Wagtail Page.get_url()?