You are not logged in.

#1 2017-01-07 12:43:50

Orians
Member
Registered: 2017-01-07
Posts: 8

ImportError: No module named PySide

Hello everybody. Due to bussiness necessities I moved recently to Linux, and I'm having my firsts troubles dealing with it. Specifically, trying to run a program which needs PySide. I tried to intall it via pacman, yaourt, also I followed this guide (I know that the last one is for Ubuntu, but well, I need to try it, there's anything to lose), but afer all never works, showing the error mentioned in the subject. Somebody know what can I do to solve it?


I tried to install this packages through pacman/yaourt:

pyside-comon-tools
python-pyside
python-pyside-comon
python-pyside-tools
python2-pyside
python2-pyside-tools

The program works with python 2.7 (I already know how to switch between python3 and 2, so this isn't the problem), don't know if its relevant or not.


Thanks everybody in advance. By the way, as I said I'm a newbie in Linux, but also here. If you need further information, please tell me and I'll answer you as soon as possible.

Offline

#2 2017-01-07 12:52:35

runical
Member
From: The Netherlands
Registered: 2012-03-03
Posts: 896

Re: ImportError: No module named PySide

Did you rebuild the python packages from the AUR after the update to python 3.6?

Also, welcome to Arch. Please make sure you read the code of conduct smile

Offline

#3 2017-01-07 15:08:55

Orians
Member
Registered: 2017-01-07
Posts: 8

Re: ImportError: No module named PySide

runical wrote:

Did you rebuild the python packages from the AUR after the update to python 3.6?


Thats for the welcoming and the fast answer. My current python version is 3.5.2. So I think it wouldn't be the problem. Nevertheless I see this reddit post, and I followed the steps I see, with this result:

$  pacman -Qoq /usr/lib/python3.5 | sort -u | xargs package-query -AQm -f '%r/%n' | sort -u -t/ -k2
aur/menulibre
aur/mugshot
$  pacman -Qoq /usr/lib/python3.5 | sort -u | xargs package-query -AQm -f '%n' | sort -u
menulibre
mugshot


So, it seems they doesn't need a rebuild, right?

Offline

#4 2017-01-07 15:21:00

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: ImportError: No module named PySide

$ pacman -Si python python-pyside
Repository      : extra
Name            : python
Version         : 3.6.0-1
Description     : Next generation of the python high-level scripting language
Architecture    : x86_64
URL             : http://www.python.org/
Licenses        : custom
Groups          : None
Provides        : python3
Depends On      : expat  bzip2  gdbm  openssl  libffi  zlib
Optional Deps   : python-setuptools
                  python-pip
                  sqlite
                  mpdecimal: for decimal
                  xz: for lzma
                  tk: for tkinter
Conflicts With  : None
Replaces        : python3
Download Size   : 33.13 MiB
Installed Size  : 124.46 MiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Sat 24 Dec 2016 08:04:46 GMT
Validated By    : MD5 Sum  SHA-256 Sum  Signature

Repository      : community
Name            : python-pyside
Version         : 1.2.4-4
Description     : Provides LGPL Qt bindings for Python and related tools for
                  binding generation (Python 3 version)
Architecture    : x86_64
URL             : http://qt-project.org/wiki/PySide
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : python  qt4>=4.8  python-shiboken>=1.2.4
                  python-pyside-common=1.2.4-4
Optional Deps   : qtwebkit: for PySide.QtWebKit
                  phonon: for PySide.phonon
Conflicts With  : None
Replaces        : None
Download Size   : 3.53 MiB
Installed Size  : 21.09 MiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : Sat 24 Dec 2016 17:23:05 GMT
Validated By    : MD5 Sum  SHA-256 Sum  Signature

So you have not run a system upgrade since python in the official repositories was upgraded to version 3.6
What is the output of the following

$ pacman -Qi python-pyside python-pyside-common python-pyside-tools

Edit:
grammar extraneous was

Last edited by loqs (2017-01-07 15:21:46)

Offline

#5 2017-01-07 15:55:53

Orians
Member
Registered: 2017-01-07
Posts: 8

Re: ImportError: No module named PySide

Thanks loqs for your answer. As you say, there are some things not updated. In my defense, I must say that the first program I tried (and suffered) to install was Spotify, and since I see how hard to deal with could be some packages (I said it, newbie coming from widnows...), I choose what seems to me the less foolhardy desition, don't change anything if it works until all the needed software is working.

$pacman -Qi python-pyside python-pyside-common python-pyside-tools

Name            : python-pyside
Version         : 1.2.4-3
Description     : Provides LGPL Qt bindings for Python and related tools for
                  binding generation (Python 3 version)
Architecture    : x86_64
URL             : [url]http://qt-project.org/wiki/PySide[/url]
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : python  qt4>=4.8  python-shiboken>=1.2.4
                  python-pyside-common=1.2.4-3
Optional Deps   : qtwebkit: for PySide.QtWebKit [installed]
                  phonon: for PySide.phonon [installed]
Required By     : python-pyside-tools
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 21,30 MiB
Packager        : Evangelos Foutras <evangelos@foutrelis.com>
Build Date      : lun 07 dic 2015 06:52:25 CET
Install Date    : sáb 07 ene 2017 12:36:15 CET
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Name            : python-pyside-common
Version         : 1.2.4-3
Description     : Provides LGPL Qt bindings for Python and related tools for
                  binding generation (Common Files)
Architecture    : x86_64
URL             : [url]http://qt-project.org/wiki/PySide[/url]
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : None
Optional Deps   : None
Required By     : python-pyside  python2-pyside
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 1102,00 KiB
Packager        : Evangelos Foutras <evangelos@foutrelis.com>
Build Date      : lun 07 dic 2015 06:52:07 CET
Install Date    : sáb 07 ene 2017 12:36:14 CET
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Name            : python-pyside-tools
Version         : 0.2.15-3
Description     : PySide lupdate, rcc, and uic development tools (for Python 3)
Architecture    : x86_64
URL             : [url]https://qt-project.org/wiki/PySide[/url]
Licenses        : LGPL
Groups          : None
Provides        : None
Depends On      : python-pyside  pyside-tools-common
Optional Deps   : None
Required By     : None
Optional For    : None
Conflicts With  : None
Replaces        : None
Installed Size  : 358,00 KiB
Packager        : Felix Yan <felixonmars@archlinux.org>
Build Date      : lun 07 dic 2015 13:42:46 CET
Install Date    : sáb 07 ene 2017 12:36:15 CET
Install Reason  : Explicitly installed
Install Script  : No
Validated By    : Signature

Edit: modified how I showed the requested data, adding BBcodes

Last edited by Orians (2017-01-07 15:58:04)

Offline

#6 2017-01-07 16:03:06

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: ImportError: No module named PySide

Would prefer the system was up to date but I would not expect that to cause this issue.
What is the output of

$ pacman -Qkk python-pyside python-pyside-common python-pyside-tools

Offline

#7 2017-01-07 16:06:49

Orians
Member
Registered: 2017-01-07
Posts: 8

Re: ImportError: No module named PySide

$ pacman -Qkk python-pyside python-pyside-common python-pyside-tools

python-pyside: 39 total files, 0 altered files
python-pyside-common: 90 total files, 0 altered files
python-pyside-tools: 90 total files, 0 altered files

Offline

#8 2017-01-07 16:18:54

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: ImportError: No module named PySide

If

ls /usr/lib/python3.5/site-packages/PySide/

lists __init__.py in its output
then python / python3

import PySide

should find the module unless you have adjusted the standard search paths.
I am also out of ideas beyond suggesting you run a full system update.

Offline

#9 2017-01-07 16:40:40

Orians
Member
Registered: 2017-01-07
Posts: 8

Re: ImportError: No module named PySide

$ ls /usr/lib/python3.5/site-packages/PySide/

__init__.py       QtHelp.so        QtScriptTools.so  QtWebKit.so
phonon.so         QtMultimedia.so  QtSql.so          QtXmlPatterns.so
QtCore.so         QtNetwork.so     QtSvg.so          QtXml.so
QtDeclarative.so  QtOpenGL.so      QtTest.so         _utils.py
QtGui.so          QtScript.so      QtUiTools.so


(lists __init__.py isn't in the output)


$ python3

Python 3.5.2 |Anaconda 4.2.0 (64-bit)| (default, Jul  2 2016, 17:53:06) 
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.

>>> import PySide
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ImportError: No module named 'PySide'

Offline

#10 2017-01-07 16:47:21

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: ImportError: No module named PySide

$ python3
Python 3.5.2 (default, Nov  7 2016, 11:31:36) 
[GCC 6.2.1 20160830] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 
$ pacman -Qo /usr/bin/python3
/usr/bin/python3 is owned by python 3.5.2-3

Edit:
Seems the issue is related to the use of anaconda in place of the default python3

Last edited by loqs (2017-01-07 16:48:29)

Offline

#11 2017-01-08 00:19:20

Orians
Member
Registered: 2017-01-07
Posts: 8

Re: ImportError: No module named PySide

loqs wrote:

Seems the issue is related to the use of anaconda in place of the default python3

$ pacman -Qo /usr/bin/python3
/usr/bin/python3 is owned by python 3.5.2-3

(My output, don't know if relevant or not, sorry).
In case the issue is related with anaconda (and I know that the question is already moving out the scope of the initial question, and so of the post), there is an easy solution? Knowing that, I'll try to find an answer elsewhere, and if I find something usefull, I'll post it as soon as possible.

Offline

#12 2017-01-08 00:25:24

loqs
Member
Registered: 2014-03-06
Posts: 17,372

Re: ImportError: No module named PySide

If the none anaconda python3 is still accessible on the system would run that and test if the import still fails.
As I am not familiar with anaconda can not answer the other question.

Offline

#13 2017-01-08 01:24:27

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: ImportError: No module named PySide

Testing what /usr/bin/python3 is, doesn't help unless you also confirm that that is the python3 you are using. wink I think anaconda prepends itself to your system $PATH.
Check the output of

type python3

If you didn't even know that you were running anaconda python, then you probably don't need it.... so uninstall anaconda and try again with plain old python. smile

Last edited by eschwartz (2017-01-08 01:32:36)


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#14 2017-01-08 13:12:59

Orians
Member
Registered: 2017-01-07
Posts: 8

Re: ImportError: No module named PySide

Thaks  Eschwartz.

$ type python3
python3 is /home/orians/anaconda3/bin/python3

Seems anaconda is making all go wrong, didn't it?? As far as I remember, I'll need it too, but well,  knowing which package is causing the issue I can try to figure out how make them work properly

Offline

#15 2017-01-08 15:54:52

eschwartz
Fellow
Registered: 2014-08-08
Posts: 4,097

Re: ImportError: No module named PySide

That doesn't look like a package, it is in your $HOME so it was probably build by hand. Regardless, letting anaconda be the default python is probably no safer than setting it to python2 -- plenty of system scripts follow the terrible upstream advice to use "#!/usr/bin/env python3" shebangs, and anaconda at a minimum won't have your pacman-installed python modules in /usr/lib/python3.6/site-packages/


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#16 2017-01-09 01:35:42

Orians
Member
Registered: 2017-01-07
Posts: 8

Re: ImportError: No module named PySide

Eschwartz wrote:

That doesn't look like a package, it is in your $HOME so it was probably build by hand. Regardless, letting anaconda be the default python is probably no safer than setting it to python2 -- plenty of system scripts follow the terrible upstream advice to use "#!/usr/bin/env python3" shebangs, and anaconda at a minimum won't have your pacman-installed python modules in /usr/lib/python3.6/site-packages/


So true. I followed quite literally some guidelines from a colleague, and well... now we have something to laugh about at the coffee break.


Good news, finally I mannaged to make all work. I reintalled anaconda (now as it should be done) and PySide packages, confirming they work ($python/2 / $import PySide). The rest of it in order to run the program was pretty straightforward (more or less, as I need to create a virtual environment for python2, migrate all the donwloaded python packages to it and deal with a minor bugfixing, but I survived to it)



That's all. Thank you all for helping and guiding me with this troublefixing.

Last edited by Orians (2017-01-09 01:36:21)

Offline

Board footer

Powered by FluxBB