首页 > 解决方案 > 安装 requirements.txt 在 Django 上引发错误

问题描述

直到最近,当我为我的数据库创建一个模型并尝试 pip install requirements.txt 时,该项目才运行良好。我已经完成了我所知道的一切,包括修改我settings.py的以添加缺少的库、重新安装djangopsycopg2,一切都无济于事。这是我的requirement.txt

tweepy==3.8.0
django
gunicorn
django-heroku

我得到的错误:

 ld: library not found for -lssl
    clang: error: linker command failed with exit code 1 (use -v to see invocation)
    error: command 'gcc' failed with exit status 1

    ----------------------------------------
Command "/Users/apple/Downloads/font_text/python-getting-started/getting-started/bin/python3 -u -c "import setuptools, tokenize;__file__='/private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-record-sc3y24vo/install-record.txt --single-version-externally-managed --compile --install-headers /Users/apple/###/###/PROJECTFOLDER/getting-started/include/site/python3.7/psycopg2" failed with error code 1 in /private/var/folders/tn/843ff_ns4j5ddf0fyc998v6c0000gn/T/pip-install-phi9wroh/psycopg2/

标签: pythondjangodjango-models

解决方案


根据错误消息,您需要openssl-devel在系统上安装该软件包。


推荐阅读