2016-04-20 22 views
1

Ich habe Ubuntu 14.04 über VMWare installiert. Ich hatte Tensorflow in einem virtualenv installiert und ich importierte es in pycharm und arbeitete damit ohne Probleme. Heute habe ich angefangen pycharm und es sah aus wie es ist das erste Mal, dass ich es beginne. Dann, als ich versuchte, eine Python-Datei auszuführen, die ich im letzten Monat lief und es funktioniert nicht, das sagte:Tensorflow wird nicht mehr erkannt

Traceback (most recent call last): 
    File "/home/user/PycharmProjects/TensorFlowTutorials/mnist_beginner.py", line 1, in <module> 
    from tensorflow.examples.tutorials.mnist import input_data 
ImportError: No module named tensorflow.examples.tutorials.mnist 

Dann habe ich versuchte es zu installieren (ohne zu wissen, warum, da es im letzten Monat installiert wurde) durch sudo pip install tensorflow und sagt:

The directory '/home/user/.cache/pip/http' or its parent directory is not owned by the current user and the cache has been disabled. Please check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
The directory '/home/user/.cache/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag. 
Collecting tensorflow 
/usr/local/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:315: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#snimissingwarning. 
    SNIMissingWarning 
/usr/local/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. 
    InsecurePlatformWarning 
    **Could not find a version that satisfies the requirement tensorflow (from versions:) 
No matching distribution found for tensorflow** 
/usr/local/lib/python2.7/dist-packages/pip-8.1.1-py2.7.egg/pip/_vendor/requests/packages/urllib3/util/ssl_.py:120: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning. 
    InsecurePlatformWarning 

Eine Idee, was das verursacht?

Antwort

0

Klingt wie Ihre Config weggeblasen wurde, die den konfigurierten Python-Pfad enthalten würde. Da Sie ein virtualenv verwenden, müssen Sie PyCharm konfigurieren, um es unter Projekteinstellungen> Projekt-Interpreter zu verwenden und die ausführbare Python-Datei in Ihrem virtualenv auszuwählen oder zu durchsuchen.

+0

Irgendwie funktioniert es nicht und wenn ich versuche, eine ausführbare Datei ("/home/user/tensorflow/bin/python2.7") namens python2.7 (der virtualenv heißt hier Tensorflow) als der Interpreter es heißt "Exit mit Nicht-Null-Code (4)", es erklärt auch nicht, warum, wenn ich versuche, Tensorflow über Pip neu installieren, es sagt: 'Konnte keine Version finden, die die Anforderung erfüllt Tensorflow (von den Versionen:) Keine Übereinstimmung Verteilung für Tensorflow gefunden, weil es außerhalb von Pycharm ist. – Gabe

+1

Tensorflow scheint zu diesem Zeitpunkt nicht Teil des PyPI zu sein, folgen Sie den Anweisungen hier: https://www.tensorflow.org/versions/r0.8/get_started/os_setup.html#pip-installation Auch, machen sicher, dass Sie die richtige Pip-Programmdatei (die in Ihrem virtualenv) verwenden, wenn Sie installieren. Benutze 'which pip' um zu bestätigen –