簡體   English   中英

推送被拒絕,無法編譯Python應用,pythonnet:狀態為“錯誤”

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

我正在嘗試將基於Python的Web應用程序部署到Heroku,但出現此錯誤:

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

我嘗試更新setuptoolswheel但仍在發生。

這是完整的錯誤消息:

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

這是我的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

這是我的Procfile

web: gunicorn app:app

一般來說,使用虛擬環境將一個應用程序的依賴與其他應用程序隔離是一個好主意。 根據您requirements.txt的內容,我懷疑您沒有這樣做。

pywin32絕對不能在Heroku上運行,因為它無法運行Windows。 pythonnet可能在Heroku上可用,但由於Heroku不正式支持.NET ,因此至少需要一個自定義的buildpack。 如果此應用程序確實不需要它們,則將它們從requirements.txt刪除,然后再次部署。

理想情況下,您還將刪除實際上不需要的任何其他庫,但是只要它們在Heroku上運行,它們就不會引起部署錯誤。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM