我一直在关注https://devcenter.heroku.com/articles/getting-started-with-python的指南,唯一不同的是我使用virtualenv -p D:\Python27\python.exe venv
而不是virtualenv venv
因为我在Python 3.5中安装了virtualenv。< / p>
一旦我继续声明应用依赖,我在使用pip安装依赖项时遇到了问题;
pip install -r requirements.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.py collectstatic
。
但是,当我运行heroku local web -f Procfile.windows
时,我得到:
forego | starting web.1 on port 5000
web.1 | Performing system checks...
它无限期地保持这种状态。
答案 0 :(得分:2)
我也遇到了这个问题。我跑的时候卡住了:&#34; heroku local web -f Procfile.windows&#34;然后我尝试像这样手动执行:&#34; python manage.py runserver 0.0.0.0:5000"它运作得很好。