Skip to content

bharat1234567/LearnPython

Repository files navigation

Popular Python runtimes

CPython Jython IronPython PyPy

  • computers come with multiple versions of standard CPython pre-installed.

Check python version:

$python --version

Python3 verison:

python3 --version

Creating virtual environment:

python3 -m venv myenv
  • here myenv is the name of virtual environment, we can give any name.

  • Then activate the virtual environment

source myenv/bin/activate

#After this command, virtual env should start reflecting in 
#terminal like this

# (myenv) at the leftmost corner
  • Deactivating a virtual environment:
deactivate

Install requirements in virtual environment using pip

  • before this upgrade pip using following command:
pip install --upgrade pip
  • After this install requirements from requirements.txt file:
  • make sure your virtual env is activated.
pip install -r requirements.txt
  • here -r is for recursive.

Once requirements are installed, we are good to go.

Creating requirements.txt file

  • on the go if we change requirements or add new dependencies we need to keep modifying this file.

  • we can generate this file from venv directly using following command:

pip freeze > requirements.txt
  • make sure venv is active so that dependencies are being picked from there only rather than global python packages.

About

learn how to write python scripts

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages