Python3 broken in OpenSuse 13.1

Summary: sys module has no member lib

Just installed python 3.3.3 on opensuse. getting a crash at startup:

[16:18] <stiv> File “/usr/lib/python3.3/”, line 24, in <module>
[16:18] <stiv> ‘stdlib’: ‘{installed_base}/’+sys.lib+’/python{py_version_short}’,
[16:18] <stiv> AttributeError: ‘module’ object has no attribute ‘lib’

This happens with Python 3.3.2 from the regular repo and Python 3.3.3 from devel: language: python.

Building Python 3.3.3 from source works just fine. That line in from source distribution looks like this:
‘stdlib’: ‘{installed_base}/lib/python{py_version_short}’,

I note there is a bug in the bugtracker about this from a year ago, along with a patch.

Version 3.3.2 as included in openSUSE 13.1 works fine here:

# python3
Python 3.3.2 (default, Jun 13 2013, 16:05:31) [GCC] on linux
Type "help", "copyright", "credits" or "license" for more information.

And yes, line 24 looks like this:

        'stdlib': '{installed_base}/'+sys.lib+'/python{py_version_short}',

Are you doing anything special to get this crash?

Do you have python3 installed as well? Or only python3-base?

Python3 and Python3-base are both installed.

Just re-installed Python 3.3.3-96.1-i586 from vendor obs://
Result running ‘python3’ in an xterm:
Traceback (most recent call last):
File “/usr/lib/python3.3/”, line 611, in <module>
File “/usr/lib/python3.3/”, line 596, in main
known_paths = addusersitepackages(known_paths)
File “/usr/lib/python3.3/”, line 278, in addusersitepackages
user_site = getusersitepackages()
File “/usr/lib/python3.3/”, line 254, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File “/usr/lib/python3.3/”, line 243, in getuserbase
from sysconfig import get_config_var
File “/usr/lib/python3.3/”, line 24, in <module>
‘stdlib’: ‘{installed_base}/’+sys.lib+’/python{py_version_short}’,
AttributeError: ‘module’ object has no attribute ‘lib’

Installing Python 3.3.2-5.1.3.i586 from vendor openSuse gives a similar result:

File “/usr/lib/python3.3/”, line 24, in <module>
‘stdlib’: ‘{installed_base}/’+sys.lib+’/python{py_version_short}’,
AttributeError: ‘module’ object has no attribute ‘lib’

As mentioned, building and installing from the sources works fine.
It appears the i586 32-bit versions of python3 are broken in the 13.1 release.

(an aside: is there a way to turn off those stinking smileys?)

Yes, please use

...[/CO..] tags when posting console output.

Ah, thanks for the hint! Although, for the record, the offending part was regular typed text ( devel:languages:python )

There’s a checkbox “deactivate graphical smilies” below the text editor, or you can enclose the offending text with [noparse][noparse]…[/noparse ][/noparse] tags.

Regarding your python problem:
As I said, the version included in openSUSE 13.1 works fine here. Haven’t tried the version from [noparse]devel:languages:python[/noparse] yet.
Did you switch back all python3-* packages?

But I’m on 64bit. I will try the 32bit packages later.

Well, I tried it now on a 32bit 13.1 system and python3 works fine there as well (3.3.2 as included).

So it must be something on your system.

Maybe a mixture of packages?

rpm -qa | grep python3

Maybe there are some files left from your self-compiled python that are used instead of the system’s ones?


I had the problem before I built py 3 from source. For 13.1, I formatted the root partition and did a clean install to make sure old cruft from previous upgrades was gone.

There are a bunch of other py3 packages installed - stuff like pip, setup tools, etc., but no dups of py 3 and py 3-base.

I appreciate your help in this matter, wolfi323. The whole thing is rather puzzling, but I’m glad it is not a problem with the 13.1 distribution.
And thanks for the “disable smilies” hint. Didn’t see that!


Before hitting ‘Submit’, I decided to delete python3-EVERYTHING via YAST and re-install minimum py3. No joy. So, to be thorough, I deleted all AND blew away the /usr/lib/python3.3 and /usr/lib/libpython3* . No py3 anywhere!

After re-installing, it WORKS… both 3.3.2 and 3.3.3. Go figure!
Definitely something local, possibly some old shared lib. Still a bit of a mystery. I very much appreciate your help chasing down the problem. Thanks!