I just installed it with apt-get on debian linux with
apt-get install libqt4-opengl
the rest of PyQt4 is available, but I cant get to this new module.
from PyQt4 import QtOpenGL
raises ImportError. any idea what to do?
Did you forget to install the Python bindings?
apt-get install python-qt4-gl
For Python3, I had to do sudo apt-get install python3-pyqt4.qtopengl
Related
The error I get is:
No module named '_tkinter'
I have tried using:
sudo apt-get install python python-tk idle python-pmw python-imaging
The turtle works in python2.7.1
You probably only installed the turtle for python 2.7.
sudo apt-get install python3-tk
(and others you may need)
I am trying to use the qrtools module with Python 3.4.2 on my Raspberry Pi 2, however it cannot run as I don't have the zbar module installed.
Trying
pip-3.2 install zbar
Gives the error message shown in the picture
sudo pip-3.2 install zbar
gives a similar error
Any ideas?
(I do have it installed with Python 2.7)
UPDATE: Both libzbar-dev and python3-dev are up to date. Still...
No module named 'zbar'
assuming you're using a debian derivative (like ubuntu), you need to install zbar's developement package, which contains the header file zbar.h
$ sudo apt-get install libzbar-dev
for redhat/fedora systems:
$ sudo yum install zbar-devel
and probably python's dev package too:
$ sudo apt-get install python3-dev
or you can use pip install zbar-py
https://pypi.org/project/zbar-py/
Try the following code after entering sudo mode:
yum install zbar-devel
This should work for fedora.
Bumping #herve solution
On ubuntu and on Mint
sudo apt-get install python-zbar libzbar-dev python-qrtools
pip install libzbar-cffi==0.2.1
I have two python compilers on my Ubuntu 14.04 VM. I have installed matplotlib as
pip install matplotlib
But the matplotlib cannot be used from python3.It can be used from python2.7
If I use import matplotlib.pyplot as plt inside my script test.py and run it as
python3 test.py
I get the error
ImportError: No module named 'matplotlib'
How can this be fixed.
Use pip3 to install it:
sudo apt-get install python3-pip
sudo pip3 install matplotlib
You can install the package from your distro with:
sudo apt-get install python3-matplotlib
It will probably throw an error when you import matplotlib, but it is solved by installing the package tkinter with:
sudo apt-get install python3-tk
I want to run python code on Ubuntu 14.04, but when I execute it, it gives me the following error message
Traceback (most recent call last):
File "main.py", line 2, in <module>
from tkinter import *
ImportError: No module named tkinter
Try writing the following in the terminal:
sudo apt-get install python-tk
Don't forget to actually import Tkinter module at the beginning of your program:
import Tkinter
If you're using Python 3 then you must install as follows:
sudo apt-get update
sudo apt-get install python3-tk
Tkinter for Python 2 (python-tk) is different from Python 3's (python3-tk).
To get this to work with pyenv on Ubuntu 16.04, I had to:
$ sudo apt-get install python-tk python3-tk tk-dev
Then install the version of Python I wanted via pyenv:
$ pyenv install 3.6.2
Then I could import tkinter just fine:
import tkinter
First, make sure you have Tkinter module installed.
sudo apt-get install python-tk
In python 2 the package name is Tkinter not tkinter.
from Tkinter import *
ref: http://www.techinfected.net/2015/09/how-to-install-and-use-tkinter-in-ubuntu-debian-linux-mint.html
Try:
sudo apt-get install python-tk python3-tk tk-dev
If you're using python3, then Python3 virtual environment(venv) is also required. Use:
sudo apt install python3-venv
Install the package python-tk like
sudo apt-get install python-tk
That is described (with apt-cache search python-tk as)
Tkinter - Writing Tk applications with Python
In Ubuntu 14.04.2 LTS:
Go to Software Center and remove "IDLE(using Python-2.7)".
Install "IDLE(using Python-3.4)".
Try again. This step worked for me.
But, they were unable to be found!?
How do I install both of them?
Have you installed python-mysqldb? If not install it using apt-get install python-mysqldb. And how are you importing mysql.Is it import MySQLdb? Python is case sensitive.
This should do the trick.
sudo apt-get install mysql-server
sudo apt-get install python-mysqldb
I believe this should make it work:
sudo apt-get install python-mysqldb