bash: mkvirtualenv: command not found

后端 未结 11 1463
天命终不由人
天命终不由人 2020-12-02 06:15

After following the instructions on Doug Hellman\'s virtualenvwrapper post, I still could not fire up a test environment.

[mpenning@tsunami ~]$ mkvirtualenv          


        
11条回答
  •  挽巷
    挽巷 (楼主)
    2020-12-02 06:48

    Try:

    source `which virtualenvwrapper.sh`
    

    The backticks are command substitution - they take whatever the program prints out and put it in the expression. In this case "which" checks the $PATH to find virtualenvwrapper.sh and outputs the path to it. The script is then read by the shell via 'source'.

    If you want this to happen every time you restart your shell, it's probably better to grab the output from the "which" command first, and then put the "source" line in your shell, something like this:

    echo "source /path/to/virtualenvwrapper.sh" >> ~/.profile

    ^ This may differ slightly based on your shell. Also, be careful not to use the a single > as this will truncate your ~/.profile :-o

提交回复
热议问题