python --version, which python 都找不到,只能python3, which python3

小白学python,环境搭建笔记
摘要由CSDN通过智能技术生成

pyenv 确实local也正在应用3.9,但
python --version, which python 都找不到,
最终在 .zshrc 文件下添加了PATH,完美解决问题。

原因就是【it needs to add its shims directory to the PATH 】

具体过程如下:

➜  ~ pyenv local 3.9
➜  ~ pyenv versions
  system
  3.8.15
* 3.9.4 (set by /Users/freddie/.python-version)
  3.10.12
➜  ~ which python
python not found
➜  ~ which python3
/Library/Frameworks/Python.framework/Versions/3.11/bin/python3
➜  ~ python --version
zsh: command not found: python
➜  ~ python3 --version
Python 3.11.3

GPT给出完美解答:
The pyenv changes seem to have taken effect correctly, since pyenv versions indicates Python 3.9.4 is now the local version. However, it seems like your shell isn’t recognizing the version switch and is still pointing to the system Python 3.11.3 for the python3 command. The python command doesn’t appear to be linked to any Python interpreter at all.

This could be because your PATH environment v

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值