Module ggplot installed but cannot be imported

大兔子大兔子 提交于 2019-12-11 14:26:42

问题


I installed ggplot for python 2.7 in a Win64 env using conda via the command line:

$conda install -c https://conda.binstar.org/bokeh ggplot

since:

$pip install -U ggplot

could not locate the package (see pevious stackQ).

Checking if module is installed:

 >python -c "import ggplot"
 Traceback (most recent call last):
 File "<string>", line 1, in <module>
 ImportError: No module named ggplot

Any idea how to resolve this?

Update notes: debug tests

 $pip freeze  
 >(finds package ggplot)
 $import imp
 $imp.find_module("ggplot")
 >'C:\\Users\\Remi\\Anaconda2\\envs\\envx\\lib\\site-packages\\ggplot'

回答1:


I am posting the resolution I arrived to. It is not linear, although it may benefit others who may encounter a similar issue.

First step: activated the environment envx where the ggplot module was said to reside in.

Importing module again:

$python -c "import ggplot"

Throws a complaint ending with:

ImportError: DLL load failed: The specified module could not be found.

among failures in requesting imports from scipy and ggplot modules.

Second step: re-installed scipy

$conda install scipy

Here conda has to do some 'intuitive' updates of python, numpy ... ect. During the initial ggplot install, conda went the downgrade route.

That's it.



来源:https://stackoverflow.com/questions/37465839/module-ggplot-installed-but-cannot-be-imported

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!