我想在Heroku上部署一个dash应用程序。我正在使用pyscopg2
从Postgres导入数据。我尝试使用versions 2.8.6 and 2.7.5
。当我在本地机器上使用这两个版本运行应用程序时,它可以正常工作。现在,他们每个人都有问题
2.8.6
一起:该应用程序部署在Heroku上,但不运行。当我尝试在本地运行它时,会显示以下错误
Traceback (most recent call last):
File "/Users/nikhilsawal/OneDrive/investment-portfolio-app/eda.py", line 2, in <module>
import psycopg2
File "/Users/nikhilsawal/OneDrive/investment-portfolio-app/app_env/lib/python3.7/site-packages/psycopg2/__init__.py", line 51, in <module>
from psycopg2._psycopg import ( # noqa
ImportError: dlopen(/Users/nikhilsawal/OneDrive/investment-portfolio-app/app_env/lib/python3.7/site-packages/psycopg2/_psycopg.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libssl.1.1.dylib
Referenced from: /Users/nikhilsawal/OneDrive/investment-portfolio-app/app_env/lib/python3.7/site-packages/psycopg2/_psycopg.cpython-37m-darwin.so
Reason: image not found
应用程序无法部署。当我运行git push heroku master
时。我得到以下错误
ERROR: Failed building wheel for psycopg2
error: command '/usr/bin/gcc' failed with exit code 1
remote: ----------------------------------------
remote: ERROR: Command errored out with exit status 1: /app/.heroku/python/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-125s5nei/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-125s5nei/psycopg2/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-record-kygc7a2a/install-record.txt --single-version-externally-managed --compile --install-headers /app/.heroku/python/include/python3.9/psycopg2 Check the logs for full command output.
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
remote: Verifying deploy...
remote:
remote: ! Push rejected to investment-application.
remote:
To https://git.heroku.com/investment-application.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://git.heroku.com/investment-application.git'
我试过以下方法:
pip install psycopg2-binary
我正在使用python版本3.7.3
,我也在使用virtualenvironment
目前没有回答
相关问题 更多 >
编程相关推荐