0

If I try to run virtualenv, I get this message:

$ virtualenv
-bash: /Users/me/Library/Python/3.6/bin/virtualenv: No such file or directory

It's not surprising that this happens, because I've removed this directories at an earlier point when trying to clean up my computer from different Python versions. However, how does my system know to look in that directory for virtualenv? I've looked in my bash profile, and there is no mention of virtualenv there.

Sahand
  • 7,980
  • 23
  • 69
  • 137

1 Answers1

1

When you type something your command interpreter has to search the command. Of course it cannot try every possible directory on your system. Then it provides to the user a way to control that process. This is the purpose of the PATH environment variable :

$ echo $PATH

will show you the actual value which looks like dir1:dir2:...:dirn, meaning that commands where searched for in dir1, then dir2, etc. You have to remove the value /Users/me/Library/Python/3.6/bin/ from it. The best way is to edit the .bashrc or .bash_profile file to remove the permanent setting of this variable. Then reconnect.

Jean-Baptiste Yunès
  • 34,548
  • 4
  • 48
  • 69