ImportError for Gnuplot in python terminal

此生再无相见时 提交于 2019-12-10 21:03:37

问题


I have Gnuplot 4.2 patchlevel 6 installed on my Centos 6 system. However, whenever I try importing Gnuplot in the python terminal, I get an error message which says that there is no module named Gnuplot:

'>>> import Gnuplot
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named Gnuplot`

Please help. Thanks.


回答1:


try:

pip install gnuplot-py

If it does not work, try downloading the package from http://gnuplot-py.sourceforge.net/ and install it.




回答2:


pip install gnuplot-py

didnot worked for me

Collecting gnuplot-py
Could not find a version that satisfies the requirement gnuplot-py (from versions: )
  Some externally hosted files were ignored as access to them may be unreliable (use --allow-external gnuplot-py to allow).
No matching distribution found for gnuplot-py

but following did the job:

wget http://downloads.sourceforge.net/project/gnuplot-py/Gnuplot-py/1.8/gnuplot-py-1.8.tar.gz
tar xzf gnuplot-py-1.8.tar.gz
cd gnuplot-py-1.8/
python setup.py install



回答3:


The easiest solution would be to

  1. Clone:

    git clone https://github.com/jrk/gnuplot-py into the site-packages

  2. Go to the installed directory use:

    python setup.py install



来源:https://stackoverflow.com/questions/29429886/importerror-for-gnuplot-in-python-terminal

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