Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python 3.7 install not working on openSUSE Leap 42.3

Tags:

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.

like image 827
Ted Kandell Avatar asked Jul 06 '18 00:07

Ted Kandell


1 Answers

This should fix your problem:

ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload
like image 199
ralhei Avatar answered Oct 04 '22 16:10

ralhei