Mat*_*kin 64 pip psycopg2 virtualenv
是否有可能安装psycopg2到virtualenv当我的开发系统的MacBook Pro与OS X 10.6没有安装PostgreSQL的?
当我pip install psycopg2在我的内部运行时virtualenv,我收到了下面显示的错误.
我正在尝试使用Django连接到服务器上的遗留数据库,如果可能的话,我宁愿不在我的开发系统上安装PostgreSQL.
使用自制软件安装PostgreSQL时收到错误.我在我的MacBook Pro上安装了Xcode4并且只安装了Xcode4,我认为这与缺少gcc 4.0有关.但是,这是另一个StackOverflow问题的问题.
更新于2011年4月12日上午8:37:我仍然想知道如果不在我的MacBook Pro上安装PostgreSQL就可以实现这一点.然而,我跑了brew update并强迫重新安装ossp-uuid,brew install --force ossp-uuid现在可行brew install postgresql.随着PostgreSQL的成功安装,我能够pip install psycopg2从我的virtualenv中获得.
pip install psycopg2$ pip install psycopg2
Downloading/unpacking psycopg2
Running setup.py egg_info for package psycopg2
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'.
Complete output from command python setup.py egg_info:
running 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
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
Storing complete log in /Users/matthew/.pip/pip.log
Run Code Online (Sandbox Code Playgroud)
以下是我作为初步研究阅读的文章:
Yev*_*lev 70
apt-get install libpq-dev
Run Code Online (Sandbox Code Playgroud)
帮我解决debian问题
Hug*_*res 48
psycopg依赖于pg_config命令,如果没有,则无法安装psycopg.
如果系统安装对您来说是个问题,为什么不尝试编译PostgreSQL并在$ PATH中包含生成的bin文件?喜欢:
export PATH=/path/to/compiled/postgresql/bin:"$PATH"
pip install psycopg2
Run Code Online (Sandbox Code Playgroud)
小智 11
apt-get install libpq-dev
Run Code Online (Sandbox Code Playgroud)
帮助我在debian挤压.之后做pip安装psycopg2.当我在heroku上设置我的环境时,我遇到了pg_config未找到问题的问题,现在它正常工作.
您需要安装该python-dev软件包才能使用python扩展名,例如psycopg2.我不知道如何在mac中安装软件包,但我运行以下命令在我的Ubuntu机器上安装python软件包.
sudo apt-get install python-dev
Run Code Online (Sandbox Code Playgroud)
要么
sudo apt-get install python3-dev
Run Code Online (Sandbox Code Playgroud)
如果您使用的是Python3.x.
安装完成后,在虚拟环境中运行以下命令.
pip install psycopg2
Run Code Online (Sandbox Code Playgroud)
小智 5
brew install postgresql
export LDFLAGS="-L/usr/local/opt/openssl/lib"
export CPPFLAGS="-I/usr/local/opt/openssl/include"
pip3 install psycopg2
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
75025 次 |
| 最近记录: |