linux Meson错误:“/usr/local/bin/python3 ']>不是有效的python或缺少distutils

wz8daaqr  于 5个月前  发布在  Linux
关注(0)|答案(2)|浏览(102)

这是介子日志的完整日志:Link to Google Drive
我的python3 Python 3.12.0 (main, Oct 16 2023, 16:36:20) [GCC 11.4.0] on linux副本是我自己编译的(我按照说明),但它没有ssl和distutils(python3-distutils,python3-openssl,libssl和openssl是从apt安装的)模块。(我不确定这是否是我运气不好的问题,因为我做的编译没有是成功的,也没有错误)
我尝试编译梅萨(3D渲染库),但这是我得到的:

sudo meson setup builddir/

The Meson build system
Version: 0.61.2
Source dir: /home/MyName/PycharmProjects/Rooms3D/mesa-23.3.0-rc1
Build dir: /home/MyName/PycharmProjects/Rooms3D/mesa-23.3.0-rc1/builddir
Build type: native build
Project name: mesa
Project version: 23.3.0-rc1
C compiler for the host machine: ccache cc (gcc 11.4.0 "cc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C linker for the host machine: cc ld.bfd 2.38
C++ compiler for the host machine: ccache c++ (gcc 11.4.0 "c++ (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0")
C++ linker for the host machine: c++ ld.bfd 2.38
Host machine cpu family: x86_64
Host machine cpu: x86_64
Checking if "-mtls-dialect=gnu2" runs: YES
Checking if "split TLSDESC" : links: YES 
Found pkg-config: /usr/bin/pkg-config (0.29.2)
Found CMake: /usr/bin/cmake (3.22.1)
Run-time dependency vdpau found: NO (tried pkgconfig and cmake)
Program glslangValidator found: YES (/usr/bin/glslangValidator)
Run-time dependency libomxil-bellagio found: NO (tried pkgconfig and cmake)
Run-time dependency libtizonia found: NO (tried pkgconfig and cmake)
Run-time dependency libtizplatform found: NO (tried pkgconfig and cmake)
Run-time dependency tizilheaders found: NO (tried pkgconfig and cmake)
Run-time dependency libva found: NO (tried pkgconfig and cmake)
Program python3 found: YES (/usr/local/bin/python3)

meson.build:869:0: ERROR: <PythonExternalProgram 'python3' -> ['/usr/local/bin/python3']> is not a valid python or it is missing distutils

字符串
看到这个错误后,我想起这可能是因为我编译的python3,因为它没有distutils,以便meson工作。我试图通过Synaptic重新安装python3和组件,但它没有这样做。
我还试图通过apt reinstall python3重新安装它,我立即后悔了,因为它删除了所有依赖项。

56lgkhnf

56lgkhnf1#

修复Python 3

要修复python3,你需要下载并编译OpenSSL,确保配置器知道OpenSSL(我们编译的那个)在哪里,然后编译它。Source:Building Python 3.7.1 - SSL module failed

修复Meson错误

但是这对Meson错误没有帮助。要修复Meson的问题,我们不安装distutils(如果我们的python3(不是错字)版本高于3.11,相反,我们需要转到meson.build文件并找到(CTRL + F)
第一个月
并将python3替换为python3.11(python和3.11之间的空格排除不是打字错误)或任何你想使用的版本(在再次执行介子之前,请确保通过终端命令安装了所需的版本:
sudo apt install python3.11
现在,我们可以运行Meson了。确保你安装了编译所需的软件包。

t3irkdon

t3irkdon2#

为了让meson在没有distutils的情况下工作(因此在Python 3.12中也是如此--在Python 3.11中没有替换),你需要更新版本:

  • Meson必须至少为1.2.3版本。
  • meson_python必须至少为0.15.0版本。

相关问题