python virtual environment for Ubuntu in 1min
python environment for Ubuntu in 1 min
#devops #cloud #python #awscommunitybuilder #coding
____________________________________________
The installation of the Python package has to be performed mainly through the terminal of the operating system.
Once inside, start giving the first commands to check if Python versions 2 and 3 are up to date. Ubuntu usually comes with both versions.
$ sudo apt-get update
$ sudo apt-get -y upgrade
By running these two commands, the packages installed on your system can be checked and, if everything is correctly updated to the latest version,a response flag in the form -y is returned.
Another direct can be performed on Python 3 version. To do so, use the command:
$ python3 -V
As output, the version of Python in use on your OS will be shown.
Please note that an important package manager, very useful for managing and updating programming packages for your projects is pip,.
So, if you want, install pip :
$ sudo apt-get install -y python3-pip
Once pip is installed, depending on your needs as a developer, any useful Python package can now be installed.
To do so, just enter the following command, replacing the package_name with the name of the one you wish to install:
$ pip3 install package_name
Finally, it is important to install a series of packages to make your programming environment more consistent.
To create these environments, install a module called venv, which is present in the Python library. Then, proceed with the installation of venv with the following command:
$ sudo apt-get install -y python3-venv
To create these environments, install a module called venv, which is present in the Python library. Then, proceed with the installation of venv with the following command:
$ sudo apt-get install -y python3-venv
Now it’s time to create new virtual environments for your projects. To start, use the mkdir command to build a new directory to populate with your environments. Then, move into it with the cd command , as in the following example:
$ mkdir directory_env
$ cd directory_env
Once in the directory where to create the new environments, create the first one using the venv module . To do so, follow the command:
$ python -m venv environment1
N.B. Obviously, for both the directory and the environments to be created any name can be chosen.
Within the new directory, an additional directory will be created containing some objects, which can be viewed with the ls command .
$ ls environment1
Environment folder view
These objects will be able to make your environment work properly, isolating it from other folders on the machine and improving some efficiency features of the development and execution processes, such as compilation.
To make use of a new environment, activate it now by calling its activation script with the command:
$ source environment1/bin/activate
to deactivate the python environment
$ deactivate
____________________________________________
#python #ballpython #ballpythonsofinstagram #ballpythons #royalpython #pythonsofinstagram #pythons #pythonregius #ballpythonmorphs #montypython #ballpythonsofig #ballpythonbreeder #pythonprogramming #reticulatedpython #ballpythonmorph #pythonbag #carpetpython #burmesepython #greentreepython #pythoncode #pythonskin #royalpythonsofinstagram #royalpythons #pythonleather #ballpythonbreeding #pythonsofig #python3 #pastelballpython #ballpythonlove #bananaballpython #bloodpython #pythonbracelet #montypythonandtheholygrail #ballpythonofinstagram #gelangpython #babyballpython #piedballpython #ballpythonmorphsofinstagram #pythonbags #pythonshoes#devops #cloud #aws #programming #cloudcomputing #technology #developer #linux #python #coding #azure #software #iot #cybersecurity #kubernetes #it #css #javascript #java #devopsengineer #tech #ai #datascience #docker #softwaredeveloper #webdev #machinelearning #programmer #bigdata #security#devops #cloud #aws #programming #cloudcomputing #technology #developer #linux #python #coding #azure #software #iot #cybersecurity #kubernetes #it #css #javascript #java#ubuntu
ubuntu
😩 "Promo sm"