Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 4416

Troubleshooting • Creating a Virtual Environment

$
0
0
Running a Pi5 with bookworm.
I create a virtual environment in /home/pi/.venv
with these operations

Code:

pi@pi-5-wi:~ $ cd ~pi@pi-5-wi:~ $ mkdir /home/pi/.venvpi@pi-5-wi:~ $ python3 -m venv --system-site-packages /home/pi/.venvpi@pi-5-wi:~ $ source /home/pi/.venv/bin/activate(.venv) pi@pi-5-wi:~ $ 
which works fine, but when I log out and back in again I am no longer in the venv and have to activate it again.
I can fix this by adding the line

Code:

source .venv/bin/activate
to the end of .profile but I would have thought that should happen automatically. Have I missed something?
Thanks
Mick

Statistics: Posted by micksulley — Tue Mar 19, 2024 11:02 pm — Replies 1 — Views 64



Viewing all articles
Browse latest Browse all 4416

Trending Articles