为什么启动了错误的 Python 版本?

为什么启动了错误的 Python 版本?

看一看。当我输入 python3 时,我希望启动 python3.6。相反,我得到的是 3.5.2。我的路径或别名或其他东西有问题,但我无法发现它。我想要另一双眼睛,谢谢!

[PI]~/linorobot_ws/src/linorobot/teensy/firmware$ python3 --version
Python 3.5.2

版本错误

[PI]~/linorobot_ws/src/linorobot/teensy/firmware$ which python3
/usr/local/bin/python3

根据 shell,我得到 /usr/local/bin/python3

[PI]~/linorobot_ws/src/linorobot/teensy/firmware$ ls -la /usr/local/bin/python3
lrwxrwxrwx 1 root root 24 Feb 10 16:14 /usr/local/bin/python3 -> /usr/local/bin/python3.6

这是 python3.6 的符号链接

[PI]~/linorobot_ws/src/linorobot/teensy/firmware$ /usr/local/bin/python3.6 --version
Python 3.6.8

这确实是我想要的蟒蛇

[PI]~/linorobot_ws/src/linorobot/teensy/firmware$ echo $PATH

这是路径和别名:

/opt/ros/kinetic/bin:/home/ubuntu/bin:/home/ubuntu/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin
[PI]~/linorobot_ws/src/linorobot/teensy/firmware$ alias
alias cm='cd ~/catkin_ws && catkin_make'
alias cs='cd ~/catkin_ws/src'
alias cu='cd ~/rosutils'
alias cw='cd ~/catkin_ws'
alias eb='nano ~/.bashrc'
alias gazempty='roslaunch turtlebot3_gazebo turtlebot3_empty_world.launch'
alias gp='git pull'
alias gs='git status'
alias l='ls -CF'
alias la='ls -A'
alias ll='ls -alF'
alias restart='supervisorctl -u root -p dev@ros restart x:*'
alias sb='source ~/.bashrc'
alias settime='sudo ntpdate ntp.ubuntu.com'
alias teleop='roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch'
[PI]~/linorobot_ws/src/linorobot/teensy/firmware$

相关内容