Showing posts with label environment. Show all posts
Showing posts with label environment. Show all posts

09 May 2024

How to create a virtual environment with preinstalled packages as in requirements.txt

https://stackoverflow.com/questions/41427500/creating-a-virtualenv-with-preinstalled-packages-as-in-requirements-txt

$ git clone <repo>

$ cd <repo>

$ sudo apt install python3-venv (if you don't already have virtualenv installed)

$ python3 -m venv venv/ to create your new environment (called 'venv/' here)

$ source venv/bin/activate to enter the virtual environment

$ pip install -r requirements.txt to install the requirements in the current environment

26 June 2021

On Windows, How to Install, Create and Activate a Python Virtual Environment (Project) for Django? mkvirtualenv is not recognized as an internal or external command, operable program or batch file

 (For Windows)

How to Install, Create and Activate a Python Virtual Environment (Project) for Django? 

mkvirtualenv is not recognized as an internal or external command, operable program or batch file


https://stackoverflow.com/questions/56778211/error-message-mkvirtualenv-is-not-recognized-as-an-internal-or-external-command


For Python 3.3 or newer, Commands for installing, creating and activate virtual environment has been changed.

You can install virtual environment using pip:

py -m pip install --user virtualenv

For creating new environment:

py -m venv myproject

To activate your virtual environment:

.\myproject\Scripts\activate

After activating virtual environment, You’ll see “(myproject)” next to the command prompt.