linux下绿色Python,linux下实现python多版本安装实践

5268f80b9b1e01f982625ef6fac83ca1.png

使用pythonbrew

代码如下:

easy_install pythonbrew

[root@li637-23 schirm]# pythonbrew_install

Well-done! Congratulations!

The pythonbrew is installed as:

/root/.pythonbrew

Please add the following line to the end of your ~/.bashrc

[[ -s "$HOME/.pythonbrew/etc/bashrc" ]] && source "$HOME/.pythonbrew/etc/bashrc"

After that, exit this shell, start a new one, and install some fresh

pythons:

pythonbrew install 2.7.2

pythonbrew install 3.2

For further instructions, run:

pythonbrew help

The default help messages will popup and tell you what to do!

Enjoy pythonbrew at /root/.pythonbrew!!

[root@li637-23 schirm]# vim /root/.pythonbrew

[root@li637-23 schirm]# . ~/.bashrc

[root@li637-23 schirm]# pythonbrew install 2.7.2

Downloading Python-2.7.2.tgz as /root/.pythonbrew/dists/Python-2.7.2.tgz

######################################################################## 100.0%

Extracting Python-2.7.2.tgz into /root/.pythonbrew/build/Python-2.7.2

This could take a while. You can run the following command on another shell to track the status:

tail -f "/root/.pythonbrew/log/build.log"

Installing Python-2.7.2 into /root/.pythonbrew/pythons/Python-2.7.2

怎么样小伙伴们,是不是很简单,有相同需求的小伙伴们自己参考下吧

1428d0e076c3959ab11d28a39bc84fab.png

5268f80b9b1e01f982625ef6fac83ca1.png

本条技术文章来源于互联网,如果无意侵犯您的权益请点击此处反馈版权投诉

本文系统来源:php中文网

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
回答: 在Linux安装Python,可以按照以下步骤进行操作。首先,进入Python官方网站下载所需的Python版本,比如Python-3.9.10。然后,使用命令行进入下载的Python目录,例如/usr/local/software/python/Python-3.9.10。接下来,运行命令"./configure --prefix=/usr/local/software/python/",这个命令指定了Python安装目录为/usr/local/software/python/。\[1\]接着,根据系统的不同,使用命令安装Python的依赖库,比如使用"yum install -y gcc patch libffi-devel python-devel zlib-devel bzip2-devel openssl-devel ncurses-devel sqlite-devel readline-devel tk-devel gdbm-devel db4-devel libpcap-devel xz-devel"来安装依赖库。\[2\]请注意,这些依赖库的安装需要使用root账号完成。最后,运行命令"make"和"make install"来编译和安装Python。\[3\]完成以上步骤后,您就成功在Linux安装Python。 #### 引用[.reference_title] - *1* *2* [Linux安装配置Python](https://blog.csdn.net/a13568hki/article/details/125404831)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] - *3* [Linux系统上安装python详细步骤](https://blog.csdn.net/weixin_39447365/article/details/121159894)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v91^control_2,239^v3^insert_chatgpt"}} ] [.reference_item] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值