SSL and Tkinter not present on source build of Python 3.5.2, Debian Linux

余生长醉 提交于 2019-12-06 04:26:16
PADYMKO

Since Python (properly name is CPython, because exists also Cython, Jython, PyPy and so), you need build all dependencies for it.

$ sudo apt-get update

# Required dependencies
$ sudo apt-get install build-essential

# Optional dependencies
$ sudo apt-get install libbz2-dev libgdbm-dev libsqlite3-dev libreadline6-dev libncurses5-dev libssl-dev zlib1g-dev liblzma-dev tk-dev

After install the Python3.5 from source, try import modules with "C-dependencies" (if no errors, well then Python3.5 installed with full-features)

$python3
Python 3.5.2 (default, Dec 27 2016, 17:04:10) 
[GCC 4.9.2] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>> import tkinter
>>> import ssl

Debian 8 has by default Python2.7 and Python3.4. So after install Python you will be have three version Python.

$ python -c "import sys; print('Installed python %s' % sys.version[:6])" ; python3.4 -c "import sys; print('Installed python %s' % sys.version[:6])" ; python3.5 -c "import sys; print('Installed python %s' % sys.version[:6])" 
Installed python 2.7.9 
Installed python 3.4.2 
Installed python 3.5.2

In the Debian 9, Python 3.5 will be as default version Python3 https://packages.debian.org/search?keywords=python3.5.

Useful links:

  1. https://askubuntu.com/questions/21547/what-are-the-packages-libraries-i-should-install-before-compiling-python-from-so

  2. ImportError: No module named _ssl

  3. http://bugs.python.org/issue12876

  4. http://www.simplydjango.com/python-on-ubuntu/

Testing environment

$ uname -a
Linux localhost 3.16.0-4-amd64 #1 SMP Debian 3.16.36-1+deb8u2 (2016-10-19) x86_64 GNU/Linux
$ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description:    Debian GNU/Linux 8.6 (jessie)
Release:    8.6
Codename:   jessie
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!