Windows check python installed

How to check python anaconda version installed on Windows 10 PC?

I have a Windows 10 PC with python anaconda installed. The latest anaconda version is v5.0.1

I would like to find out whether the PC has the latest version v5.0.1 installed and whether it is 32-bit/64bit or python 2.7/3.6. How do I do that?

3 Answers 3

On the anaconda prompt, do a

  • conda -V or conda —version to get the conda version.
  • python -V or python —version to get the python version.
  • conda list anaconda$ to get the Anaconda version.
  • conda list to get the Name, Version, Build & Channel details of all the packages installed (in the current environment).
  • conda info to get all the current environment details.
  • conda info —envs To see a list of all your environments

Detailed description here, download cheat sheet from here

The folder containing your Anaconda installation contains a subfolder called conda-meta with json files for all installed packages, including one for Anaconda itself. Look for anaconda- — .json .

My file is called anaconda-5.0.1-py27hdb50712_1.json , and at the bottom is more info about the version:

(Slightly edited for brevity.)

The output from conda -V is the conda version.

How can I check all the installed Python versions on Windows?

Please note I’m not asking «how to check which version of Python did I install».

I’ve installed several versions of Pythons on my Windows computer, for example Python 2.7-64, Python 2.7-32, and Python 3.7-32.

Python 3 includes «py» and «pyw» which helps me to easily start different Pythons, for example:

  • «py -2.7» starts Python 2.7-64
  • «py -2.7-32» starts Python 2.7-32
  • «py -3.7-32» starts Python 3.7-32

What I’m wondering is, how to check how many different versions of Python did I install on my Windows PC and what versions are they?

PyCharm is able to find it but, for one thing, I don’t know if it is a complete list, and for another, I wonder if there is any tool provided by Python or the operating system can do it.

Читайте также:  Hover dark aero theme для windows 10

2 Answers 2

I just got the answer. By typing «py -h» or «py —help» I got the help message:

Which tells me that «-0» (zero, not letter «O») lists the available pythons:

While «-0p» lists not only the versions, but also the paths:

If py -0p doesn’t work for you:

Solution

PowerShell: C:\> dir site.py -s -ErrorAction SilentlyContinue CMD: C:\>dir site.py /s

Citation

I found this workaround on Webucator and made some small adjustments for powershell.

Explanation

dir with the s parameter «lists every occurrence of the specified file name within the specified directory and all subdirectories» (Microsoft Docs).

How to Check Python Version in Linux, Mac, & Windows

PHP Code

  1. Home
  2. SysAdmin
  3. How to Check Python Version in Linux, Mac, & Windows

Which version of Python do I have installed?

Python is a popular programming language. Like many other programming languages, there can be several different versions organized by release date. Certain applications may require a specific version of Python.

In this tutorial, learn how to check the Python version on Windows, Linux, or macOS systems.

High-Performance Dedicated Servers Starting at Only $ 199 $90.00/mo

Access to a command-line/terminal window:

  • Linux: Ctrl-Alt-T, Ctrl-Alt-F2
  • Windows: Win+R > type powershell > Enter/OK
  • MacOS: Finder > Applications > Utilities > Terminal

There are different versions of Python, but the two most popular ones are Python 2.7.x and Python 3.7.x. The x stands for the revision level and could change as new releases come out.

When looking at the version number, there are usually three digits to read:

  1. the major version
  2. the minor version
  3. the micro version

While major releases are not fully compatible, minor releases generally are. Version 3.6.1 should be compatible with 3.7.1 for example. The final digit signifies the latest patches and updates.

Python 2.7 and 3.7 are different applications. Software that’s written in one version often will not work correctly in another version. When using Python, it is essential to know which version an application requires, and which version you have.

Python 2 will stop publishing security updates and patches after 2020. They extended the deadline because of the large number of developers using Python 2.7. Python 3 includes a 2 to 3 utility that helps translate Python 2 code into Python 3.

How can I find where Python is installed on Windows?

I want to find out my Python installation path on Windows. For example:

How can I find where Python is installed?

