简体   繁体   English

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

[英]error: package directory 'PSM' does not exist push failure

Getting this error when attempting to push my flask app to heroku for the first time: 尝试将我的烧瓶应用程序首次推送到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

Here is my file structure: 这是我的文件结构:

PSM/
    .vscode/
    flask_session/
    psm/(all python, JS, html etc. in here)
    PSM.egg-info/
    procfile
    requirements.txt
    setup.py

And my setup.py: 而我的setup.py:

from setuptools import setup

setup(
   name='PSM',
    packages=['psm'],
include_package_data=True,
install_requires=[
    'flask',
],
)

Even when I change the names of the folders (PSM & psm) and the setup.py and remake the egg info it still says: 即使当我更改文件夹的名称(PSM和psm)以及setup.py并重新制作egg信息时,它仍然显示:

error: package directory 'PSM' does not exist        

I have already upgraded setup tools as suggested here and installed ez setup as suggested in these links respectively: 我已经按照这里的建议升级了安装工具,并分别按照这些链接的建议安装了ez安装程序:

Command "python setup.py egg_info" failed with error code 1 命令“ python setup.py egg_info”失败,错误代码为1

“python setup.py egg_info” failed with error code 1 “ python setup.py egg_info”失败,错误代码为1

Edit 1: Going to start reading through setup tools documentation. 编辑1:开始阅读设置工具文档。 Hopefully I can find an answer in there. 希望我能在那里找到答案。

To resolve this, I have made a new project. 为了解决这个问题,我做了一个新项目。 First, I followed the flask installation instructions: 首先,我按照烧瓶的安装说明进行操作:

flask installation setup 烧瓶安装设置

I then followed the quickstart guide: 然后,我遵循了快速入门指南:

flask quickstart 烧瓶快速入门

And finally, I converted it to a large application so it is a package. 最后,我将其转换为大型应用程序,因此它是一个程序包。

flask larger application 烧瓶更大的应用

Then, I copied my subdirectory with my application name: ie 然后,我用我的应用程序名称复制了子目录:

PSM/
.vscode/
flask_session/
psm/(all python, JS, html etc. in here)<----COPY THIS
PSM.egg-info/
procfile
requirements.txt
setup.py

into here 进入这里

PSM2/
.vscode/
flask_session/
psm2/<--- Replaced this folder with old folder
PSM2.egg-info/
procfile
requirements.txt
setup.py

I'm not sure what was wrong with the original project, but hopefully this may help someone if they run into the same problem! 我不确定原始项目有什么问题,但是希望这对某人遇到相同的问题有帮助!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM