我一直在关注 https://devcenter.heroku.com/articles/getting-started-with-python 上的指南,我做的唯一不同的是我使用了 virtualenv -p D:\Python27\python.exe venv 而不是 virtualenv venv 因为我在 Python 中安装了 virtualenv 3.5.
当我继续声明应用程序依赖项后,我在使用 pip 安装依赖项时遇到了问题;
pip install -r requests.txt --allow-all-external
一旦到达 psycopg2 依赖项,就会给我以下内容:
Collecting psycopg2==2.6 (from -r requirements.txt (line 5))
Using cached psycopg2-2.6.tar.gz
Complete output from command python setup.py egg_info:
running egg_info
creating pip-egg-info\psycopg2.egg-info
writing pip-egg-info\psycopg2.egg-info\PKG-INFO
writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt
writing dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.
txt
writing manifest file 'pip-egg-info\psycopg2.egg-info\SOURCES.txt'
warning: manifest_maker: standard file '-c' not found
Error: pg_config executable not found.
Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:
python setup.py build_ext --pg-config /path/to/pg_config build ...
or with the pg_config option in 'setup.cfg'.
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\seven_~1
\appdata\local\temp\pip-build-cdwueb\psycopg2
所以我将requirements.txt中的psycopg2版本从2.6更改为2.6.1。然后所有依赖项都正确安装,并且我能够运行 python manage.pycollectstatic
。
但是,当我运行 heroku local web -f Procfile.windows
时,我得到:
forego | starting web.1 on port 5000
web.1 | Performing system checks...
它无限期地保持在这种状态。
最佳答案
我也遇到这个问题了。当我运行:“heroku local web -f Procfile.windows”时它卡住了,然后我尝试像这样手动执行:“python manage.py runserver 0.0.0.0:5000”并且它工作得很好。
关于python - Heroku - 执行系统检查时卡住,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34180414/