I have installed PyQt5 in my Ubuntu 14.04.04 LTS by using the following command:
sudo apt-get install python3-pyqt5
But when I run the following statement in python IDLE, I got errors. How to solve it?
>>> from PyQt5.QtQuick import QQuickView, QQuickItem
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'PyQt5.QtQuick'
For this kind of error I have found a solution from the above comment. Just install relevant package with apt-get:
sudo apt-get install python3-pyqt5.qtquick
Related
Hey Guys i just want to share this with you in case you get the same error :
pip3 -V
Traceback (most recent call last):
File "/Users/$(whoami)/Library/Python/3.7/bin/pip3", line 5, in <module>
from pip._internal.cli.main import main
ModuleNotFoundError: No module named 'pip._internal.cli.main'
I've just solved this problem by updating pip. Like this:
python -m pip install --upgrade pip --user
Solution :
remove all python folders, and reference found here :
/usr/local/bin/
/usr/local/lib
/usr/local/Cellar/
/Users/$(whoami)/Library/Python/
/Library/Frameworks/Python.framework/Versions/ (Only if it exists !! for me it doesnt)
Then run :
brew install python3
I am beginner to kivy.
Today i thought to work on the kivy camera module which is provided by the kivy official example, after running the code. I am getting the error like this.
[GCC 5.4.0 20160609]
Traceback (most recent call last):
File "Camera_1.py", line 2, in <module>
from kivy.app import App
File "/usr/lib/python3/dist-packages/kivy/app.py", line 319, in <module>
from kivy.base import runTouchApp, stopTouchApp
File "/usr/lib/python3/dist-packages/kivy/base.py", line 29, in <module>
from kivy.clock import Clock
File "/usr/lib/python3/dist-packages/kivy/clock.py", line 362, in <module>
from kivy._clock import CyClockBase, ClockEvent, FreeClockEvent, \
ImportError: No module named 'kivy._clock'
I installed kivy using python3 pip and downloaded the example using official site. Please help me.
downloaded link : https://kivy.org/docs/installation/installation-linux.html
I've had the same problem. What I did was to remove Kivy with:
$ sudo apt-get purge python3-kivy
Then follow the following steps:
$ sudo add-apt-repository ppa:kivy-team/kivy
$ sudo apt-get update
$ sudo apt-get upgrade
$ sudo apt-get install python3-kivy
Run your script with the IDLE for your python version. This worked for me!
I tried to install libxml2 and libxslt on ubuntu 16.04 using this command:
sudo apt-get install libxml2-dev libxslt-dev python-dev
when finished I try to import like this:
import libxml2
import libxslt
when I use python2 I can import without problem and when use python3 I get this error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'xmllib2'
For the first part:
sudo apt-get install python3-libxml2
For libxslt, it is no longer maintained. However, someone has ported it to work with Python3:
https://github.com/Unidata/gempak/tree/master/extlibs/xslt/libxslt-1.1.28
It appears that it must be compiled. Here is the documentation stating that it works with Python3:
https://gist.github.com/novocaine/ae657bdbf0f25b81e52b
I'm getting the following error when trying to set up a new virtualenv with python3.4 (I'm running this command: virtualenv –p /usr/bin/python /tmp/djangodev):
Traceback (most recent call last):
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site- packages/pkg_resources.py", line 2697, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 669, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 576, in resolve
raise VersionConflict(dist,req) # XXX put more info here
pkg_resources.VersionConflict: (virtualenv 1.11.6 (/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages),
Requirement.parse('virtualenv==1.7.2'))
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/virtualenv", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 2701, in <module>
parse_requirements(__requires__), Environment()
File "/System/Library/Frameworks/Python.framework/Versions/3.4/lib/python3.4/site-packages/pkg_resources.py", line 572, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: virtualenv==1.7.2
I first downloaded virtualenv1.7.2 and after getting this error updated it by running: pip install virtualenv. Here is the successful installation message from this:
Downloading/unpacking virtualenv
Downloading virtualenv-1.11.6-py2.py3-none-any.whl (1.6MB): 1.6MB downloaded
Installing collected packages: virtualenv
Successfully installed virtualenv
Cleaning up...
Can someone please help me resolve the above error?
Thanks #MattDMo for cluing me in.
I indeed have multiple virtualenvs installed so I ran sudo pip uninstall virtualenv and then sudo pip install virtualenv and this resolved the above error.
I've been switching a project from python2.7 to python3. All was good in pyhton2.7. I am using PySide and I have installed it on Ubuntu. The package exists and all the .so files are there but I get this error in python3
>>> import PySide
>>> from PySide import *
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: /usr/local/lib/python3.2/dist-packages/PySide/QtCore.so: undefined symbol: _ZN8Shiboken6Object4hashEP7_object
>>>
Any ideas how to resolve it?
I was using pip to install PySide but using
sudo apt-get install python3-pyside
did the trick