I have Python 3.10 (64-bit)
on my computer. And I use VS Code
. I need to install Python 3.8 (64-bit)
because I need to work with curses
and it only works with Python 3.8
.
Asked
Active
Viewed 149 times
-1

saloua
- 2,433
- 4
- 27
- 37

Thevindu Senanayake
- 59
- 11
2 Answers
0
Virtual environments are used for that. I use miniconda to manage my python versions.
After installing it, you can simply create an environment with python 3.8 like this:
conda create -n python38 python=3.8
Afterwards you can activate the create environment like this
conda activate python38
And install a wide variety of packages like so:
conda install matplotlib pandas numpy

nhaus
- 786
- 3
- 13
-
can you tell more about it – Thevindu Senanayake Nov 11 '21 at 14:21
-
I edited my answer. Which IDE do you use to run python? If you use PyCharm (which I can recommend) you can simply pick which python environment you want to use for your project. – nhaus Nov 11 '21 at 14:23
-
I use vs code as my main text editor – Thevindu Senanayake Nov 11 '21 at 15:07
0
For that, you can use virtual environments for example using Conda.
- Create a virtual environment for python 3.8. In the project folder run the following command
conda create --name "your-desired-environment-name" python="python-version"
e.g. to create a virtual environment for Python 3.8, run
conda create --name env_python3.8 python=3.8
- Activate the created environment
conda activate env_python3.8
Then, in visual studio Code, you can easily switch from a virtual environment to another. That depends on the project that you are working on.
The following How-to guide from VS Code can also be helpful.

saloua
- 2,433
- 4
- 27
- 37