错误:包目录“ PSM”不存在推送失败

时间:2018-08-11 14:43:56

标签: python heroku flask packages

第一次尝试将我的烧瓶应用程序推送到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安装程序:

Command "python setup.py egg_info" failed with error code 1

“python setup.py egg_info” failed with error code 1

编辑1:开始阅读设置工具文档。希望我能在那里找到答案。

1 个答案:

答案 0 :(得分:0)

为解决此问题,我做了一个新项目。首先,我按照烧瓶的安装说明进行操作:

flask installation setup

然后我遵循了快速入门指南:

flask quickstart

最后,我将其转换为大型应用程序,因此它是一个程序包。

flask larger application

然后,我用我的应用程序名称复制了子目录,即

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

我不确定原始项目有什么问题,但希望这对某人遇到相同的问题有帮助!