Posts
read more
Creating a Python requirements.txt File
This can be done quickly by typing:
$ pip freeze >requirements.txt
at the command line.
To install packages using a requirements file just use pip:
$ pip install -r requirements.txt
To check if the packages in your requirements.txt file are up-to-date use:
$ pip list --outdated
and to update those packages:
$ pip install -U <packagename>
Posts
read more
Python: Initializing a New Project using venv
Start out by creating a new directory or cloning a repository (which creates a directory) and cd into it:
$ git clone https://gitlab.com/username/proj-name$ cd proj-name/
Initialize the virtual environment:
$ python3 -m venv venv$ source venv/bin/activate
Install whatever dependencies you need:
$ pip install package1 package2
Then develop and/or run your program: