简体   繁体   English

推送被拒绝,无法编译Python应用,pythonnet:状态为“错误”

[英]Push rejected, failed to compile Python app, pythonnet: finished with status 'error'

I'm trying to deploy my Python based webapp to Heroku but I am getting this error: 我正在尝试将基于Python的Web应用程序部署到Heroku,但出现此错误:

error: option --single-version-externally-managed not recognized

I tried updating setuptools and wheel but its still happening. 我尝试更新setuptoolswheel但仍在发生。

Here is the full error message: 这是完整的错误消息:

Running setup.py install for pythonnet: started
remote:            Running setup.py install for pythonnet: finished  with status 'error'
remote:            Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6ls167h_/pythonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-hdv3d_au-record/install-record.txt --single-version-externally-managed --compile:
remote:            usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
remote:               or: -c --help [cmd1 cmd2 ...]
remote:               or: -c --help-commands
remote:               or: -c cmd --help
remote:
remote:            error: option --single-version-externally-managed not recognized

Here is my requirements.txt : 这是我的requirements.txt

altgraph==0.16.1
astroid==2.2.5
atomicwrites==1.3.0
attrs==19.1.0
autopep8==1.4.4
beautifulsoup4==4.7.1
bs4==0.0.1
certifi==2019.6.16
chardet==3.0.4
chicken==0.1.0
Click==7.0
colorama==0.4.1
Django==2.2.1
dominate==2.3.5
egg==0.2.0
entrypoints==0.3
eyeD3==0.8.10
flake8==3.7.7
Flask==1.0.3
Flask-Bootstrap4==4.0.2
Flask-WTF==0.14.2
future==0.17.1
gunicorn==19.9.0
idna==2.8
importlib-metadata==0.18
isort==4.3.21
itsdangerous==1.1.0
Jinja2==2.10.1
lazy-object-proxy==1.4.1
lxml==4.3.4
macholib==1.11
MarkupSafe==1.1.1
mccabe==0.6.1
more-itertools==7.0.0
packaging==19.0
pefile==2019.4.18
pluggy==0.12.0
py==1.8.0
pycodestyle==2.5.0
pyflakes==2.1.1
PyInstaller==3.4
pylint==2.3.1
pymessenger==0.0.7.0
pyparsing==2.4.0
pytest==4.6.3
python-magic==0.4.15
pythonnet==2.4.0
pytube==9.5.1
pytz==2019.1
pywebview==2.4
pywin32-ctypes==0.2.0
requests==2.22.0
requests-toolbelt==0.9.1
six==1.12.0
soupsieve==1.9.2
spotify-downloader==0.4.2
spotipy==2.4.4
sqlparse==0.3.0
typed-ast==1.4.0
urllib3==1.25.3
virtualenv==16.6.0
visitor==0.1.3
wcwidth==0.1.7
Werkzeug==0.15.4
wrapt==1.11.2
WTForms==2.2.1
zipp==0.5.1

And here is my Procfile : 这是我的Procfile

web: gunicorn app:app

Generally speaking, it's a good idea to use virtual environments to isolate one application's dependencies from others. 一般来说,使用虚拟环境将一个应用程序的依赖与其他应用程序隔离是一个好主意。 Based on the contents of your requirements.txt I suspect that you're not doing this. 根据您requirements.txt的内容,我怀疑您没有这样做。

pywin32 definitely won't work on Heroku since it doesn't run Windows. pywin32绝对不能在Heroku上运行,因为它无法运行Windows。 pythonnet might be usable on Heroku but would require at least a custom buildpack since Heroku doesn't officially support .NET . pythonnet可能在Heroku上可用,但由于Heroku不正式支持.NET ,因此至少需要一个自定义的buildpack。 If you don't really need them for this application, remove them from your requirements.txt and deploy again. 如果此应用程序确实不需要它们,则将它们从requirements.txt删除,然后再次部署。

Ideally you would also remove any other libraries that you don't actually need, but as long as they run on Heroku they shouldn't cause deploy errors. 理想情况下,您还将删除实际上不需要的任何其他库,但是只要它们在Heroku上运行,它们就不会引起部署错误。

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

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