Ich glaube, ich habe pygraphviz auf meinem Debian-Build installiert. Ich kann es importieren, wenn ich Python von der Kommandozeile:PygraphViz Importfehler mit PyCharm
[email protected]:~/anaconda3/bin$ ipython
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:17:45)
Type "copyright", "credits" or "license" for more information.
IPython 4.1.2 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
In [1]: import pygraphviz
In [2]:
Allerdings, wenn ich das gleiche von einem Python-Konsole aus PyCharm versuchen, bekomme ich diesen Fehler:
/home/jon/anaconda3/bin/python /home/jon/apps/pycharm-community-5.0.4/helpers/pydev/pydevconsole.py 59089 41751
Python 3.5.1 |Anaconda 2.5.0 (32-bit)| (default, Dec 7 2015, 11:17:45)
Type "copyright", "credits" or "license" for more information.
IPython 4.0.3 -- An enhanced Interactive Python.
? -> Introduction and overview of IPython's features.
%quickref -> Quick reference.
help -> Python's own help system.
object? -> Details about 'object', use 'object??' for extra details.
PyDev console: using IPython 4.0.3
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/home/jon/PycharmProjects/StateMachine'])
Python 3.5.1 |Anaconda 2.5.0 (32-bit)| (default, Dec 7 2015, 11:17:45)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
In[2]: import pygraphviz
Traceback (most recent call last):
File "/home/jon/anaconda3/lib/python3.5/site-packages/IPython/core/interactiveshell.py", line 3066, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "<ipython-input-2-99ed911275c0>", line 1, in <module>
import pygraphviz
File "/home/jon/apps/pycharm-community-5.0.4/helpers/pydev/pydev_import_hook.py", line 21, in do_import
module = self._system_import(name, *args, **kwargs)
ImportError: No module named 'pygraphviz'
Ich stelle fest, dass im ersten Beispiel ist die Python-Version
Python 3.5.1 |Continuum Analytics, Inc.| (default, Dec 7 2015, 11:17:45)
während im zweiten Beispiel ist die Version:
Python 3.5.1 |Anaconda 2.5.0 (32-bit)| (default, Dec 7 2015, 11:17:45)
So das zweite Beispiel, das fehlschlägt, wird 32-Bit sein (als eine Randnotiz, warum sollte es eine 32-Bit-Version installiert haben?)
Meine/anaconda3/ENVs Ordner leer ist.
Soweit ich weiß, habe ich nur eine Python-Umgebung in Conda installiert.
Also meine Frage ist ... Warum scheitert der Import von PyCharm, und warum scheint es, eine 32-Bit-Version von Python auszuführen, wenn ich nur eine Version installiert habe?
Warum sollte ich mit Umgebungen arbeiten? – Ginger
In meiner Erfahrung arbeitet Anaconda besser und ist einfacher zu verwalten, wenn Sie virtuelle envs verwenden (durch 'conda create') – rll
Danke für den Tipp. Ich werde damit spielen! – Ginger