如何在Anaconda的python和系统自带的python之间切换一般ubuntu下有三种python环境,1. 系统自带python2,3;在/usr/bin路径下;2. anaconda下安装的python;3. anaconda下创建的env环境dsp@dsp-System-Product-Name:~/c...
-
如何在Anaconda的python和系统自带的python之间切换
一般ubuntu下有三种python环境,1. 系统自带python2,3;在/usr/bin路径下;2. anaconda下安装的python;3. anaconda下创建的env环境
dsp@dsp-System-Product-Name:~/caffe-ssd$ whereis python python: /usr/bin/python3.6m /usr/bin/python2.7-config /usr/bin/python2.7 /usr/bin/python3.6 /usr/bin/python3.6m-config
/usr/bin/python /usr/bin/python3.6-config /usr/lib/python3.7 /usr/lib/python2.7 /usr/lib/python3.6 /etc/python2.7
/etc/python3.6 /etc/python /usr/local/lib/python2.7 /usr/local/lib/python3.6 /usr/include/python3.6m /usr/include/python2.7
/usr/include/python3.6 /usr/share/python /home/dsp/anaconda3/bin/python3.6m /home/dsp/anaconda3/bin/python3.6
/home/dsp/anaconda3/bin/python3.6m-config /home/dsp/anaconda3/bin/python /home/dsp/anaconda3/bin/python3.6-config
/usr/share/man/man1/python.1.gz
dsp@dsp-System-Product-Name:~/caffe-ssd$ python Python 3.6.5 |Anaconda, Inc.| (default, Apr 29 2018, 16:14:56) [GCC 7.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() dsp@dsp-System-Product-Name:~/caffe-ssd$ activate py3.5 bash: /home/dsp/anaconda3/bin/activate: 权限不够 dsp@dsp-System-Product-Name:~/caffe-ssd$ source activate py3.5 (py3.5) dsp@dsp-System-Product-Name:~/caffe-ssd$ python Python 3.5.6 |Anaconda, Inc.| (default, Aug 26 2018, 21:41:56) [GCC 7.3.0] on linux Type "help", "copyright", "credits" or "license" for more information.
-当我们将:/home/dsp/anaconda3/bin添加到环境变量中时,用python命令得到时anaconda下的python环境;
然后如果时env环境,直接进入创建的虚拟环境即可;
dsp@dsp-System-Product-Name:~/caffe-ssd$ echo $PATH
/home/dsp/pycharm-community-2017.3.3/bin:/home/dsp/anaconda3/bin:/usr/local/cuda-9.0/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
- 如果时系统自带的环境,python2,3切换: linux下切换python2和python3
- 或者,待验证
python2切换到python3: echo alias python=python3 >> ~/.bashrc source ~/.bashrc python3切换到python2:gedit ~/.bashrc # alias python=python3 source ~/.bashrc
本文标题为:ubuntu 下python环境的切换使用
基础教程推荐
- Python 中 Elias Delta 编码详情 2023-08-08
- CentOS 7.5 安装 Python3.7 2023-09-03
- Centos7下安装python环境 2023-09-04
- Python爬取当网书籍数据并数据可视化展示 2023-08-11
- 基于Python实现股票数据分析的可视化 2023-08-04
- python的环境conda简介 2022-10-20
- centos系统 anaconda3(python3)安装pygrib 2023-09-04
- ubuntu 18 python3.6 的安装与 python2的版本切换 2023-09-03
- Python基础学习之函数和代码复用详解 2022-09-02
- 四步教你学会打包一个新的Python模块 2022-10-20