简体   繁体   English

Heroku找不到setup.py?

[英]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.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: 带有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'. 当我在heroku上部署时,出现错误,即heroku'无法找到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. 我尝试在虚拟环境中的本地计算机上运行python setup.py(我自己删除了鸡蛋以确保设置的有效性),并且一切正常。

How can I tell heroku to run python setup.py install ? 我如何告诉heroku运行python setup.py install I thought -e . 我以为-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. 您似乎没有合适的结构在heroku上运行python应用程序。 Please review: https://devcenter.heroku.com/articles/python and see examples of heroku flask scaffolds on github. 请查看: https//devcenter.heroku.com/articles/python,并在github上查看heroku烧瓶支架的示例。 eg: https://github.com/zachwill/flask_heroku to get a better idea of how things should be set up. 例如: https : //github.com/zachwill/flask_heroku以便更好地了解应如何设置。 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. 一旦掌握了如何在heroku中设置python应用程序的知识,就可以使用heroku文档中介绍的领班工具在本地进行测试。

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

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