我正在尝试在Azure上运行Django应用,我想使用我们已经拥有的Postgres数据库。所以我需要安装psycopg2 python软件包。
注意:我在Mac上并使用git进行部署。
我的requirements.txt很简单:
django==1.6.2
pytz
psycopg2
但是,当尝试查找postgres二进制文件时进入psycopyg2时,它将失败。
remote: Downloading/unpacking psycopg2 (from -r requirements.txt (line 3))
remote: Running setup.py (path:D:\home\site\wwwroot\env\build\psycopg2\setup.py) egg_info for package psycopg2
remote:
remote: Error: pg_config executable not found.
remote:
remote: Please add the directory containing pg_config to the PATH
remote: or specify the full executable path with the option:
remote:
remote: python setup.py build_ext --pg-config /path/to/pg_config build ...
remote:
remote: or with the pg_config option in 'setup.cfg'.
remote: Complete output from command python setup.py egg_info:
remote: running egg_info
remote:
remote: creating pip-egg-info\psycopg2.egg-info
remote:
remote: writing pip-egg-info\psycopg2.egg-info\PKG-INFO
remote:
remote: writing top-level names to pip-egg-info\psycopg2.egg-info\top_level.txt
remote:
remote: writing dependency_links to pip-egg-info\psycopg2.egg-info\dependency_links.txt
remote:
remote: writing manifest file 'pip-egg-info\psycopg2.egg-info\SOURCES.txt'
remote:
remote: warning: manifest_maker: standard file '-c' not found
remote:
remote:
remote:
remote: Error: pg_config executable not found.
remote:
remote:
remote:
remote: Please add the directory containing pg_config to the PATH
remote:
remote: or specify the full executable path with the option:
remote:
remote:
remote:
remote: python setup.py build_ext --pg-config /path/to/pg_config build ...
remote:
remote:
remote:
remote: or with the pg_config option in 'setup.cfg'.
我尝试将Windows Postgres二进制文件添加到/ pgsql的项目中,然后在Azure中更新配置以包括该文件夹。我希望能够附加到PATH,但是configure选项卡告诉我这是不允许的。
似乎我可能需要启动脚本或其他方式来加载这些依赖项。在Mac上,只有Visual Studio,找不到太多有关如何执行此操作的参考。
我是否只需要移至虚拟机?
有一个psycopg2-windows。Python 2.7的示例:
pip install git+https://github.com/nwcell/psycopg2-windows.git@win32-py27#egg=psycopg2
在win-psycopg ptoject主页上也有安装说明。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句