Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cmd Windows "python" command works, but "python3" doesn't although my python version is 3.6

So I have followed a couple of posts here such as this.

So I have installed python 3.6 with Anaconda. Then I went into the PATH and I inserted the path to Python.

So now when I type into the cmd "python" I get the response

Python 3.6.3 |Anaconda custom (64-bit)| (default, Oct 15 2017, 03:27:45) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

However if I type in "python3" I get the usual problem

'python3' is not recognized as an internal or external command,
operable program or batch file.

Why is that?

like image 662
Euler_Salter Avatar asked Jan 20 '18 11:01

Euler_Salter


2 Answers

Your question may have already been answered; see this answer to: Python 3 installation on windows running from command line. Specifically:

OSX and Linux have python executable installed by default as a rule and it refers to Python 2 version in most cases at the moment that is why you need a separate python3 name there.

There is no Python on Windows by default. And therefore any version that you've installed is just python (I guess). The recommended way to manage multiple python versions is to use the Python launcher.

TL;DR: python3 is not a valid command on Windows, regardless of the distribution that it comes with (Anaconda in your case).

like image 172
trk Avatar answered Oct 18 '22 04:10

trk


Euler_Salter.

If you have installed Anaconda, I have a tip for you.

Before giving you a tip, there is background tip for you.

Python has a lot of modules and their dependency. So It provides virtual environment to isolate from dependency issues.

Anaconda also provides it.

So, You can easily find "Anaconda Prompt" in you windows system.

Here is the Short Cut Win Key -> Type "Anaconda Prompt" on Search Input

Or

You can execute it using command.

%windir%\System32\cmd.exe "/K" %UserProfile%\Anaconda3\Scripts\activate.bat 
%UserProfile%\Anaconda3

And I think that you're confused of the difference between linux and windows.

As I know, If you install python3 on Ubuntu, there is python3 binary path, or symlink for it. That is, whether or not there is python3 is not important thing.

You can just make a symlink for it.

See it. https://www.howtogeek.com/howto/16226/complete-guide-to-symbolic-links-symlinks-on-windows-or-linux/

I sincerely hope that this will help you.

like image 1
gbkim Avatar answered Oct 18 '22 04:10

gbkim