Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pyqtgraph - ImportError: No module named pyqtgraph

Recently I downloaded pyqtgraph module. I ran the build and install after extract the folder, however when I ran a simple example like under here

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

I got a error:

Traceback (most recent call last):
File "main.py", line 1, in <module>
import pyqtgraph as pg
ImportError: No module named pyqtgraph

I am runnin on ubuntu 14.04 and pyqtgraph is under /usr/local/lib/python2.7/dist-packages. Does anybody can help me?

like image 850
Lucas Santana Avatar asked Oct 20 '22 05:10

Lucas Santana


1 Answers

If you don't have a package installed for that (or, any module in general), run:

sudo pip install (modulename)

and

sudo pip3 install (modulename)

for Python3.

So in this case, try sudo pip install pyqtgraph. worked for me.

like image 82
NoBugs Avatar answered Oct 21 '22 19:10

NoBugs