I'm a beginner, trying to learn by doing. I've learned a bit of Python and Django, and I'm starting a new project (recipe website!). I read that I should be using virtual environments to isolate my projects from one another. Following Corey Schafer's tutorial (https://youtu.be/N5vscPTWKOk) on virtual environments, I created a folder called Environments under my base Code folder (i.e. ~/code/Environments), then created a virtual environment called recipe_project within Environments.
Edit: I am using Ubuntu 18.04, sorry for not specifying that before.
However, I have multiple versions of Python installed, in various folders because I don't know the correct location (is there a correct location?) to install them. Currently I have Python 3.8.3 in my Environments folder, that was the folder where I happened to be when I installed Python 3.8 from the command line. I want to use Python 3.8 to develop my recipe website. Is there a way to specify that? Do I need to specify that?
Clarification: Please note that I am asking about the correct place to install Python, not the place to create my virtual environment(s).
I activated my recipe_project virtual environment, then typed in pip list
and got:
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Package Version
pip 20.1.1
pkg-resources 0.0.0
setuptools 44.1.1
wheel 0.34.2
I also tried typing in python3 -m pip list
because I read that you should be more specific when using pip. When I did that, the deprecation warning disappeared, but the package-version list reverted to the long list that appears if I'm outside my virtual environment.
So:
Is there a way to get my virtual environment to only use Python 3/use Python 3 by default? If I need to install a tool or something, please specify how to install it from the command line (such as do I need to use python3 -m, or another method) and also which folder I should be in when I install it.
In general, which folder should I be in when I install new versions of Python?
Please try to explain it as simply as possible since I am a beginner. I've already spent several hours researching this but at least half of what I read went over my head.
Thanks a lot for your patience and understanding!