文章详情页 您现在的位置是:网站首页>文章详情
Python3.8.0在deepin15.11的安装
Jeyrce.Lu 发表于:2019年12月16日 22:15 分类:【Python】 9145次阅读
今天在我的笔记本安装了python最新稳定版3.8.0,中间发现少了好几个底层库,在此记录一下安装解决过程。
源码编译安装
wget https://www.python.org/ftp/python/3.8.0/Python-3.8.0.tgz tar -xvzf Python-3.8.0.tar.gz cd Python-3.8.0 ./configure sudo make
make完会发现缺少一堆库
Python build finished successfully! The necessary bits to build these optional modules were not found: _bz2 _curses _curses_panel _dbm _gdbm _hashlib _lzma _sqlite3 _ssl _tkinter _uuid readline To find the necessary bits, look in setup.py in detect_modules() for the module's name. The following modules found by detect_modules() in setup.py, have been built by the Makefile instead, as configured by the Setup files: _abc atexit pwd time Failed to build these modules: _ctypes
首先解决缺少_ssl的问题,这个非常重要,很多库都会用到_ssl
sudo apt install openssl-dev vim Python-3.8.0/Modules/Setup # 搜索ssl解开以下部分注
重新./configure && make 发现_ssl已经build成功了
Python build finished successfully! The necessary bits to build these optional modules were not found: _bz2 _curses _curses_panel _dbm _gdbm _lzma _sqlite3 _tkinter _uuid readline
接下来解决_bz2
sudo apt install libbz2-dev sudo make #发现_bz2已经build成功 Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _dbm _gdbm _lzma _sqlite3 _tkinter _uuid readline
接下来解决lzma
wget https://nchc.dl.sourceforge.net/project/lzmautils/xz-5.2.3.tar.gz tar -xvzf xz-5.2.3.tar.gz ./configure sudo make &&sudo make install # python重新make发现lzma已经构建成功 Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _dbm _gdbm _sqlite3 _tkinter _uuid readline
接下来解决_sqlite3问题
wget https://www.sqlite.org/2018/sqlite-autoconf-3240000.tar.gz tar -xvzf sqlite-autoconf-3240000.tar.gz cd sqlite-autoconf-3240000 ./configure sudo make sudo make install # python 重新make发现_sqlite3已build成功 Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _dbm _gdbm _tkinter _uuid readline
接下来解决_tkinter问题
sudo apt install tk-dev python3-tk # 之后发现tk-inter Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _dbm _gdbm
现在解决_uuid问题
sudo apt install uuid-dev # python之后重新make发现uuid构建成功 Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _dbm _gdbm readline
现在解决readline问题
sudo apt install libreadline-dev # 之后重新make python 发现readline构建成功 Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel _dbm _gdbm
现在解决dbm和gdbm的问题
sudo apt install libgdbm-dev # 重新make python 发现dbm和gdbm构建成功 Python build finished successfully! The necessary bits to build these optional modules were not found: _curses _curses_panel
最后只剩下_curses和_curses_panel
sudo apt install libncurses* # 然后重新制作makefile编译安装 ./configure sudo make sudo make install
竟然都好了???哎凌晨一点了,收工睡觉
补充:
1. 解决apt-get安装中的E: Sub-process /usr/bin/dpkg returned an error code (1)问题
cd /var/lib/dpkg/ sudo mv info/ info_bak # 现将info文件夹更名 sudo mkdir info # 再新建一个新的info文件夹 sudo apt-get update # 更新 sudo apt-get -f install # 修复 sudo mv info/* info_bak/ # 执行完上一步操作后会在新的info文件夹下生成一些文件,现将这些文件全部移到info_bak文件夹下 sudo rm -rf info # 把自己新建的info文件夹删掉 sudo mv info_bak info # 把以前的info文件夹重新改回名
2. ModuleNotFoundError: No module named '_ctypes' 问题
sudo apt install libffi-dev # 重新编译安装python
版权声明 本文属于本站 原创作品,文章版权归本站及作者所有,请尊重作者的创作成果,转载、引用自觉附上本文永久地址: http://blog.lujianxin.com/x/art/s538bgptom7o
上一篇:消息队列基础篇(下)
下一篇:消息队列进阶篇(一)
猜你喜欢
文章评论区
作者名片
- 作者昵称:Jeyrce.Lu
- 原创文章:61篇
- 转载文章:3篇
- 加入本站:2046天
作者其他文章
站长推荐
友情链接
站点信息
- 运行天数:2047天
- 累计访问:164169人次
- 今日访问:0人次
- 原创文章:69篇
- 转载文章:4篇
- 微信公众号:第一时间获取更新信息