本文由腾讯云+社区自动同步,原文地址 https://cloud.tencent.com/developer/article/1540872
不管用的是MS还是Linux,碰到python最头疼的就是各种不同的python版本。一般会出现以下几种情况:
使用conda创建各种不同的python环境
1.创建环境
1conda create -n env_name python=2.7
2.激活环境
1conda activate env_name
3.退出环境
1conda deactivate
4.显示当前系统下的环境
1conda info -e
5.添加国内镜像
1conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --set show_channel_urls yes
如果只是安装基本的python, 安装好之后通过pip安装必备的包,这时候需要把pip的源换为国内的,请移步 http://blog.stackoverflow.club/change-pip-repo-url/
列出已经安装的包
1conda list
or
conda list -n env_name
Reference:
扫码关注腾讯云开发者
领取腾讯云代金券
Copyright © 2013 - 2025 Tencent Cloud. All Rights Reserved. 腾讯云 版权所有
深圳市腾讯计算机系统有限公司 ICP备案/许可证号:粤B2-20090059 深公网安备号 44030502008569
腾讯云计算(北京)有限责任公司 京ICP证150476号 | 京ICP备11018762号 | 京公网安备号11010802020287
Copyright © 2013 - 2025 Tencent Cloud.
All Rights Reserved. 腾讯云 版权所有