在为我的项目运行pip3 install -r requirements.txt时,我得到以下错误:
ld: library not found for -lssl
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> psycopg2-binary工作的Macbook航空2022。安装了Python3。在虚拟env中运行。我可以安装psycopg2和内核2-二进制文件,但是当我运行pip requirements.txt时,我会遇到上面的错误消息。
requirements.txt文件
aiohttp==3.7.3
aioredis==1.3.1
amqp==5.0.2
aniso8601==7.0.0
anyjson==0.3.3
appdirs==1.4.4
argcomplete==1.12.2
asgiref==3.2.10
async-timeout==3.0.1
attrs==20.2.0
bcrypt==3.2.0
beautifulsoup4==4.9.3
billiard==3.6.3.0
black==20.8b1
blessed==1.17.12
boto3==1.16.4
botocore==1.19.29
boxsdk==2.10.0
cached-property==1.5.2
celery==5.0.2
cement==2.8.2
certifi==2020.6.20
cffi==1.14.3
cfn-flip==1.2.3
chardet==3.0.4
click==7.1.2
click-didyoumean==0.0.3
click-repl==0.1.6
colorama==0.4.3
coverage==5.5
cryptography==37.0.4
defusedxml==0.6.0
diff-match-patch==20200713
Django==3.0
django-admin-tools==0.9.0
django-async-redis==0.1.0
django-braces==1.14.0
django-celery-results==2.0.0
django-cors-headers==3.5.0
django-cursor-pagination==0.1.4
django-debug-toolbar==3.1.1
django-dotenv==1.4.2
django-extensions==3.0.9
django-filter==2.4.0
django-graphql-jwt==0.3.1
django-jsonview==2.0.0
django-livereload-server==0.3.2
django-mysql==3.11.1
django-nested-admin==3.3.2
django-phonenumber-field==5.2.0
django-property-filter==1.1.0
django-redis==4.12.1
django-referrer-policy==1.0
django-s3-storage==0.13.4
django-ses==1.0.3
django-simple-history==3.1.1
django-storages==1.11
django-suit==0.2.28
django-taggit==1.3.0
django-tenants==3.3.2
django-timezone-field==4.1.2
django-utils-six==2.0
dnspython==2.2.0
docker==4.4.0
docker-compose==1.25.5
dockerpty==0.4.1
docopt==0.6.2
docutils==0.15.2
durationpy==0.5
email-validator==1.1.3
et-xmlfile==1.0.1
Faker==8.10.1
feedparser==6.0.2
flake8==3.8.4
future==0.16.0
git-remote-codecommit==1.16
googlemaps==4.5.3
graphene==2.1.8
graphene-django==2.13.0
graphene-file-upload==1.2.2
graphql-core==2.3.2
graphql-relay==2.0.1
gunicorn==20.0.4
hiredis==1.1.0
hjson==3.0.2
idna==2.10
iniconfig==1.1.1
install==1.3.4
jdcal==1.4.1
jmespath==0.10.0
jsonschema==3.2.0
kappa==0.6.0
kombu==5.0.2
loremipsum==1.0.5
MarkupPy==1.14
mccabe==0.6.1
multidict==5.0.2
mypy-extensions==0.4.3
odfpy==1.4.1
openpyxl==3.0.9
ordered-set==4.0.2
packaging==20.9
paramiko==2.7.2
pathspec==0.8.1
pathtools==0.1.2
phonenumbers==8.12.24
Pillow==8.1.1
pip-tools==5.4.0
placebo==0.9.0
pluggy==0.13.1
ply==3.11
promise==2.3
prompt-toolkit==3.0.8
psycopg2-binary==2.8.6
py==1.10.0
pyasn1==0.4.8
pycodestyle==2.6.0
pycparser==2.20
pydot==1.4.1
pyflakes==2.2.0
pyjslint==0.3.4
PyJWT==1.7.1
PyNaCl==1.4.0
pyparsing==2.4.7
pyrsistent==0.17.3
pytest==6.2.3
pytest-cov==2.11.1
pytest-django==4.3.0
python-dateutil==2.6.1
python-monkey-business==1.0.0
python-slugify==4.0.1
pytz==2020.1
PyYAML==5.3.1
redis==3.5.3
regex==2020.11.13
requests==2.24.0
requests-toolbelt==0.9.1
rsa==4.5
Rx==1.6.1
s3transfer==0.3.3
semantic-version==2.5.0
sentry-sdk==0.19.4
sgmllib3k==1.0.0
singledispatch==3.4.0.3
six==1.15.0
slack==0.0.2
slack-sdk==3.0.0
soupsieve==2.2.1
sqlparse==0.4.1
stripe==2.55.2
tablib==2.0.0
tenant-schemas-celery==1.0.1
termcolor==1.1.0
text-unidecode==1.3
texttable==1.6.3
toml==0.10.2
tornado==6.1
tqdm==4.54.0
troposphere==2.6.3
twilio==6.48.0
typing-extensions==3.7.4.3
Unidecode==1.1.1
urllib3==1.25.10
vine==5.0.0
wcwidth==0.1.9
websocket-client==0.57.0
Werkzeug==0.16.1
wrapt==1.12.1
wsgi-request-logger==0.4.6
xlrd==1.2.0
XlsxWriter==3.0.2
xlwt==1.3.0
yarl==1.6.3到目前为止,我已经尝试了一些东西,这些都在评论中提到过。感谢任何我能得到的帮助:)
发布于 2022-08-21 16:08:58
您的requirements.txt指定了psycopg2的旧版本(2.8.6),该版本需要为正确构建而指定的openssl库路径。
# since you're using homebrew, make sure you have openssl and postgresql installed
# brew install openssl postgresql
LDFLAGS="-L $(brew --prefix openssl)/lib" pip install -r requirements.txt或者,将requirements.txt更改为指定2.9版本的psycopg2
# more reqs...
prompt-toolkit==3.0.8
# change this from 2.8.6 to 2.9.3 (latest)
psycopg2-binary==2.9.3
py==1.10.0
pyasn1==0.4.8
# even more reqs....然后尝试pip install -r requirements.txt
https://stackoverflow.com/questions/73434403
复制相似问题