9

I installed virtualenv and I created a virtual environment inside my directory. Everything is OK, but I can't activate it. When I run:

source /bin/activate

it says:

already: command not found

Screenshot:

img_virtualenv

  • 1
    Hi and welcome. Please do not have pictures of text, always include the text in the body of the question so everyone can see it. The error is clear in the directory you are running the command from it does not exist. – David Mar 31 '21 at 13:23
  • but i run this command almost in every directory...it is only working in home/ directory....but not working in side a folder which is also in home – Md. Mursalatul Islam Pallob Mar 31 '21 at 14:06
  • A virtualenv only works in a specific directory. You get to specify the directory when you create the venv. This does not seem like an Ubuntu-related question. This seems like a how-do-I-use-python-venv question. There are some good examples at https://docs.python.org/3/library/venv.html. – user535733 Mar 31 '21 at 15:52

2 Answers2

13

You need to install python3-venv:

sudo apt install python3-venv

Then:

python3 -m venv vvv
source vvv/bin/activate
GAD3R
  • 3,507
0

if your virtual environment name is "venv", you can use below command to switch there:

source venv/bin/activate

enter image description here

referance : https://www.youtube.com/watch?v=2W_YE0fZs88

amit
  • 1