我正在尝试将flask应用程序部署到heroku。进行git push heroku master
时一切正常,直到
remote: Running setup.py install for dbus-python: finished with status 'error'
remote: Complete output from command /app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9ijiww5r/dbus-python/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-ud7a7czj-record/install-record.txt --single-version-externally-managed --compile:
remote: running install
remote: running build
remote: creating /tmp/pip-build-9ijiww5r/dbus-python/build
remote: creating /tmp/pip-build-9ijiww5r/dbus-python/build/temp.linux-x86_64-3.6
然后它会检查不同的编译器和库,但是何时进入dbus
remote: checking for DBUS... no
remote: configure: error: Package requirements (dbus-1 >= 1.8) were not met:
remote:
remote: No package 'dbus-1' found
remote:
remote: Consider adjusting the PKG_CONFIG_PATH environment variable if you
remote: installed software in a non-standard prefix.
remote:
remote: Alternatively, you may set the environment variables DBUS_CFLAGS
remote: and DBUS_LIBS to avoid the need to call pkg-config.
remote: See the pkg-config man page for more details.
remote: Traceback (most recent call last):
remote: File "<string>", line 1, in <module>
remote: File "/tmp/pip-build-9ijiww5r/dbus-python/setup.py", line 111, in <module>
remote: tests_require=['tap.py'],
remote: File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
remote: return distutils.core.setup(**attrs)
remote: File "/app/.heroku/python/lib/python3.6/distutils/core.py", line 148, in setup
remote: dist.run_commands()
remote: File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 955, in run_commands
remote: self.run_command(cmd)
remote: File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
remote: cmd_obj.run()
remote: File "/app/.heroku/python/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
remote: return orig.install.run(self)
remote: File "/app/.heroku/python/lib/python3.6/distutils/command/install.py", line 545, in run
remote: self.run_command('build')
remote: File "/app/.heroku/python/lib/python3.6/distutils/cmd.py", line 313, in run_command
remote: self.distribution.run_command(command)
remote: File "/app/.heroku/python/lib/python3.6/distutils/dist.py", line 974, in run_command
remote: cmd_obj.run()
remote: File "/tmp/pip-build-9ijiww5r/dbus-python/setup.py", line 64, in run
remote: cwd=builddir)
remote: File "/app/.heroku/python/lib/python3.6/subprocess.py", line 311, in check_call
remote: raise CalledProcessError(retcode, cmd)
remote: subprocess.CalledProcessError: Command '['/tmp/pip-build-9ijiww5r/dbus-python/configure', '--disable-maintainer-mode', 'PYTHON=/app/.heroku/python/bin/python', '--prefix=/tmp/pip-build-9ijiww5r/dbus-python/build/temp.linux-x86_64-3.6/prefix']' returned non-zero exit status 1.
remote:
remote: ----------------------------------------
remote: Command "/app/.heroku/python/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-9ijiww5r/dbus-python/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-ud7a7czj-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-9ijiww5r/dbus-python/
remote: ! Push rejected, failed to compile Python app.
remote:
remote: ! Push failed
我已经花了几个小时了,但我真的无法弄清楚。我可以使用在我的计算机上运行的flask来启动该站点,但是我猜测heroku不支持某些功能,而我现在完全迷失了。这是我的Requirements.txt文件,以备不时之需
asn1crypto==0.24.0
certifi==2019.9.11
chardet==3.0.4
Click==7.0
configparser==3.5.0b2
cryptography==2.6.1
dbus-python==1.2.12
entrypoints==0.3
enum34==1.1.6
Flask==1.1.1
Flask-SQLAlchemy==2.4.1
Flask-WTF==0.14.2
gunicorn==19.9.0
idna==2.8
ipaddress==1.0.17
itsdangerous==1.1.0
Jinja2==2.10.3
keyring==18.0.1
keyrings.alt==3.1.1
MarkupSafe==1.1.1
psycopg2==2.8.4
pycrypto==2.6.1
PyGObject==3.34.0
pyxdg==0.25
requests==2.22.0
SecretStorage==2.3.1
six==1.12.0
SQLAlchemy==1.3.11
stripe==2.37.2
urllib3==1.25.6
Werkzeug==0.16.0
WTForms==2.2.1