Ich habe Probleme mit den Optionen --global-option und --install-option für eine Datei mit den Anforderungen.txt. Die Angabe der Optionen für eine Bibliothek führt dazu, dass andere Bibliotheken fehlschlagen.Pip Requirements.txt --global-Option verursacht Installationsfehler bei anderen Paketen. "Option nicht erkannt"
Ich versuche Python-Bibliotheken "Grab" und "Pycurl" zu installieren. Ich muss angeben, dass pycurl mit der Option "--with-nss" installiert werden soll. Ich kann den Fehler in einer vollständig sauberen virtuellen Umgebung replizieren.
Auf einer neuen virtuellen Umgebung mit requirements.txt enthält:
grab==0.6.25
pycurl==7.43.0 --install-option='--with-nss'
Dann Installation mit:
pip install -r requirements.txt
Folgende Fehler auftreten.
Installing collected packages: lxml, pycurl, pytils, six, user-agent, weblib, selection, grab
Running setup.py install for lxml ... done
Running setup.py install for pycurl ... done
Running setup.py install for pytils ... error
Complete output from command /home/ec2-user/test/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8GvFzA/pytils/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n
'), __file__, 'exec'))" install --record /tmp/pip-BCG3Wl-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/test/env/include/site/python2.7/pytils --with-nss:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --with-nss not recognized
----------------------------------------
Command "/home/ec2-user/test/env/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-8GvFzA/pytils/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-BCG3Wl-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/ec2-user/test/env/include/site/python2.7/pytils --with-nss" failed with error code 1 in /tmp/pip-build-8GvF
zA/pytils/
Meine beste Vermutung an der Wurzel Ursache ist, dass die Option „--with-nss“ richtet sich an alle Bibliotheken, die pycurl erfordern übergeben wird, und zur Verhütung installieren. Die pytils-Installation schlägt fehl, obwohl die pycurl-Installation einwandfrei funktioniert.
Gibt es sowieso nur die Installationsoptionen an die eine Bibliothek zu übergeben?
Ich richte dies auf einer Amazon Elastic Beanstalk-Instanz ein, daher gibt es keine Option, jede Zeile der requirements.txt-Datei manuell auszuführen - die gesamte Installation wird beim Start der Anwendung ausgeführt.
Quellen für --global-Option und --install-Option (was meiner Meinung nach soll dies nicht tun): How to maintain pip install options in requirements file made by pip freeze? https://github.com/pypa/pip/blob/develop/docs/reference/pip_install.rst#id28