2021-07-02 10:50:57
142
0
虽然可以用各种PPA源安装,但是总是出现各种问题,还是老老实实源码安装配置!
python这玩意各种版本,每次都是烦的一米,这次是用ndoejs express感觉有点毛病,用python来验证下,
所有还得在新服务器上搞搞python环境。
话不多说,前置依赖:先装了再说。
sudo apt-get update; sudo apt-get install make build-essential libssl-dev zlib1g-dev \
libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm \
libncursesw5-dev xz-utils tk-dev libxml2-dev libxmlsec1-dev libffi-dev liblzma-dev
下载
解压.
tar zxvf Python-3.9.6.tgz Python-3.9.6/
建立本地安装目录
#建立目标安装位置
sudo mkdir -p /usr/local/python3.9
#下载解压目录
cd /usr/local/Python-3.9.6
#编译 安装
/usr/local/Python-3.9.6# ./configure --prefix=/usr/local/python3.9 --enable-optimizations
make && make install
耗时大好几分钟...
Processing /tmp/tmp5qmgrw1i/setuptools-56.0.0-py3-none-any.whl
Processing /tmp/tmp5qmgrw1i/pip-21.1.3-py3-none-any.whl
Installing collected packages: setuptools, pip
WARNING: The scripts pip3 and pip3.9 are installed in '/usr/local/python3.9/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-21.1.3 setuptools-56.0.0
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv
直接干掉/usr/bin/下的python3,pip3
然后重新指向新安装目录
rm -rf /usr/bin/python3
rm -rf /usr/bin/pip3
ln -s /usr/local/python3.9/bin/python3.9 /usr/bin/python3
ln -s /usr/local/python3.9/bin/pip3.9 /usr/bin/pip
root@cloud-qv94b8-2gzl:/usr/local/python3.9# python3 -V
Python 3.9.6
root@cloud-qv94b8-2gzl:/usr/local/python3.9# pip -V
pip 21.1.3 from /usr/local/python3.9/lib/python3.9/site-packages/pip (python 3.9)
root@cloud-qv94b8-2gzl:/usr/local/python3.9#
lsb_release 问题
sudo cp /usr/lib/python3/dist-packages/lsb_release.py /usr/local/python3.9/lib/python3.9/
venv问题
简直像捅了马蜂窝一样,∑( ° △ °|||)︴,以上仅供参考.
哎
2021-07-02 11:48:41
1
赞
赏
本文基于CC BY-NC-ND 4.0 许可协议发布,作者:野生的喵喵。 固定链接: 【ubuntu16安装python3】 转载请注明
相关文章:
发表新的评论
文章分类
文章归档
标签
deb ,
,
蓝屏 ,
select ,
html5 ,
tomcat ,
gcc ,
ajax ,
apt-get update ,
选择 ,
js加密 ,
java ,
工作 ,
ocr ,
AngularJs ,
感慨 ,
work ,
click ,
javascript ,
反向代理 ,
ip查询 ,
空间查询 ,
word ,
ECS服务器 ,
centos ,
杂 ,
StartupWMClass ,
前端 ,
js ,
vmdk ,
感概 ,
select2 ,
virtualbox ,
gg代理 ,
share ,
seo ,
风筝 ,
email ,
ASR ,
转换 ,
cool ,
activiti-ui ,
喵小凡 ,
@PropertySource ,
ckeiditor ,
网站攻击 ,
SRILM ,
风景 ,
plugin ,
vdi ,
扩容 ,
chorme ,
阿里云 ,
KALDI ,
num ,
packer2 ,
pic ,
gg镜像 ,
win8.1 ,
ecs ,
mysql ,
Ubuntu ,
快递查询 ,
nginx ,
ubuntu ,
swap ,
maven ,
entropy_avail ,
tencent ,
语音识别 ,
prerender ,
xfce4 ,
进度条 ,
存储过程 ,
activiti ,
熵 ,
日出 ,
练笔 ,
虞美人 ,
nodejs ,
词 ,
demo ,
jquery ,
random ,
linux ,
cat ,
bootstrapValidator ,
angularJs ,
live ,
on ,
gg ,
雪 ,
婚姻 ,
景色 ,
@Autowired ,
pdf ,
emqttd ,
优化 ,
thchs30 ,
opencv ,