问题
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
Clone:
git clone https://github.com/jrk/gnuplot-py into the site-packages
Go to the installed directory use:
python setup.py install
来源:https://stackoverflow.com/questions/29429886/importerror-for-gnuplot-in-python-terminal