PySide using Python3 on Ubuntu: Undefined Symbol - python-3.x

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

Related

can't make a python project into an executable because path issues?

I'm trying to turn my python project into .exe
I used : pyinstaller --onefile main.py
Then I moved the main.exe into the original file to be sure it can access all the dependencies.
When I run the main.exe, I get an error, failed to execute script main.
I typed cmd in the directory of the python project, and tried python main.py
It gave me this error :
Traceback (most recent call last):
File "main.py", line 3, in <module>
from PyQt5 import QtWidgets, QtCore
ModuleNotFoundError: No module named 'PyQt5'
Even though every module are installed, why is it telling me that?
Thank you.
You haven't installed pyqt5.
Try pip install pyqt5 or pip3 install pyqt5
for linux
sudo apt install python3-pyqt5

Can't import Chem from rdkit in Anaconda Python 3.6.5

I install the Anaconda 4.5.4 with Python 3.6.5 and install rdkit (with command "conda install -c rdkit rdkit") and I'm trying to import the Chem and does not works.
from rdkit import Chem
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/wandre/anaconda3/envs/flaskapp/lib/python3.6/site-packages/rdkit/Chem/__init__.py", line 25, in <module>
from rdkit.Chem.rdmolops import *
ImportError: libXrender.so.1: cannot open shared object file: No such file or directory
How can I fix this? Where is my error?
Thanks!
Just run sudo apt-get install libxrender1 and it works

pdfkit is working on python2 but it's not working in python3

import pdfkit
Error: Traceback (most recent call last):
File "<stdin>", line 1, in <module> ImportError: No module named 'pdfkit'
when i use pdfkit in python2 then it works fine, but if i use in python3 it gives the above error
Packages for Python 2 and Python 3 are completely separate. You have to install any package for both Python versions separately. Try:
sudo python3 -m pip install pdfkit

numpy intalled with pip but not found (in virtualenv)

In an AWS EC2 instance, with Amazon Linux AMI 2016.09 distribution, I have installed numpy, inside my virtualenv where python 3.4 is the default version, with:
pip install numpy
It installs package numpy-1.12.1-cp34-cp34m-manylinux1_x86_64.whl without errors.
After that, in python I try to import it:
>>> import numpy
And I get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'numpy'
Moreover, if I run pip freeze, numpy does not appear in the list.
Why is numpy not being found? and How to fix it?
Did you do this:
#:source .venv/bin/activate
.....
#:python
....
>>>pip3 install numpy
....
This works!

ImportError: No module named 'PyQt5.QtQuick'

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

Resources