-1

I installed virtual environment using (pip3 install virtualenv). it was installed but when I check. This comes up.

faculty@Facultys-MacBook-Pro ~ % virtualenv --version   
zsh: command not found: virtualenv
Peter Csala
  • 17,736
  • 16
  • 35
  • 75
  • You need to know exactly what directory yo have installed it in and you can run it from inside the directoty – huzzzus Sep 08 '21 at 09:19
  • in the director you will see venv folder. navigate to venv/bin and then activate – huzzzus Sep 08 '21 at 09:21
  • what do you see when you run `which virtualenv`? also if you find out a result from this command, what do you see in your 'PATH' variable? may be the bin location for virtualenv is not in your PATH, then you may have to add it manually. – Tuhin Sep 08 '21 at 09:43
  • Its giving virtualenv not found.How do I add it manually? – Penjor Ghaley Sep 08 '21 at 11:36
  • Please clarify your specific problem or provide additional details to highlight exactly what you need. As it's currently written, it's hard to tell exactly what you're asking. – Community Sep 13 '21 at 13:57

2 Answers2

2

I believe you might not have you python libs in your path. which is why it is not found by zsh.

Quick fix

I believe you can go with:

python3 -m virtualenv <name of the virtual env>

This should hopefully work and create your virtualenv in the current folder you are in.

Permanent fix

Some smarter people already went through this issue have a look pip installs packages successfully, but executables not found from command line

Paulo
  • 8,690
  • 5
  • 20
  • 34
  • I was able to create the virtualenv like you suggested..but when I do (which virtualenv), it stills show virtualenv not found – Penjor Ghaley Sep 08 '21 at 11:49
  • Indeed, you need to look into the permanent fix. Quick fix only allows you to successfully create the env. – Paulo Sep 08 '21 at 12:23
-1

You need to make sure the following thing:

virtualenv has been only installed in the folder you used to run the pip commmand. There should be a new directory called venv now. Try opening the terminal inside the venv folder bin and type the command again.

AXOME
  • 176
  • 1
  • 9