我使用的是MAC和python版本2.7.14
Collecting psycopg2
Could not fetch URL https://pypi.python.org/simple/psycopg2/: There was a problem confirming the ssl certificate: [SSL: TLSV1_ALERT_PROTOCOL_VERSION] tlsv1 alert protocol version (_ssl.c:661) - skipping
Could not find a version that satisfies the requirement psycopg2 (from versions: )
No matching distribution found for psycopg2发布于 2018-04-13 16:41:23
试试这个:
pip install psycopg2-binary发布于 2021-08-15 15:05:49
当我尝试在一个运行在Big Sur OS上的全新MacBook上为一个正在进行的项目'pip installing‘软件包时,我也遇到了同样的问题。经过一些研究,我偶然发现了this solution,它对我很有效。以下是步骤:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install postgresqlbrew install opensslbrew link opensslexport LDFLAGS="-L/opt/homebrew/opt/openssl@1.1/lib"
export CPPFLAGS="-I/opt/homebrew/opt/openssl@1.1/include"
使用以下命令
pip install psycopg2-binary
结果如下:
使用缓存的peccopg2-
-2.9.1.tar.gz (380 kB)收集peccopg2-二进制文件用于收集包的构建轮:peccopg2-用于peccopg2的二进制构建轮-二进制(setup.py) ...完成为filename=psycopg2_binary-2.9.1-cp39-cp39-macosx_10_9_universal2.whl创建了轮子-binary: sha256=e825a38765f20a331ef619e1368ee9d1a678f34969e3c467d94bc4122af1ac6f存储在目录中: /Users/me/Library/Caches/pip/wheels/4b/c8/c2/72089ea1a611c119754d513bdacea935cfeb19600d06d45b4b成功构建了size=241235 -binary正在安装收集的软件包:Peccopg2-binary成功安装了Peccopg2-binary-2.9.1
发布于 2021-07-14 16:45:24
同样的问题,忘记安装psql:https://wiki.postgresql.org/wiki/Homebrew
所以我跑了:
brew install postgresql
brew services start postgresqlhttps://stackoverflow.com/questions/49811955
复制相似问题