1

I have removed the path associated with python37 as well, still upon writing python on the command prompt I am given the following message.

C:\Users\Username>python
Python 3.7.6 (default, Jan  8 2020, 20:23:39) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32

Warning:
This Python interpreter is in a conda environment, but the environment has
not been activated.  Libraries may fail to load.  To activate this environment
please see https://conda.io/activation

Type "help", "copyright", "credits" or "license" for more information.
>>>
shrekh
  • 161
  • 4
  • 14
  • so what is your goal? what are you trying to do? I assume you want to use some specific version of python – basilisk Jul 19 '20 at 10:45
  • @basilisk yes I wanna know, why is python 3.7 is still being used, and how to upgrade it to 3.8 – shrekh Jul 19 '20 at 10:47
  • then just write python3.8 in your terminal and not just python – basilisk Jul 19 '20 at 10:52
  • Does this answer your question? [How to upgrade Python version to 3.7?](https://stackoverflow.com/questions/51279791/how-to-upgrade-python-version-to-3-7) – rajah9 Jul 19 '20 at 10:56

4 Answers4

3

I really don't recommend removing or adding python path or versions like what you are doing. Instead, I highly recommend using virtual environments.

In your case I think you messed up with the conda and python environment. Those are two different things and I will not recommend messing with. As you said, obviously you removed the python path and instead added the bin/ conda path, which is wrong.

If you want to start a python project, you can just create a virtual environment with the needed python version and then that specific version will be automatically used.

Now if you want to use a specific version directly in the command prompt, then you should specify the version. For example to use python 3.8 you need to write:

python3.8

in your terminal.

basilisk
  • 1,156
  • 1
  • 14
  • 34
  • I tried that as well, but was given the following error ```'python3.8' is not recognized as an internal or external command, operable program or batch file.``` – shrekh Jul 19 '20 at 10:55
  • apparently you need to install python3.8 first. I don't know which OS you are using, therefore you need to search and install python3.8, then you can type python3.8 in your terminal – basilisk Jul 19 '20 at 10:57
  • i have python 3.8 installed, even the IDLE version is 3.8, but when accessed with command prompt, it shows 3.7. I have windows 10 – shrekh Jul 19 '20 at 11:02
  • @shrekh what happen if you type py-3 or maybe py-38 or py38 in your terminal ? – basilisk Jul 19 '20 at 11:04
  • ```'py-3' is not recognized as an internal or external command, operable program or batch file.``` – shrekh Jul 19 '20 at 11:05
  • can you try and create a virtual environment with python3.8 ? does it work or showing an error? – basilisk Jul 19 '20 at 11:07
  • I opened my project in pycharm, it was using 3.8 version itself so for now I think I'll be using that only. Thanks for the help tho :) – shrekh Jul 19 '20 at 11:11
  • @shrekh You need to be careful though. I think you removed the python path and instead added the conda path, which are different things. – basilisk Jul 19 '20 at 11:15
  • @shrekh simply inspect if you have a conda bin path in your windows path. Remove it and add your python3 path. Don't forget to upvote the answer or close the question if it helped you. – basilisk Jul 19 '20 at 11:25
0

If you installed 3.8 with the default installer, you should be able to run it with the py launcher. py -0 will show you which Python versions the launcher knows about, and py -3.8 will launch 3.8 in case it's not the default.

Jasmijn
  • 9,370
  • 2
  • 29
  • 43
0

I have installed Anaconda 2020.07 version. It installed python 3.8.5 version. When I ran command python --version on CMD or Anaconda CMD, it shows 3.8.5 version. I have installed python 3.9.0 version manually and run py --version command, it show 3.9.0 version installed. So now you understood which command to use and when to use. Still I strongly recommend to use virtual environment for your project.

Shrirang
  • 1,286
  • 10
  • 23
0

check your path, in cmd: echo %PATH%

if you see some older version edit it inEnvironment Variables:

In the System Properties window, go to the Advanced tab. Click on the Environment Variables... button near the bottom.

Alberto Perez
  • 1,019
  • 15
  • 17