Pip gebrochen auf Ubuntu 14.4 nach dem upgrade-Paket
Ich versuche zu aktualisieren, die python-requests-Paket auf einer EC2-ubuntu 14.4 Instanz. nachdem Sie dies getan haben, die nicht einen Fehler auslösen ich lief
pip freeze
und bekam:
ubuntu@ip-172-31-28-196:~$ pip freeze
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_poin
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 11, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead
ubuntu@ip-172-31-28-196:~$ sudo apt-get remove python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
python-colorama python-distlib python-html5lib
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
python-pip
0 upgraded, 0 newly installed, 1 to remove and 64 not upgraded.
After this operation, 479 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 58701 files and directories currently installed.)
Removing python-pip (1.5.4-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
ubuntu@ip-172-31-28-196:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
python-dev-all
The following NEW packages will be installed:
python-pip
0 upgraded, 1 newly installed, 0 to remove and 64 not upgraded.
Need to get 0 B/97.7 kB of archives.
After this operation, 479 kB of additional disk space will be used.
Selecting previously unselected package python-pip.
(Reading database ... 58626 files and directories currently installed.)
Preparing to unpack .../python-pip_1.5.4-1_all.deb ...
Unpacking python-pip (1.5.4-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up python-pip (1.5.4-1) ...
ubuntu@ip-172-31-28-196:~$ pip freeze
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_poin
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 11, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead
ubuntu@ip-172-31-28-196:~$ sudo apt-get --purge remove python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages were automatically installed and are no longer required:
python-colorama python-distlib python-html5lib
Use 'apt-get autoremove' to remove them.
The following packages will be REMOVED:
python-pip*
0 upgraded, 0 newly installed, 1 to remove and 64 not upgraded.
After this operation, 479 kB disk space will be freed.
Do you want to continue? [Y/n] Y
(Reading database ... 58701 files and directories currently installed.)
Removing python-pip (1.5.4-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
ubuntu@ip-172-31-28-196:~$ sudo apt-get install python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Recommended packages:
python-dev-all
The following NEW packages will be installed:
python-pip
0 upgraded, 1 newly installed, 0 to remove and 64 not upgraded.
Need to get 0 B/97.7 kB of archives.
After this operation, 479 kB of additional disk space will be used.
Selecting previously unselected package python-pip.
(Reading database ... 58626 files and directories currently installed.)
Preparing to unpack .../python-pip_1.5.4-1_all.deb ...
Unpacking python-pip (1.5.4-1) ...
Processing triggers for man-db (2.6.7.1-1ubuntu1) ...
Setting up python-pip (1.5.4-1) ...
ubuntu@ip-172-31-28-196:~$ pip freeze
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==1.5.4', 'console_scripts', 'pip')()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 351, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2363, in load_entry_poin
return ep.load()
File "/usr/lib/python2.7/dist-packages/pkg_resources.py", line 2088, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 11, in <module>
from pip.vcs import git, mercurial, subversion, bazaar # noqa
File "/usr/lib/python2.7/dist-packages/pip/vcs/mercurial.py", line 9, in <module>
from pip.download import path_to_url
File "/usr/lib/python2.7/dist-packages/pip/download.py", line 25, in <module>
from requests.compat import IncompleteRead
ImportError: cannot import name IncompleteRead
ubuntu@ip-172-31-28-196:~$
Wie Sie sehen können ich habe versucht zu deinstallieren und installieren Sie pip auf verschiedene Weise ohne Erfolg. Wie kann ich es wieder zum laufen bekommen?
edit:
ubuntu@ip-172-31-28-196:~$ sudo python get-pip.py
The directory '/home/ubuntu/.cache/pip/log' or its parent directory is not owned by the current user
and the debug log has been disabled. Please check the permissions and owner of that directory. If e
xecuting pip with sudo, you may want the -H flag.
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current use
r and the cache has been disabled. Please check the permissions and owner of that directory. If exec
uting pip with sudo, you may want the -H flag.
The directory '/home/ubuntu/.cache/pip/http' or its parent directory is not owned by the current use
r and the cache has been disabled. Please check the permissions and owner of that directory. If exec
uting pip with sudo, you may want the -H flag.
Collecting pip
Downloading pip-6.0.8-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 370kB/s
Installing collected packages: pip
Successfully installed pip-6.0.8
ubuntu@ip-172-31-28-196:~$ pip freeze
-bash: /usr/bin/pip: No such file or directory
ubuntu@ip-172-31-28-196:~$ sudo -H python get-pip.py
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
ubuntu@ip-172-31-28-196:~$ sudo apt-get --purge remove python-pip
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package 'python-pip' is not installed, so not removed
The following packages were automatically installed and are no longer required:
python-colorama python-distlib python-html5lib
Use 'apt-get autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 64 not upgraded.
ubuntu@ip-172-31-28-196:~$ sudo -H python get-pip.py
Requirement already up-to-date: pip in /usr/local/lib/python2.7/dist-packages
ubuntu@ip-172-31-28-196:~$ pip freeze
-bash: /usr/bin/pip: No such file or directory
- versuchen Sie, pip installieren Sie das neueste über get-pip.py bootstrap.pypa.io/get-pip.py
- siehe edit
- Ich bin versucht, es zu benutzen , ja
- wie haben Sie entfernen von python-pip? ich würde entfernen pip aus
/usr/local/lib/python2.7/dist-packages
manuell - sudo apt-get --purge remove python-pip
- entfernen
/usr/bin/pip
, dann laufenwhich pip
- entfernt pip manuell aus ..../dist-packages. dann ubuntu@ip-172-31-28-196:~$ die pip /usr/local/bin/pip
- was dann passiert, wenn Sie versuchen pip freeze wieder?
- ubuntu@ip-172-31-28-196:~$ die pip /usr/local/bin/pip
- ubuntu@ip-172-31-28-196:~$ pip freeze -bash: /usr/bin/pip: Keine solche Datei oder Verzeichnis
- wenn Sie
/usr/local/bin/pip freeze
funktioniert es? - /home/ubuntu$ /usr/local/bin/pip-freeze-Traceback (most recent call last): File "/usr/local/bin/pip", line 7, in <module> aus der pip-import main ImportError: No module named pip
- installieren Sie pip verwenden get-pip.py
- ist es egal von welchem Verzeichnis?
- nicht einmal liefern Sie den vollständigen Pfad zu get-pip.py.
- /home/ubuntu$ sudo python get-pip.py das Sammeln von pip Download pip-6.0.8-py2.py3-keine-keine.whl (1,3 MB) Installieren gesammelten Pakete: pip Erfolgreich installiert pip-6.0.8
- /home/ubuntu$ die pip /usr/local/bin/pip
- immer noch keine Freude, es zu benutzen?
- OK, ich denke, Sie haben es, pip freeze funktioniert jetzt!
- Können Sie geben so etwas in der form einer Antwort, damit kann ich upvote Sie?
- keine Sorge, ich will hinzufügen, eine Antwort in einem bit
- Padraic, ich bin mir nicht sicher, wenn Sie Zeit haben, sich an einer anderen, aber ich habe Mühe mit stackoverflow.com/questions/28917887/... . Wenn Sie Zeit haben für eine Stellungnahme würde ich mich freuen. Beste Grüße - Rechnung
- nicht übermäßig vertraut mit der
uwsgi
, hat diedaemonize
Einstellung einen Unterschied machen uwsgi-docs.readthedocs.org/en/latest/tutorials/... - auch Sie haben eine site.py in
/home/ubuntu/.virtualenvs/env1
? - auch haben Sie versucht, die Aktualisierung der venv
virtualenv /home/ubuntu/.virtualenvs/env1
- Ich würde auch ein upgrade virtualenv
sudo pip install virtualenv --upgrade
- Thanka Padraic, ich habe: ubuntu@ip-172-31-28-196:~$ sudo pip install virtualenv --upgrade "Das Verzeichnis '/home/ubuntu/.cache/pip/log' oder das übergeordnete Verzeichnis ist nicht im Besitz des aktuellen Benutzer-und debug-Protokoll deaktiviert wurde. Überprüfen Sie bitte die Berechtigungen und Besitzer des Verzeichnisses. Wenn e xecuting pip mit sudo, möchten Sie vielleicht die H-Kennzeichen. Anforderung bereits up-to-date: virtualenv in /usr/local/lib/python2.7/dist-packages" Was ist das -H Kennzeichen?
- BTW, würde Sie gerne in eine Antwort für stackoverflow.com/questions/28917887/.... Die uwsgi, mit daemonize für mich gearbeitet.
- Keine sorgen, die H-Kennzeichen-Nachricht ist nichts zu befürchten, es bedeutet einfach, dass root nicht Besitzer der Ordner. Ich fügte hinzu, eine Antwort mit einem link zu den docs
Du musst angemeldet sein, um einen Kommentar abzugeben.
apt-get
installiert eine viel ältere version von pip, die zu Problemen führen kann, vollständig zu entfernenpython-pip
mit:
dann:
mittels sudo wenn erforderlich
Sollte diese Arbeit für Sie. Befolgen Sie diese einfachen Schritte.
Schritt: 1 sudo apt-get remove python-pip
Schritt: 2 sudo easy_install -U pip
Wird wieder einige Adresse wie:
Installiert /usr/local/lib/python2.7/dist-packages/pip-6.1.1-py2.7.ei
Schritt: 3 gehen Sie zu dieser link.
Schritt: 4 Rechtsklick >> Speichern unter ... mit dem Namen get-pip.py .
Schritt: 5 verwenden: cd gehen in das gleiche Verzeichnis wie Ihre get-pip.py Datei
Schritt: 6 verwenden: sudo python get-pip.py
oder
Schritt: 7 verwenden Sie: sudo apt-get install python-pip