Python virtualenv no activate
Kamal Mustafa

Kamal Mustafa @k4ml

About: Python/Django Developer at Kafkai.com, AI Writer for Generating Content, Built Exclusively for SEOs and Marketers.

Location:
Malaysia
Joined:
Aug 9, 2017

Python virtualenv no activate

Publish Date: Jan 19 '23
1 2

My workflow when starting new python project or experimenting with something:-

mkdir myproject
cd myproject
python -mvenv venv
venv/bin/pip install something
venv/bin/python
>>> import something
Enter fullscreen mode Exit fullscreen mode

Look, there's no need to do something like source venv/bin/activate to make use of your virtual environment.

Not using activate also good for documentation like in README as you don't have the two steps commands and people forgot to run the first step problem.

Have ever got into situation where you have to ask, "Have you run source venv/bin/activate?" You don't need to ask this question if you invoke the venv directly.

Of course this is just for quick experimentation. For a real project we're using poetry. And here's labzero our starter project for django.

Comments 2 total

Add comment