0

I'm using python 3.10 in vs code and i have to create a project using python 3.8 so how could i create a virtual environment with python 3.8?

i tried in the vs code command prompt python -m venv venv, it is creating the environment but i cannot find the required version of python.

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • 1
    Python 3.10 should be able to run code from Python 3.8 with minimal changes... Why do you need to downgrade? – OneCricketeer Mar 12 '23 at 14:39
  • i was creating a project watching on youtube in that he specifically uses python3.8 in vscode using conda create python ==3.8 venv – Shubham yadav Mar 12 '23 at 14:47
  • Just because the YouTube presenter is using Python 3.8 doesn't necessarily mean *you* need to as well. – chepner Mar 12 '23 at 14:50
  • i thought i will get to learn new things so that's the reason, anyway thankyou so much sir i appreciate your help and time. – Shubham yadav Mar 12 '23 at 14:54
  • Does this answer your question? [use different python version (3.8) and virtual environment in VSC workspace (sub)folder only](https://stackoverflow.com/questions/73713231/use-different-python-version-3-8-and-virtual-environment-in-vsc-workspace-sub) – Jorge Luis Mar 12 '23 at 15:06

1 Answers1

0

You need to install python 3.8 to create environments of it.

For example, use pyenv to easily manage this, and Vscode knows how to detect a pyenv setup (e.g. .python-version file in the project).

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245