Not able to install requirements.txt and run the project on my local machine

1.2k Views Asked by At

Django version is 1.7.1 python version is 3.9.2

Hi, Python/Django developers! I really need your help because I am stuck in these types of errors for one week. The problem that I am facing right now is that when I try to install requirements by typing

pip install -r main_requirements.txt

it install most of the requirements but not these packages:

configobj
matplotlib
psycopg2
pysqlite
pyOpenSSL

unittest2
xgboost

and when it comes to "configobj" it gives error of Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output. it also gives error while installing matplotlib error:

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.

my main_requirements.txt file:

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
1

There are 1 best solutions below

1
Goodworks On

It looks like your packages have a install-time dependencies on other packages. Pip makes two passes through your requirements: first it downloads all packages and runs each one's setup.py to get its metadata, and then it installs them all in a second pass.

This is also why you don't see this error when you install the packages one by one: if you install them one at a time, you will be fully installed in your environment before you pip install "your packages".

The only solution is to install pip install "" before you ever run pip install -r requirements.txt -- you won't be able to do this in a single command with a single requirements.txt file.