2017-05-25 7 views
0

mit ich von einem anderen alle meine Website-Pakete für den Zugriff auf die Installation von Python in der Lage sein wollte, so habe ich eine virtuelle Umgebung auf diese Weise:Kann nicht Upgradepakete pip innerhalb virtualenv

venv my_project --system-site-packages 

ich, dass meine Version bemerkt von Keras war veraltet, so aus meinem virtualenv, ich ausgeführt:

pip install keras 

, die ohne ein Problem gearbeitet. Ich verwende pip Version 9.0.1

Ich versuche, ein Python-Programm auszuführen, das TensorFlow verwendet, aber wenn ich es laufen, bekomme ich eine Fehlermeldung:

ImportError: No module named tensorboard.plugins 

ich um gegoogelt und festgestellt, dass Ich musste TensorFlow upgraden. Ich habe versucht, mehrere Befehle:

(my_project/) [email protected]:~/spatial/zero_padded/powerlaw$ pip install tensorflow 

Die oben gibt mir eine Anforderung bereits zufrieden "Fehler.

$ pip install --target=~/spatial/zero_padded/powerlaw/my_project/ --upgrade tensorflow 
Collecting tensorflow 
    Could not find a version that satisfies the requirement tensorflow (from versions:) 
No matching distribution found for tensorflow 

Der Ausgang des which python:

/user/spatial/zero_padded/powerlaw/my_project/bin/python 

Ich glaube, meine PYTHONPATH die erste Zeile in dieser ist:

(my_project/) [email protected]:~/spatial/zero_padded/powerlaw/my_project$ python -c "import sys; print '\n'.join(sys.path)" 

/user/spatial/zero_padded/powerlaw/my_project 
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python27.zip 
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7 
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/plat-linux2 
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/lib-tk 
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/lib-old 
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/lib-dynload 
/user/spatial/zero_padded/powerlaw/my_project/lib/python2.7/site-packages 
/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages 
/user/pkgs/enthought/canopy-1.5.1/lib/python2.7/site-packages/PIL 
/opt/enthought/canopy-1.5.1/appdata/canopy-1.5.1.2730.rh5-x86_64/lib/python2.7/site-packages 

Wie ich in meinem TensorFlow virtualenv aktualisiere?

+0

Können Sie bitte die Ausgabe von 'pip --freeze Post | grep -i tensorflow' aus deinem virtualenv? – 2ps

Antwort

0

Der beste Weg, es zu tun ist, installieren Sie die Abhängigkeiten außerhalb de vm, und erstellen Sie eine neue, ich habe Angst, das zu sagen. Da Upgrades tun anders als

+0

Danke für Ihre Antwort, aber können Sie genauer sein? Was genau muss ich tun? – StatsSorceress

1

Ziemlich sicher, dass die Installation, dass alles, was Sie tun müssen, läuft pip install mit -U das Paket innerhalb des virtualenv zu aktualisieren:

(my_project/) [email protected]:~/spatial/zero_padded/powerlaw$ pip install -U tensorflow 

-U ist nur eine Abkürzung für --upgrade. Aber Sie sollten wirklich fortfahren und eine Datei für sich selbst mit dem Namen requirements.txt erstellen, die sich im Projektstamm befindet und dort Versionsnummern angibt.

z.B.

tensorflow==1.2.0 

Und das macht es einfacher, alle Anforderungen

pip install -r requirements.txt 
installieren
+0

Ich habe das versucht, und es aktualisiert immer noch überall - das heißt global - anstelle von lokal zu (my_project /) – StatsSorceress

Verwandte Themen