0

I've installed python 3.7, but whenever I try and run a script in cmd, it says: Requested Python Version (3.7) is not installed.

Now, I start my scripts with #!/usr/bin/env python3.7, which just means that I don't have to write python3.7 in to cmd.

But, when I start my script with #!/usr/bin/env python, the script runs perfectly fine on cmd. What does this mean? Is it not running my script in Python3.7?

6
  • 1
    can you try doing #!/usr/bin/env python --version and tell me the output? Commented Oct 23, 2019 at 16:00
  • @ori6151 Python 3.7.4 is the output. Commented Oct 23, 2019 at 16:02
  • Then where is the problem? Commented Oct 23, 2019 at 16:03
  • @ori6151 When I put #!/usr/bin/env python --version at the start of my script, and then try and run the script in cmd, the output is simply Python 3.7.4, it doesn't run my script? Commented Oct 23, 2019 at 16:06
  • 1
    @MyNameIsCaleb ``` 'python3.7' is not recognized as an internal or external command, operable program or batch file.``` But, when I simply type python in to cmd, it starts Python 3.7.4 interactively, with the >>>. Commented Oct 23, 2019 at 16:10

1 Answer 1

1

#!/usr/bin/env xxx looks for the first xxx to appear in $PATH.

You have python installed to the python path and likely nothing for python3.7 which means that your script is running when you have it as python and not for python3.7 because it doesn't know what to run when it can't find python3.7 in $PATH. You could probably try python3.7.4 since that is your specific version and it might work but it all depends on how it was installed and setup.

If you wanted to make python3.7 work instead, you could look here and more information on this issue here.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.