关注微信公众号:XRobotSpace
关注微信公众号:依法编程
操作系统: ubuntu 20.04
更新时间: 20240221
-
查看新安装系统默认python版本
xrobotspace@xrobot:~$ which python3 /usr/bin/python3 xrobotspace@xrobot:~$ python3 --version Python 3.8.10 xrobotspace@xrobot:~$ ll /usr/bin/ | grep python lrwxrwxrwx 1 root root 23 11月 22 18:22 pdb3.8 -> ../lib/python3.8/pdb.py* lrwxrwxrwx 1 root root 31 1月 29 21:39 py3versions -> ../share/python3/py3versions.py* lrwxrwxrwx 1 root root 9 1月 29 21:39 python3 -> python3.8* -rwxr-xr-x 1 root root 5465880 11月 22 18:22 python3.8* -rwxr-xr-x 1 root root 384 1月 25 2023 python3-futurize* -rwxr-xr-x 1 root root 388 1月 25 2023 python3-pasteurize*
-
安装Anaconda并激活base后查看python版本
(base) xrobotspace@xrobot:~$ python Python 3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() (base) xrobotspace@xrobot:~$ python3 Python 3.11.5 (main, Sep 11 2023, 13:54:46) [GCC 11.2.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>> exit() (base) xrobotspace@xrobot:~$ which python /home/xrobotspace/Documents/SOFTWARE/anaconda3/bin/python (base) xrobotspace@xrobot:~$ which python3 /home/xrobotspace/Documents/SOFTWARE/anaconda3/bin/python3
-
禁止conda自动激活
将
.bashrc
文件中自动激活conda的内容屏蔽后,重新查看python版本相关内容,与系统默认python版本内容相同。 -
安装ROS后,禁止conda自动激活,查看python版本
ROS使用的是系统默认的Python环境,在conda虚拟环境下无法启动ROS。