我最近搬到 Macbook 上进行编程。它有一个非常奇怪的问题,我不知道从哪里开始调试。我已经在 Google 上进行了详尽的搜索,但找不到解决方案。
基本上,我尝试使用
env
创建一个虚拟环境python3.10
,激活它并期望拥有python3.10
,但令人惊讶的是,python3.12
是不同的可执行文件。
luanpham@Macc:~/ws/RCAEval$ python3.10 -m venv env
luanpham@Macc:~/ws/RCAEval$ . env/bin/activate
(env) luanpham@Macc:~/ws/RCAEval$ which python
/Users/luanpham/ws/RCAEval/env/bin/python
(env) luanpham@Macc:~/ws/RCAEval$ python --version
Python 3.12.3
(env) luanpham@Macc:~/ws/RCAEval$ python
Python 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:47) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> ^D
(env) luanpham@Macc:~/ws/RCAEval$ which python3.10
/Users/luanpham/ws/RCAEval/env/bin/python3.10
(env) luanpham@Macc:~/ws/RCAEval$ python
Python 3.12.3 (v3.12.3:f6650f9ad7, Apr 9 2024, 08:18:47) [Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> print(sys.executable)
/Library/Frameworks/Python.framework/Versions/3.12/bin/python3.12
如果有人能让我知道这里发生了什么,那就太好了......
该死的,我的 .bashrc 中不小心有一个
alias python=python3.12