I installed python3.10 on my mac. I can see it under applications but when I type python 3– version it returns the following error.
MacBook-Air:~ User$ python3 -- v /Library/Frameworks/Python.framework/Versions/3.10/bin/python3: can't open file '/Users/User/v': [Errno 2] No such file or directory
Python2 — version returns with the default python 2.7.18 which is already installed with Mac OS.
Steps I’ve taken:
MacBook-Air:~ User$ alias idle="idle3" # to use python3 idle rather than 2.7 MacBook-Air:~ User$ alias python="python3" # to use python3 rather than python2.7
This was to map python to python 3 it worked but I still received the following error..
MacBook-Air:~ User$ python -- v /Library/Frameworks/Python.framework/Versions/3.10/bin/python3: can't open file '/Users/User/v': [Errno 2] No such file or directory
Please help!
Advertisement
Answer
The problem is with the command you’ve entered. This makes the Python interpreter think you’re trying to run a script called v
, which obviously doesn’t exist.
python3 -- v
For checking the version, you should either:
- Use one hyphen and a capital letter:
python -V
- Use two hyphens and the full word:
python --version
.
There should be no space after the hyphen.