install python 3.6
来源:互联网 发布:书画频道软件下载 编辑:程序博客网 时间:2024/06/08 16:20
I studied python many times before, but I never used it in my daily work, therefore, I want to study it and use it step by step.
Configuration: centos7.3 python 3.6.3
1. Install python //thanks to the work ENV, I can't install it by yum.
https://www.python.org/downloads/release/python-363/
2. Upload the source to the server.
3. unzip it:
tar zxvf Python-3.6.3.tgz ./Python-3.6.3
cd Python-3.6.3
./configure --prefix=/usr/local/python36 --enable-shared --with-threads
export LD_RUN_PATH=/usr/local/lib
update “#!/usr/bin/python” to “#!/usr/bin/python2”,and save.
root@xxx:/usr/bin$ ls -al python*
lrwxrwxrwx 1 root root 33 Dec 20 21:45 python -> /usr/local/python36/bin/python3.6
lrwxrwxrwx. 1 root root 9 Jun 23 14:29 python2 -> python2.7
-rwxr-xr-x. 1 root root 7136 Nov 6 2016 python2.7
lrwxrwxrwx. 1 root root 7 Jun 23 14:29 python-2.7.5 -> python2
-rwxr-xr-x 1 root root 1835 Nov 6 2016 python2.7-config
lrwxrwxrwx 1 root root 16 Jun 23 16:09 python2-config -> python2.7-config
lrwxrwxrwx 1 root root 14 Jun 23 16:09 python-config -> python2-config
6.
root@xxx:/data/sftp/mysftp/upload/Python-3.6.3$ python
Python 3.6.3 (default, Dec 20 2017, 19:40:55)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-11)] on linux
Type "help", "copyright", "credits" or "license" for more information.
Issues I met:
1.
libpython3.6m.a(sysmodule.o):在函数‘_PySys_Init’中:
/data/sftp/mysftp/upload/Python-3.6.3/./Python/sysmodule.c:1945:对‘_Py_gitversion’未定义的引用
/data/sftp/mysftp/upload/Python-3.6.3/./Python/sysmodule.c:1945:对‘_Py_gitidentifier’未定义的引用
libpython3.6m.a(getversion.o):在函数‘Py_GetVersion’中:
/data/sftp/mysftp/upload/Python-3.6.3/Python/getversion.c:12:对‘Py_GetBuildInfo’未定义的引用
collect2: 错误:ld 返回 1
make: *** [python] 错误 1
libpython3.6m.a(sysmodule.o):在函数‘_PySys_Init’中:
/data/sftp/mysftp/upload/Python-3.6.3/./Python/sysmodule.c:1945:对‘_Py_gitversion’未定义的引用
/data/sftp/mysftp/upload/Python-3.6.3/./Python/sysmodule.c:1945:对‘_Py_gitidentifier’未定义的引用
Compile with --enable-shared will solve it.
2.
Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: unknown encoding: GB2312
by export LC_ALL=en_US.UTF-8 will solve it.
3. zipimport.ZipImportError: can't decompress data; zlib not available
$tar -xvzf zlib-1.2.8.tar.gz
$cd zlib-1.2.8.tar.gz
$./configure
$make
linux-vdso.so.1 => (0x00007ffe05943000)
libpython3.6m.so.1.0 => not found
libpthread.so.0 => /lib64/libpthread.so.0 (0x00007fb9656e8000)
libdl.so.2 => /lib64/libdl.so.2 (0x00007fb9654e4000)
libutil.so.1 => /lib64/libutil.so.1 (0x00007fb9652e1000)
libz.so.1 => /lib64/libz.so.1 (0x00007fb9650ca000)
libm.so.6 => /lib64/libm.so.6 (0x00007fb964dc8000)
libc.so.6 => /lib64/libc.so.6 (0x00007fb964a07000)
/lib64/ld-linux-x86-64.so.2 (0x00007fb965910000)
- install python 3.6
- python install
- install python in linux
- [转]install Python eggs
- Install Python + Eric IDE
- install MySQLdb for python
- Install Python 2.5.5
- Python install MysqlDB
- python-multiprocessing module install
- Python install Simplejson
- python scrapy install error
- python install pyserial
- AIX 7.1 install python
- python lib install
- python install gevent
- install MySQL-python
- windows python install pygtk
- Python 3.4 install lxml
- Linux系统运维前辈给新手经验分享
- Shell命令梳理
- CustomSkinChange通过反射换肤
- 购物车需要的方法
- MyEciplse 设置jsp编辑器 ,只jsp页面的代码
- install python 3.6
- mybatis pagehelp分页 Springmvc+Mybatis+pagehelper5.1.2+bootstrap table分页和分页查询
- 键盘回车事件导致页面刷新的问题
- numpy的random模块
- Java中的数据存储(堆、栈、常量池
- android
- IntelliJ IDEA设置自动导入包
- Android (安卓)面试题 《H》
- Android 仿微信通讯录 导航分组列表-上】使用ItemDecoration为RecyclerView打造带悬停头部的分组列表