最近我下载了pyqtgraph模块.我在提取文件夹后运行构建并安装,但是当我运行一个简单的例子时,就像在这里一样
import pyqtgraph as pg
import numpy as np
x = np.random.normal(size=1000)
y = np.random.normal(size=1000)
pg.plot(x, y, pen=None, symbol='o') ## setting pen=None disables line drawing
我收到一个错误:
Traceback (most recent call last):
File "main.py", line 1, in <module>
import pyqtgraph as pg
ImportError: No module named pyqtgraph
我在ubuntu 14.04上运行,而pyqtgraph在/usr/local/lib/python2.7/dist-packages下运行.有人可以帮帮我吗?
解决方法:
如果您没有为此安装软件包(或者,通常是任何模块),请运行:
sudo pip install (modulename)
和
sudo pip3 install (modulename)
对于Python3.
所以在这种情况下,请尝试sudo pip install pyqtgraph.为我工作.