Читайте также:  Iconphile для windows 10 как

18 Answers 18

In your Python interpreter, type the following commands:

Also, you can club all these and use a single line command. Open cmd and enter following command

If you have Python in your environment variable then you can use the following command in cmd:

or for Unix enviroment

command line image :

It would be either of

  • C:\Python36
  • C:\Users\(Your logged in User)\AppData\Local\Programs\Python\Python36

If you need to know the installed path under Windows without starting the python interpreter, have a look in the Windows registry.

Each installed Python version will have a registry key in either:

In 64-bit Windows, it will be under the Wow6432Node key:

On my windows installation, I get these results:

(You can also look in sys.path for reasonable locations.)

or try using (in cmd )

In the sys package, you can find a lot of useful information about your installation:

I’m not sure what this will give on your Windows system, but on my Mac executable points to the Python binary and exec_prefix to the installation root.

You could also try this for inspecting your sys module:

If you have the py command installed, which you likely do, then just use the —list-paths argument to the command:

Installed Pythons found by py Launcher for Windows
-3.8-32 C:\Users\cscott\AppData\Local\Programs\Python\Python38-32\python.exe *
-2.7-64 C:\Python27\python.exe

The * indicates the currently active version for scripts executed using the py command.

If You want the Path After successful installation then first open you CMD and type python or python -i

It Will Open interactive shell for You and Then type

Hit enter and you will get path where your python is installed .

To know where Python is installed you can execute where python in your cmd.exe.

You can search for the «environmental variable for you account». If you have added the Python in the path, it’ll show as «path» in your environmental variable account.

but almost always you will find it in «C:\Users\%User_name%\AppData\Local\Programs\Python\Python_version«

the ‘AppData‘ folder may be hidden, make it visible from the view section of toolbar.

If anyone needs to do this in C# I’m using the following code:

Go to C:\Users\USER\AppData\Local\Programs\Python\Python36 if it is not there then open console by windows+^R Then type cmd and hit enter type python if installed in your local file it will show you its version from there type the following import os import sys os.path.dirname(sys.executable)

This worked for me: C:\Users\Your_user_name\AppData\Local\Programs\Python

Читайте также:  Не открывается панель громкости windows 10

My currently installed python version is 3.7.0

Hope this helps!

if you still stuck or you get this

simply do this replace 2 \ with one

I installed 2 and 3 and had the same problem finding 3. Fortunately, typing path at the windows path let me find where I had installed it. The path was an option when I installed Python which I just forgot. If you didn’t select setting the path when you installed Python 3 that probably won’t work — unless you manually updated the path when you installed it. In my case it was at c:\Program Files\Python37\python.exe

If you use anaconda navigator on windows, you can go too enviornments and scroll over the enviornments, the root enviorment will indicate where it is installed. It can help if you want to use this enviorment when you need to connect this to other applications, where you want to integrate some python code.

Not the answer you’re looking for? Browse other questions tagged python windows path or ask your own question.

Linked

Hot Network Questions

Subscribe to RSS

To subscribe to this RSS feed, copy and paste this URL into your RSS reader.

site design / logo © 2021 Stack Exchange Inc; user contributions licensed under cc by-sa. rev 2021.4.16.39093

By clicking “Accept all cookies”, you agree Stack Exchange can store cookies on your device and disclose information in accordance with our Cookie Policy.

Which version of Python do I have installed?

I have to run a Python script on a Windows server. How can I know which version of Python I have, and does it even really matter?

I was thinking of updating to the latest version of Python.

23 Answers 23

—version may also work (introduced in version 2.5)

In a Python IDE, just copy and paste in the following code and run it (the version will come up in the output area):

At a command prompt type:

Or if you have pyenv:

Although the question is «which version am I using?», this may not actually be everything you need to know. You may have other versions installed and this can cause problems, particularly when installing additional modules. This is my rough-and-ready approach to finding out what versions are installed:

The output for a single Python installation should look something like this:

Multiple installations will have output something like this:

When I open Python (command line) the first thing it tells me is the version.

Оцените статью