在openSUSE Leap 42.3上从源代码构建和安装Python 3.7.0时,存在严重的python错误,其默认..configure安装在/ usr / local。
(openSUSE Leap 42.3 Python3软件包仅适用于Python 3.4.6,并且virtualenv尚未具有发行版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'
>>>
点也坏了:
$ 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'
编辑:一种可能的解决方案:
$ sudo ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload
(其中/ usr / local /是默认的PYTHONHOME)
那么问题是,从https://www.python.org/到Python 3.7.0的安装是否有一般性修复?每个人都必须遇到相同的问题,至少对于openSUSE Leap 42.3。
experimental openSUSE python 3.7.0 (devel:languages:python:Factory)打破了apparmor和python(abi)的依赖关系,因此无法安装。
答案 0 :(得分:0)
这应该可以解决您的问题:
ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload