Suppose you want to develop more than one python project in your system. Suppose project-1 depending on python3.9 and project-2 depending on python3.10 version. In this situation we need to create virtual environment.
If you create virtual environment then you can easily manage dependencies in your python projects.
Suppose in your Ubuntu operating system python3.10 version already installed but you want to use python3.12 version for your project. First install the python3.12 version in Ubuntu.
Second, create the directory for your project and go to the directory by Ubuntu terminal
Run the command to create virtual environment
$ python3.12 -m venv virtual-directory-name
Activate the python virtual environment in the Ubuntu.
Command:
$ source env/bin/activate
env is the python virtual environment directory. (env) before the command you will see automatically after virtual environment is activated.
Command:
(virtual-directory) comsysapp:~$ python --version
Or
(virtual-directory) comsysapp:~$ python3 --version
Or
(virtual-directory) comsysapp:~$ python3.12 --version
Python version will be python3.12
Comsysapp.com is an educational website. Students and software developers can learn programming language tutorials. Comsysapp is very useful for beginners and professional developers. Comsysapp provides tutorial in easy language. Comsysapp.com has focus on simplicity.
Comsysapp.com provides free tutorials like c, html, css, etc. All tutorials are free for beginner and professionals.
comsysapp.com is not responsible for any mistake. We are not responsible if information made available on our website is incomplete or invalid. But comsysapp.com always try for zero-zero mistake.
comsysapp.com does not collect any data from users. We use Google AdSense advertising on our website. We never ask personal or private information.
copyright © 2023