通过终端在 openSUSE Leap 中安装 Python

Posted

技术标签:

【中文标题】通过终端在 openSUSE Leap 中安装 Python【英文标题】:Python instalation in openSUSE Leap via terminal 【发布时间】:2019-07-23 12:09:17 【问题描述】:

我是 openSUSE 的新手,我想通过不使用 YaST 的终端安装最新的 python 版本。

我已经在他们的网站上下载了最新的 python tarball,解压它并通过终端输入文件夹。然后我继续“./configure”并得到了一些错误。

:~/Downloads/Python-3.7.4> ./configure
configure: loading site script /usr/share/site/x86_64-unknown-linux-gnu
checking build system type... x86_64-pc-linux-gnu
checking host system type... x86_64-pc-linux-gnu
checking for python3.7... no
checking for python3... python3
checking for --enable-universalsdk... no
checking for --with-universal-archs... no
checking MACHDEP... checking for --without-gcc... no
checking for --with-icc... no
checking for gcc... no
checking for cc... no
checking for cl.exe... no
configure: error: in `/home/egydio/Downloads/Python-3.7.4':
configure: error: no acceptable C compiler found in $PATH
See `config.log' for more details

【问题讨论】:

您使用的是 openSUSE Tumbleweed 还是 openSUSE Leap 15.1? Can I ask questions about installation in SO? 程序员常用的软件工具,是软件开发独有的实用、可解答问题。 【参考方案1】:
# Tested on OpenSUSE 15.1. Likely to work on many versions of OpenSUSE.
# This is a minimal install.  You can add additional modules to your liking.
sudo zypper in gcc zlib-devel libffi-devel readline-devel
sudo zypper in libopenssl-devel  # Optional. Allows compiling against OpenSSL.
wget https://www.python.org/ftp/python/3.7.4/Python-3.7.4.tar.xz
unxz Python-3.7.4.tar.xz
tar -xf Python-3.7.4.tar
cd Python-3.7.4
./configure
make
make test
sudo make install
sudo ln -s /usr/local/lib64/python3.7/lib-dynload/ /usr/local/lib/python3.7/lib-dynload  # This symlink corrects the readline error.

【讨论】:

【参考方案2】:

我想只需在配置调用中添加--libdir=<prefix>/lib 即可解决问题。

【讨论】:

以上是关于通过终端在 openSUSE Leap 中安装 Python的主要内容,如果未能解决你的问题,请参考以下文章

在linux openSUSE 13.1中安装supervisor时出错

Eclipse中安装LEAP插件

openSUSE Leap 15通过windows rdp访问

在 openSUSE 上的 Virtualenv 中安装 TensorFlow

在 OpenSUSE 中安装 PG gem

在 Opensuse 环境中安装 oracle 和 php oracle 扩展(OCI8)