Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Problems starting created virtualenv instance

I'm trying to use virtualenv on my development machine. I successfully created my new environment issuing virtualenv venv in /home/user/. When I try to activate it (from user location) with sudo venv/bin/activate I get venv/bin/activate: command not found.

like image 527
marcin_koss Avatar asked Oct 16 '25 11:10

marcin_koss


2 Answers

You don't run activate as a script; you need to source it in your shell, since it affects the shell itself.

It probably also doesn't make any sense to run it under sudo.

like image 137
Wooble Avatar answered Oct 18 '25 23:10

Wooble


Check that the virtualenv is actually where you think:

stat /home/user/venv/bin/activate

If it is, then you need to source the file in:

source /home/user/venv/bin/activate

If the file doesn't exist, you've created the venv in a different location.

like image 38
Josh Smeaton Avatar answered Oct 19 '25 01:10

Josh Smeaton



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!