首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >无法在本地计算机上安装requirements.txt并运行项目

无法在本地计算机上安装requirements.txt并运行项目
EN

Stack Overflow用户
提问于 2021-09-21 07:07:14
回答 1查看 175关注 0票数 0

Django版本是1.7.1 python版本是3.9.2

嗨,Python/Django开发人员!我真的需要你的帮助,因为我在这些类型的错误中困了一周。我现在面临的问题是,当我尝试通过键入以下命令来安装需求时

代码语言:javascript
复制
pip install -r main_requirements.txt

它安装了大多数需求,但没有安装这些包:

代码语言:javascript
复制
configobj
matplotlib
psycopg2
pysqlite
pyOpenSSL

unittest2
xgboost

当涉及到"configobj"时,它会给出Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.错误,它也会在安装matplotlib错误时给出错误:

代码语言:javascript
复制
Using cached matplotlib-2.2.4.tar.gz (37.0 MB)
    ERROR: Command errored out with exit status 1:
     command: 'C:\Users\Dell\Documents\RashiedAmini\Nanaya_Web_Dev\venv\Scripts\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-ji91qscp\\matplotlib_fb7ae90f3d304658b27e8c23edc7e3b0\\setup.py'"'"'; __file__='"'"'C:\\Users\\Dell\\AppData\\Local\\Temp\\pip-install-ji91qscp\\matplotlib_fb7ae90f3d304658b27e8c23edc7e3b0\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\Dell\AppData\Local\Temp\pip-pip-egg-info-yzpvnump'
         cwd: C:\Users\Dell\AppData\Local\Temp\pip-install-ji91qscp\matplotlib_fb7ae90f3d304658b27e8c23edc7e3b0\
    Complete output (61 lines):
    ============================================================================
    Edit setup.cfg to change the build options

    BUILDING MATPLOTLIB
                matplotlib: yes [2.2.4]
                    python: yes [3.9.4 (tags/v3.9.4:1f2e308, Apr  6 2021,
                            13:40:21) [MSC v.1928 64 bit (AMD64)]]
                  platform: yes [win32]

    REQUIRED DEPENDENCIES AND EXTENSIONS
                     numpy: yes [not found. pip may install it below.]
          install_requires: yes [handled by setuptools]
                    libagg: yes [pkg-config information for 'libagg' could not
                            be found. Using local copy.]
                  freetype: no  [The C/C++ header for freetype
                            (freetype2\ft2build.h) could not be found.  You may
                            need to install the development package.]
                       png: no  [The C/C++ header for png (png.h) could not be
                            found.  You may need to install the development
                            package.]
                     qhull: yes [pkg-config information for 'libqhull' could not
                            be found. Using local copy.]

    OPTIONAL SUBPACKAGES
               sample_data: yes [installing]
                  toolkits: yes [installing]
                     tests: no  [skipping due to configuration]
            toolkits_tests: no  [skipping due to configuration]

    OPTIONAL BACKEND EXTENSIONS
                    macosx: no  [Mac OS-X only]
                    qt5agg: no  [PySide2 not found; PyQt5 not found]
                    qt4agg: no  [PySide not found; PyQt4 not found]
                   gtk3agg: no  [Requires pygobject to be installed.]
                 gtk3cairo: no  [Requires cairocffi or pycairo to be installed.]
                    gtkagg: no  [Requires pygtk]
                     tkagg: yes [installing; run-time loading from Python Tcl /
                            Tk]
                     wxagg: no  [requires wxPython]
                       gtk: no  [Requires pygtk]
                       agg: yes [installing]
                     cairo: no  [cairocffi or pycairo not found]
                 windowing: yes [installing]

    OPTIONAL LATEX DEPENDENCIES
                    dvipng: no
               ghostscript: no
                     latex: no
                   pdftops: no

    OPTIONAL PACKAGE DATA
                      dlls: no  [skipping due to configuration]

    ============================================================================
                            * The following required packages can not be built:
                            * freetype, png
                            * Please check http://gnuwin32.sourceforge.net/packa
                            * ges/freetype.htm for instructions to install
                            * freetype
                            * Please check http://gnuwin32.sourceforge.net/packa
                            * ges/libpng.htm for instructions to install png
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/1e/20/2032ad99f0dfe0f60970941af36e8d0942d3713f442bb3df37ac35d67358/matplotlib-2.2.4.tar.gz#sha256=029620799e581802961ac1dcff5cb5d3ee2f602e0db9c0f202a90495b37d2126 (from https://pypi.org/simple/matplotlib/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

我的main_requirements.txt文件:

代码语言:javascript
复制
amqp==1.4.6
anyjson==0.3.3
autopep8==1.2.1
backports.functools-lru-cache==1.5
billiard==3.3.0.20
Bottleneck==1.2.1
celery
census==0.7
certifi==2018.11.29
chardet==3.0.4
colorama==0.2.5

cycler==0.10.0
dj-database-url==0.4.0
django==1.7.1
django-allauth==0.22.0
django-autocomplete-light==2.0.3
django-autoslug==1.7.2
django-cities-light==3.0.3
django-csvimport==2.4
django-datetime-widget==0.9.3
django-localflavor==1.1
django-mathfilters==0.3.0
django-pandas==0.6.0
django-rest-auth==0.7.0
django-widget-tweaks==1.3
djangorestframework==3.3.0
docutils==0.12
flake8==2.5.1
gevent==1.0
greenlet==0.4.2
gunicorn==17.5
html5lib==0.999
idna==2.8
importmagic==0.1.3
jedi==0.9.0
jellyfish==0.5.1
joblib==0.12.5
kiwisolver==1.0.1
kombu==3.0.26
lifelines==0.17.3
linecache2==1.0.0
lockfile==0.12.2

mccabe==0.3.1
numpy==1.9.1
oauthlib==0.6.3
pam==0.1.4
pandas==0.23.3
pep8==1.5.7
psutil==3.3.0

pydf==12
pyflakes==1.0.0


pyparsing==2.3.1
pyserial==2.6

python-daemon==2.1.0
python-dateutil==2.7.5
python-openid==2.2.5
pytz==2015.6
pyzipcode==0.4
requests==2.2.1
requests-oauthlib==0.4.2
rope==0.10.3
scikit-learn==0.20.0
scipy==1.2.0
sendgrid==1.2.0
setproctitle==1.1.9
six==1.10.0
sklearn==0.0
smtpapi==0.1.2
South==0.7.5
ssh-import-id==3.21
stripe==1.29.1
subprocess32==3.5.3
traceback2==1.4.0
Twisted==15.5.0
Unidecode==0.4.17

urllib3==1.7.1
us==0.9.1
virtualenv==1.11.4

xlrd==0.9.4
yapf==0.6.2
zope.interface==4.0.5
django-cachebuster==0.2.1
django-ipware==2.1.0
Whoosh==2.7.4



configobj
matplotlib
psycopg2
pysqlite
pyOpenSSL

unittest2
xgboost
EN

回答 1

Stack Overflow用户

发布于 2021-09-22 03:19:00

看起来你的包在安装时依赖于其他包。Pip对您的需求进行了两次遍历:首先它下载所有包并运行每个包的setup.py以获取其元数据,然后在第二次遍历中安装所有包。

这也是为什么当你一个接一个地安装软件包时看不到这个错误的原因:如果你一次安装一个,在你pip安装“你的软件包”之前,你将在你的环境中完全安装。

唯一解决方案是在运行pip install -r requirements.txt之前安装pip install "“--您不能用一个requirements.txt文件在一个命令中完成这项工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/69264719

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档