0

Getting this error when attempting to push my flask app to heroku for the first time:

-----> 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:

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:

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:

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

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

Edit 1: Going to start reading through setup tools documentation. Hopefully I can find an answer in there.

FredF
  • 7
  • 2

1 Answers1

0

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: i.e.

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!

FredF
  • 7
  • 2