简体   繁体   中英

Heroku can't find setup.py?

I have the following dir setup.

.
├── setup.py
├── src
│   └── mymodule 
│       ├── __init__.py
│       ├── database.py
│       ├── models.py
│       ├── parallel.py
│       └── utils.py
└── venv
    ├── bin
    │   ├── activate
    │   ├── activate.csh
    │   ├── activate.fish
    │   ├── activate_this.py
    │   ├── coverage
    │   ├── easy_install
    ....

with the following setup.py:

setup(
    name='mymodule',
    version='0.1.0',
    install_requires=[],  # Don't put anything here, just use requirements.txt
    packages=['mymodule'],
    package_dir={'mymodule': 'src/mymodule'},
)

with requirements.txt:

Flask==0.9
...
wsgiref==0.1.2
-e .

When I deploy on heroku, I get the error that heroku 'cant find mymodule.database'.

I tried running python setup.py on my local computer in the virtual env (i removed the egg myself to ensure the validity of my setup) and everything seems to work fine.

How can I tell heroku to run python setup.py install ? I thought -e . is supposed to do that for me already

It doesn't look like you have the appropriate structure to run a python app on heroku. Please review: https://devcenter.heroku.com/articles/python and see examples of heroku flask scaffolds on github. eg: https://github.com/zachwill/flask_heroku to get a better idea of how things should be set up. Once you get a hang of how to setup python apps in heroku, you can test locally using the foreman tool described in the heroku docs.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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