0

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!

Dunes
  • 37,291
  • 7
  • 81
  • 97
user18233539
  • 129
  • 1
  • 2
  • 8

1 Answers1

1

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:

  1. Use one hyphen and a capital letter: python -V
  2. Use two hyphens and the full word: python --version.

There should be no space after the hyphen.

eccentricOrange
  • 876
  • 5
  • 18
  • Thank you so much! such a simple thing!! Really appreciate it! I saw a youtube video which said to use python --v – user18233539 Feb 23 '22 at 13:22
  • @user18233539 Cool! These are in fact common conventions in command lines. Read more: [relevant stackexchange post](https://softwareengineering.stackexchange.com/questions/307467/what-are-good-habits-for-designing-command-line-arguments), [GNU website](https://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html) – eccentricOrange Feb 23 '22 at 13:25