5
votes

When building and installing Python 3.7.0 from source on openSUSE Leap 42.3 there are serious python errors with the default ./configure which installs to /usr/local .

(openSUSE Leap 42.3 Python3 package is only up to Python 3.4.6, and virtualenv does not yet have the release version 3.7.)

$ python3
Python 3.7.0 (default, Jul  5 2018, 15:55:09) 
[GCC 4.8.5] on linux
Type "help", "copyright", "credits" or "license" for more information.
Traceback (most recent call last):
  File "/etc/pythonstart", line 7, in <module>
    import readline
ModuleNotFoundError: No module named 'readline'
>>> 

pip is broken as well:

$ pip3
Traceback (most recent call last):
  File "/usr/local/bin/pip3", line 7, in <module>
    from pip._internal import main
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/__init__.py", line 20, in <module>
    from pip._vendor.urllib3.exceptions import DependencyWarning
  File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
    from .connectionpool import (
  File "/usr/local/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 7, in <module>
    from socket import error as SocketError, timeout as SocketTimeout
  File "/usr/local/lib/python3.7/socket.py", line 49, in <module>
    import _socket
ModuleNotFoundError: No module named '_socket'

edit: one possible solution:

$ sudo ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload

(where /usr/local/ is the default PYTHONHOME)

The question then is there any generic fix to the Python 3.7.0 install from https://www.python.org/? Everyone must be having the same problem, at least for openSUSE Leap 42.3.

The experimental openSUSE python 3.7.0 (devel:languages:python:Factory) breaks the dependencies for apparmor and python(abi), so this can't be installed.

1
python 3.7 is marked as experimental by openSuse. If you still want to use it, you would be better installing from Suse site.LMC
Yes, but there are features in python 3.7, such as breakpoint(), that aren't available in the openSUSE 3.4.6 python package. python 3.7.0 is now the latest release version. In any case, the distro packages are usually pretty far behind, so many people may want to build and install Python from source.Ted Kandell
What I'm saying is that you can install python 3.7 from opensuse site, click on experimental packages.LMC
python3-apparmor-2.10.3-16.1.x86_64 requires python3 = 3.4, so I guess I'll have to ignore that dependency.Ted Kandell
In my experience the adding the symbolic link $ sudo ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload is always required when building python with make altinstall on OpenSusesnakecharmerb

1 Answers

4
votes

This should fix your problem:

ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload