Showing python 2.7.12 for python 3.9.1 on Command window? - python-3.x

I am using python 3.9.1 on my computer and when I try this command on cmommand windows : python -- version , I come up with 2.7.12 !!! And it does not show the version correct.
I uninstalled python and removed all the related files on C drive as well as environmental Variables...
Now I don't have python but it still shows the version 2.7.12 when I ask for Command windows!!!
Does anyone know what is the problem ????

if you have both versions then you should write python2 --version o

Go to my computer, right click and then properties. Here go to Advanced System setting
and at the bottom of the window open Environment Variables and check any variable having python on it. if there are two variable maybes this is the problem.
Also go to the app data on your windows and check files if there is a file related to the older version of python.
Good Luck.

You can use PowerShell instead of cmd as well try this one after checking the variables.

Related

Visual Code gives error that it cannot find Python on Mac Pro

I'm running a Mac Pro 2021 model version 12.6. For some reason, my vscode will not run Python anymore when I tried using a program. I switched over to the cloud-based version for a while and now switched back to the application. It says that it could not find Python in my files. I believe both VSCode and my Mac are updated up to date. I installed python 3.11.0 for Mac, but no progress. I also tried running the update shell.command and the certificate commands as a part of the download in the vscode terminal, but it did not help. I also reinstalled the Python
v2022.16.1 Vscode extension and restarted the program. I still get the same error.
Explained above.
Have you tried Shift + Command + P type "Python: Select interpreter" yet?
Usually, all installed Python interpreters show up here, and you can also enter a path to a Python interpreter on your system.

Manage two different versions of Python

In my system Python 3.8 version already install, but I want create virtual env for version 3.7 on vscode so how can I do>
To work on different environments, you can use Anaconda Prompt.
You can follow the steps given in this: https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html

Visual Studio Code with Python for Windows AND Anaconda

I'm trying to use Visual Studio Code with both Anaconda and Python for Windows.
I have both installed, and I have the visual studio code extensions for both.
But no matter what I do now the Conda Base gets activated -
(base) PS C:\Users
even though the Python for Windows is the selected version
or if I try to activate an environment I get a mix of both, the venv with python for windows and the conda base activated.
(venv_iocparser) (base) PS C:\Users\
The settings.json file in this folder only has python for windows in the 'python.pythonPath'; with no mention of conda, but still activates the conda base.
Does anyone know a good article that walks through setting VSCode up with both? With python for windows as the default?
Thank you!
Had a similar issue. Its most likely since you installed VS Code with Anaconda, for some reason or another it just assumes thats what env you want when starting it.
To get out of it just run $ conda deactivate and then activate whatever env you want after that. I fixed it by changing the PATH for the python to only point at the non-conda versions though. I also had uninstalled it all and reinstalled it all at one point though.

Error installing Pygame / Python 3.4.1

I'm trying to install Pygame and it returns me the following error "Python version 3.4 required which was not found in the registry". However I already have the Python 3.4.1 installed on my system. Does anyone know how to solve that problem?
I've been using Windows 8.1
Thanks in advance.
Are you using a 64-bit operating system? Try using the 32-bit installer.
Tips I can provide:
Add Python to your Path file in the Advanced settings of your Environmental Variables (just search for it in the control panel)
Something may have gone wrong with the download of Python, so re-install it. Also don't download the 64-bit version, just download the 32-bit version from the main pygame website
Once that's sorted out, transfer the entire Pygame file to the site packages in the Python directory and open up the pygame file and go to this directory in command prompt. Finally, run the Pygame setup from the command prompt which should be something like:
python setup.py
But this will only work if the pygame setup file is called setup.py (it's been a while since I downloaded it), you added Python to the Path file and you're currently in the correct directory in command prompt.
To test if it worked try importing pygame and see if you got an error or not.

How to set Python IDLE to use certain python version

I am using Windows 8.
Python version 2.7.3 have been installed on my computer together with another software.
Now I have installed python 3.3.5 and i want to use this version from now.
But everytime I run Python IDLE it runs version 2.7.3.
Even if I go to C:\Python33\Lib\idlelib\idle.pyw and run idle.pyw it runs with the 2.7.3 version.
I thought that every python version install its own IDLE so I am quiet confused here.
When I run Hello world program from the console it runs using the version 3.3.5 I have checked that.
So what I need to do is to run IDLE using 3.3.5 version
Anybody knows what to do?
Each installation of Python comes with its own respective version if IDLE. I suggest you explore your Python installation folder, and find the version of IDLE you're looking for and create a shortcut to it, or add it to your environment variable list, so you can invoke a specific version from the command line.

Resources