gpt4 book ai didi

Python 3.7 安装在 openSUSE Leap 42.3 上不起作用

转载 作者:行者123 更新时间:2023-12-03 16:40:36 28 4
gpt4 key购买 nike

在 openSUSE Leap 42.3 上从源代码构建和安装 Python 3.7.0 时,安装到/usr/local 的默认 ./configure 会出现严重的 Python 错误。

(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'
>>>

pip 也坏了:
$ 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) 的依赖关系,因此无法安装。

最佳答案

这应该可以解决您的问题:

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

关于Python 3.7 安装在 openSUSE Leap 42.3 上不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51201459/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com