Seite 1 von 1

Python 3: venv / ensurepip...

Verfasst: Sonntag 10. Januar 2016, 13:41
von jens
venv scheint bei mir unter Linux nicht zu funktionieren:

Code: Alles auswählen

~$ python3 --version
Python 3.4.3
~$ python3 -m venv PyHardLinkBackup
Error: Command '['/home/jens/PyHardLinkBackup/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1
Blöde "Fehlermeldung", die den echten Fehler nicht anzeigt :( Ein Traceback wäre mir da lieber)...

Also mal anders probieren:

Code: Alles auswählen

~$ rm -Rf PyHardLinkBackup/

~$ python3 -m venv --without-pip PyHardLinkBackup
~$ cd PyHardLinkBackup/
~/PyHardLinkBackup$ source bin/activate
(PyHardLinkBackup) ~/PyHardLinkBackup$ which python
/home/jens/PyHardLinkBackup/bin/python
(PyHardLinkBackup) ~/PyHardLinkBackup$ python --version
Python 3.4.3
(PyHardLinkBackup) ~/PyHardLinkBackup$ python -m ensurepip
/home/jens/PyHardLinkBackup/bin/python: No module named ensurepip
Ich gehe mal davon aus, das No module named ensurepip der eigentliche Fehler ist!

Das Modul ist einfach nicht installiert:

Code: Alles auswählen

$ python3
Python 3.4.3 (default, Mar 26 2015, 22:07:01) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import ensurepip
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'ensurepip'
Warum?!?


EDIT:
Wohl alles bekannt:
https://bugs.debian.org/cgi-bin/bugrepo ... bug=732703
https://bugs.launchpad.net/ubuntu/+sour ... ug/1290847
:evil:

Re: Python 3: venv / ensurepip...

Verfasst: Sonntag 10. Januar 2016, 13:46
von DasIch
Debian macht Python und pip regelmäßig kaputt. Am besten nie auf deren Pakete vertrauen und manuell installieren.

Re: Python 3: venv / ensurepip...

Verfasst: Sonntag 10. Januar 2016, 14:03
von jens
Es gibt diese Meldung:

Code: Alles auswählen

python -m ensurepip
ensurepip is disabled in Debian/Ubuntu for the system python.

Python modules For the system python are usually handled by dpkg and apt-get.

    apt-get install python-<module name>

Install the python-pip package to use pip itself.  Using pip together
with the system python might have unexpected results for any system installed
module, so use it on your own risk, or make sure to only use it in virtual
environments.
Die Idee ist wohl, das man ensurepip wegläßt, damit man nicht um das Paketmanagement herrum Sachen installiert. Ist ja ok. Aber nicht, wenn man ein venv nutzt :(

Re: Python 3: venv / ensurepip...

Verfasst: Sonntag 10. Januar 2016, 14:33
von jens
Mein work-a-round sieht jetzt so aus:
https://github.com/jedie/PyHardLinkBack ... sh#L13-L29 :?

Re: Python 3: venv / ensurepip...

Verfasst: Sonntag 10. Januar 2016, 19:44
von noisefloor
Hallo,
venv scheint bei mir unter Linux nicht zu funktionieren:
"unter Linux" ist ein bisschen weitläufig als Angabe... welche Distro nutzt du denn?

Dass das unter Ubuntu nicht funktioniert steht übrigens auch im Wiki von ubuntuusers.de :-)

Gruß, noisefloor

Re: Python 3: venv / ensurepip...

Verfasst: Sonntag 10. Januar 2016, 20:40
von jens
Ubuntu MATE 15.04...

Re: Python 3: venv / ensurepip...

Verfasst: Sonntag 10. Januar 2016, 20:46
von noisefloor
Hallo,

dann musst du ja so wie so bald updaten, weil EOL ;-)

Gruß, noisefloor