Python 官方文档:入门教程 => 点击学习
参考了文章:python 环境搭建 : Http://www.runoob.com/Python/python-install.html 参考了文章:Python 安装 zlib 模块:http://blog.csdn.net/wbible
参考了文章:python 环境搭建 : Http://www.runoob.com/Python/python-install.html
参考了文章:Python 安装 zlib 模块:http://blog.csdn.net/wbiblem/article/details/72598245
参考了文章:python3.6 安装后没有 pip?https://www.zhihu.com/question/54906859
需要安装zlib-1.2.8.tar.gz
#下载地址http://www.zlib.net/
tar xzvf zlib-1.2.8.tar.gz
cd zlib-1.2.8
./configure
make
make install
#zlib 安装完后,libz.a 在 /usr/local/lib/,zlib.h 文件在 /usr/include
#(opensuse 中 zlib.h 默认放在 /usr/local/include/中)
tar -xzvf Python-3.6.4.tgz
cd Python-3.6.4
#./configure --prefix=/usr/local/Python-3.6.4
./configure --prefix=/usr/local/Python-3.6.4 --with-zlib=/usr/include
make clean
make
make install
mv /usr/bin/python /usr/bin/python2.6 #根据需要来
cp /usr/bin/python2.6 /usr/bin/python2.6.bak #根据需要来
#mv /usr/bin/python2.6.bak /usr/bin/python2.6
ln -sf /usr/local/Python-3.6.4/bin/python3.6 /usr/bin/python
ln -s /usr/local/Python-3.6.4/bin/python3.6 /usr/bin/python3
export PATH="$PATH:/usr/local/Python-3.6.4/bin"
#export PATH="$PATH:/usr/local/bin/python"
/usr/local/Python-3.6.4/bin
#https://www.zhihu.com/question/54906859
python -m ensurepip
#pip is bundled with Python > 3.4
#On Unix-like systems use:
#python3.6 -m pip install [Package_to_install]
#python -m pip help install
-----------------------update 2018年3月13日------------------------------------
今天发现还有一些常用模块不能用,编译发现如下提示:下面的模块都缺少相关的依赖包而安装不了!
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_bz2 _curses _curses_panel
_dbm _gdbm _lzma
_sqlite3 _tkinter readline
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
zypper in $( zypper se python*| grep -v 源代码包 | grep -v ^i | grep python | awk '{print $2}' )
#下载地址http://www.bzip.org/downloads.html
tar -xzvf bzip2-1.0.6.tar.gz
cd bzip2-1.0.6
#为编译做准备,创建 libbz2.so 动态链接库 (这一步很重要,安装 python 的时候如果没有这一步,python 安装不上 bz2 模块)
make -f Makefile-libbz2_so
make && make install
#下载地址http://www.sqlite.org/2014/sqlite-autoconf-3080600.tar.gz
./configure --prefix=/usr/local
make && make install
#下载 readline https://ftp.gnu.org/gnu/readline/readline-7.0.tar.gz
./configure
make && make install
#下载 https://www.openssl.org/source/openssl-1.0.2n.tar.gz
./config
make && make install
#下载 tkinter https://iWEB.dl.sourceforge.net/project/tcl/Tcl/8.6.8/tk8.6.8-src.tar.gz
#下载 tkinter https://prdownloads.sourceforge.net/tcl/tcl8.6.8-src.tar.gz
#下载 tkinter http://ftp.gwdg.de/pub/opensuse/distribution/leap/42.3/repo/oss/suse/x86_64/python3-tk-3.4.6-11.1.x86_64.rpm
rpm -q tcl && rpm -q tk
cd /root/install/tcl8.6.8/unix
./configure
make && make install
#安装zypper se lzma的模块
#LZMA comes as part of the XZ open source compression library.
#https://tukaani.org/xz/xz-5.2.3.tar.gz
#find /usr /opt -name "lzma.h" -print
./configure
make && make install
rpm -ivh python3-tk-3.4.6-11.1.x86_64.rpm --nodeps
Python build finished successfully!
The necessary bits to build these optional modules were not found:
_tkinter
To find the necessary bits, look in setup.py in detect_modules() for the module's name.
Failed to build these modules:
_hashlib _ssl
先到这里了,发现Python的环境大都是contos,找SUSE的资料都找不多到,少得可怜。
--结束END--
本文标题: 在SUSE SP3上安装新的python
本文链接: https://lsjlt.com/news/192127.html(转载时请注明来源链接)
有问题或投稿请发送至: 邮箱/279061341@qq.com QQ/279061341
2024-03-01
2024-03-01
2024-03-01
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
2024-02-29
回答
回答
回答
回答
回答
回答
回答
回答
回答
回答
0