我正在使用virtualenv,我需要安装"psycopg2".
我做了以下事情:
pip install http://pypi.python.org/packages/source/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
Run Code Online (Sandbox Code Playgroud)
我有以下消息:
Downloading/unpacking http://pypi.python.org/packages/source/p/psycopg2/psycopg2
-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
Downloading psycopg2-2.4.tar.gz (607Kb): 607Kb downloaded
Running setup.py egg_info for package from http://pypi.python.org/packages/sou
rce/p/psycopg2/psycopg2-2.4.tar.gz#md5=24f4368e2cfdc1a2b03282ddda814160
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
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 …Run Code Online (Sandbox Code Playgroud) 是否有可能安装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 …Run Code Online (Sandbox Code Playgroud) 我正在遵循Heroku的教程来部署Django应用程序:http://devcenter.heroku.com/articles/django#prerequisites.
一切正常,直到我到达这一部分:
$ pip install Django psycopg2
Run Code Online (Sandbox Code Playgroud)
我可以自己安装Django,但问题是psycopg2.
我一直收到这个错误:
ld: library not found for -lpq
collect2: ld returned 1 exit status
ld: library not found for -lpq
collect2: ld returned 1 exit status
lipo: can't open input file: /var/folders/_4/p6l0y0t51hd4xbq7llbyshmw0000gn/T//cc0L10mI.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
我在我的机器上安装了PostgreSQL 9.1.
另外,在输出中,有这样的一堆行:
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -g -O2 -DNDEBUG -g -O3 -DPSYCOPG_DEFAULT_PYDATETIME=1 -DPSYCOPG_VERSION="2.4.4 (dt dec pq3 ext)" …Run Code Online (Sandbox Code Playgroud) 我第一次尝试与其他几个网站建立网站,并且在尝试使用Django/Python/VirtualEnv时遇到了一个奇怪的错误.我已经为其他操作系统找到了解决这个问题的方法,比如Ubuntu,但是找不到适合Mac的好解决方案.
这是正在运行的相关代码:
virtualenv -p python3 venv
source venv/bin/activate
pip install -r requirements.txt
Run Code Online (Sandbox Code Playgroud)
运行该块后,我收到以下错误:
Asse田
django-toolbelt的构建轮失败为psycopg2运行setup.py bdist_wheel
...
Asse田
psycopg2构建轮失败无法构建django-toolbelt psycopg2
我相信我已经安装了"django-toolbelt"和"psycopg2",所以我不确定它为什么会失败.
我能想到的唯一区别是我没有使用该命令
sudo apt-get install libpq-dev
Run Code Online (Sandbox Code Playgroud)
正如Ubuntu用法的指示,因为我相信用brew安装postgresql会处理标题.
感谢您的帮助或见解!
我正在使用PowerShell在Windows 7上尝试以下命令
pip install psycopg2
Run Code Online (Sandbox Code Playgroud)
我收到一个错误:
错误:需要Microsoft Visual C++ 14.0(无法找到vcvarsall.bat).命令"C:\ Users\Piyush\AppData\Local\Programs\Python\Python35\python.exe -c"import setuptools,tokenize; file ='C:\ Users\Piyush\AppData\Local\Temp\pip-build-qe38dwoj\psycopg2\setup.py'; exec(compile(getattr(tokenize,'open',open)(file).read() .replace('\ r \n','\n'),file,'exec'))"install --record C:\ Users\Piyush\AppData\Local\Temp\pip-7bjug79j-record\install-record .txt --single-version-external-managed --compile"在C:\ Users\Piyush\AppData\Local\Temp\pip-build-qe38dwoj\psycopg2中失败,错误代码为1
要安装Visuall C++,它需要安装Visual Studio.除了安装Visual Studio 2013.还有其他的,我可以为Python 3.5安装Psycopg2 ??