我正在使用python3.7.2和pip 19.2.2用于 python 应用程序。问题是我无法psycopg2 2.8.3在 MacOS 上安装依赖项。
以下是我在运行时遇到的错误pip install psycopg2:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'clang' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for psycopg2
Run Code Online (Sandbox Code Playgroud)
似乎ssl没有安装所以我尝试安装pip install sssl但出现此错误:
ERROR: Command errored out with exit status 1:
command: /Users/joey/.pyenv/versions/3.7.2/bin/python3.7 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/9c/fcm6pxnj39b1t777zpcfpbdh0000gn/T/pip-install-2ldzdiz0/ssl/setup.py'"'"'; __file__='"'"'/private/var/folders/9c/fcm6pxnj39b1t777zpcfpbdh0000gn/T/pip-install-2ldzdiz0/ssl/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', …Run Code Online (Sandbox Code Playgroud) $ yum install python3 postgresql python-devel libpqxx-devel
Loaded plugins: langpacks, refresh-packagekit
Package python3-3.3.2-8.fc20.x86_64 already installed and latest version
Package postgresql-9.3.2-2.fc20.x86_64 already installed and latest version
Package python-devel-2.7.5-9.fc20.x86_64 already installed and latest version
Package 1:libpqxx-devel-3.2-0.5.fc20.x86_64 already installed and latest version
Nothing to do
Run Code Online (Sandbox Code Playgroud)
我想在我的virtualenv中安装psycopg2来连接django和postgresql数据库.
在Fedora 19和postgresql-9.2中,pg_config的路径是:
/usr/pgsql-9.2/bin
在Fedora 20中,该目录不存在.
但是可以在中找到pg_config /usr/bin/pg_config.
试图安装psycopg2:
$ export PATH=$PATH:/usr/bin; pip install psycopg2
Downloading/unpacking psycopg2
Downloading psycopg2-2.5.2.tar.gz (685kB): 685kB downloaded
Running setup.py egg_info for package psycopg2
... -compiling output here- ...
gcc -pthread …Run Code Online (Sandbox Code Playgroud) 我在网上搜了几个小时,结果证明没什么用.
我试图在Django项目上使用PostgreSQL,我在CentOS 6.5服务器上使用Python3.4.
但是我无法安装psycopg2库以使PostgreSQL工作.我发现的几乎所有文章都指出我在CentOS上使用apt-get,但apt-get并不是CentOS 6.5上的标准工具.我没能安装apt-get所以我无法安装psycopg2.我还能用Python 3.4安装psycopg2吗?
尝试在Linux Mint上创建一个新的Heroku Python(Django)应用程序时,当pip尝试安装psycopg2时遇到以下错误
x86_64-linux-gnu-gcc: error: unrecognized command line option ‘-fstack-protector-strong’
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
Run Code Online (Sandbox Code Playgroud)
满足所有依赖项(如本问题中所述),所以我在这里看不到问题..
我正在尝试将我的应用程序部署到heroku,但是在执行pip install django-heroku后,它给了我一个错误。我在 Mac 上运行 Python 3 和 Django 2.2。
错误消息建议安装psycopg2-binary,我这样做了,但安装后我仍然看到相同的错误。谢谢你的帮助。
错误信息:
ERROR: Complete output from command python setup.py egg_info:
ERROR: running egg_info
creating pip-egg-info/psycopg2.egg-info
writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file 'pip-egg-info/psycopg2.egg-info/SOURCES.txt'
Error: pg_config executable not found.
pg_config is required to build psycopg2 from source. 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 …Run Code Online (Sandbox Code Playgroud) 我正在尝试将我使用 heroku 创建的应用程序放在服务器 www 上。但是当我在 Ubuntu 上的终端上输入 pip install psycopg2==2.7.* 时,出现以下错误:
ERROR: Command errored out with exit status 1:
command: /home/marcin/Python/learning_log/ll_env/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-c67buptz/psycopg2/setup.py'"'"'; __file__='"'"'/tmp/pip-install-c67buptz/psycopg2/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-c67buptz/psycopg2/pip-egg-info
cwd: /tmp/pip-install-c67buptz/psycopg2/
Complete output (28 lines):
running egg_info
creating /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info
writing /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/PKG-INFO
writing dependency_links to /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/dependency_links.txt
writing top-level names to /tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/top_level.txt
writing manifest file '/tmp/pip-install-c67buptz/psycopg2/pip-egg-info/psycopg2.egg-info/SOURCES.txt'
/home/marcin/Python/learning_log/ll_env/lib/python3.8/site-packages/setuptools/config/setupcfg.py:508: SetuptoolsDeprecationWarning: The license_file parameter is deprecated, use license_files instead.
warnings.warn(msg, warning_class)
/home/marcin/Python/learning_log/ll_env/lib/python3.8/site-packages/setuptools/command/egg_info.py:643: SetuptoolsDeprecationWarning: Custom 'build_py' does …Run Code Online (Sandbox Code Playgroud) django ×4
python ×4
heroku ×3
psycopg2 ×3
pip ×2
centos ×1
fedora ×1
macos ×1
postgresql ×1
python-3.3 ×1