362
you are viewing a single comment's thread
view the rest of the comments
[-] infeeeee@lemm.ee 14 points 2 years ago* (last edited 2 years ago)

My workflow:

cd project
python -m venv .venv
. ./.venv/bin/activate
pip install -e .

By default pyvenv excludes system packages, so I can have different versions in the venv. To reset the venv, I just have to delete the .venv dir.

[-] OsamaBinLogin@lemmy.fmhy.ml 1 points 2 years ago

Seconded, after being burned repeatedly I always do this. But why are you calling activate from the directory above?

[-] solidsnail@programming.dev 4 points 2 years ago

I don't think he does. If you're talking about the third line, there's a space between the dots.

The dot command is equivalent to source (running the script in the context of the current shell).

[-] HorseFD@lemmy.buzz 1 points 2 years ago

Exactly, venv solves this issues for me

this post was submitted on 29 Jun 2023
362 points (98.1% liked)

Programmer Humor

31683 readers
1799 users here now

Welcome to Programmer Humor!

This is a place where you can post jokes, memes, humor, etc. related to programming!

For sharing awful code theres also Programming Horror.

Rules

founded 3 years ago
MODERATORS