Kali环境下安装Python3.7
目前面临的问题,在kali操作系统中默认安装了python2和python3,但是pip命令所安装的库都在python2里面,无法引入python3
这就导致使用python3 代码引用第三方库存在问题,故通过源码安装python3.7来解决问题。
首先下载python3.7
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
解压并新建安装python环境的目录
tar -zxvf Python-3.7.0.tgz 编译之前,安装一些所要依赖的包 apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev 假如报错了,就删除对应的lock rm /var/cache/apt/archives/lock
编译安装
./configure --enable-optimizations --prefix=/usr/local/Python-3.7/ && make && make install
建立软连接
ln -s -b /usr/local/python3.7/bin/python3.7 /usr/bin/python ln -s -b /usr/local/python3.7/bin/pip3 /usr/bin/pip3
目前面临的问题,在kali操作系统中默认安装了python2和python3,但是pip命令所安装的库都在python2里面,无法引入python3
这就导致使用python3 代码引用第三方库存在问题,故通过源码安装python3.7来解决问题。
首先下载python3.7
wget https://www.python.org/ftp/python/3.7.0/Python-3.7.0.tgz
解压并新建安装python环境的目录
tar -zxvf Python-3.7.0.tgz 编译之前,安装一些所要依赖的包 apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev 假如报错了,就删除对应的lock rm /var/cache/apt/archives/lock
编译安装
./configure --enable-optimizations --prefix=/usr/local/Python-3.7/ && make && make install
建立软连接
ln -s -b /usr/local/python3.7/bin/python3.7 /usr/bin/python ln -s -b /usr/local/python3.7/bin/pip3 /usr/bin/pip3
作者:小浪崇礼
链接:https://www.jianshu.com/p/8b86376a91a0
来源:简书
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。
相关推荐
YENCSDN 2020-11-17
lsjweiyi 2020-11-17
houmenghu 2020-11-17
Erick 2020-11-17
HeyShHeyou 2020-11-17
以梦为马不负韶华 2020-10-20
lhtzbj 2020-11-17
夜斗不是神 2020-11-17
pythonjw 2020-11-17
dingwun 2020-11-16
lhxxhl 2020-11-16
坚持是一种品质 2020-11-16
染血白衣 2020-11-16
huavhuahua 2020-11-20
meylovezn 2020-11-20
逍遥友 2020-11-20
weiiron 2020-11-16