/usr/bin/python3: Error while finding spec for 'virtualenvwrapper.hook_loader' (: No module named 'virtualenvwrapper')

后端 未结 12 1606
感情败类
感情败类 2020-12-08 03:33

I\'m trying to follow How To Serve Django Applications with uWSGI and Nginx on Ubuntu 14.04 and I\'m failing at the very earlier stage, due to amount of output, I placed all

相关标签:
12条回答
  • 2020-12-08 04:20

    On my computer, I ran sudo apt install python-pip and then pip install virtualenvwrapper but on my settings, I set it as follows:

    export WORKON_HOME=$HOME/.Envs
    export VIRTUALENVWRAPPER_PYTHON=$(which -a python3)
    source $HOME/.local/bin/virtualenvwrapper.sh
    

    That got rid of the error and note that I am using python3 and I use pip3 as my default

    0 讨论(0)
  • 2020-12-08 04:32

    I faced similar problem, when using python3 with virtualenvwrapper,

    sudo apt-get install python3-pip
    

    Then install virtualenv and virtualenvwrapper from pip3,

    sudo pip3 install virtualenv virtualenvwrapper
    

    then source it again,

    source $HOME/.bashrc 
    
    0 讨论(0)
  • 2020-12-08 04:34

    Thanks to @Alexander, I was able to fix my issue by changing the line in ~/.bashrc:

    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
    

    to

    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python
    

    due to backwards compatibility.

    0 讨论(0)
  • 2020-12-08 04:34

    export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python

    good choice, but you already knew /usr/bin/python is 2.7

    If you want to use version 3

    sudo apt-get install python3-pip

    and logout & login

    0 讨论(0)
  • 2020-12-08 04:35

    check your python3 installation directory:

    which python3

    If installed by brew you should get:

    /usr/local/python3

    export python version to be used virtualenvwrapper:

    export VIRTUALENVWRAPPER_PYTHON=/usr/local/python3

    source your shell configuration file:
    bash

    source .bashrc

    zsh

    source .zshrc

    0 讨论(0)
  • 2020-12-08 04:35

    I've got this error for entirely different reasons, but since I ended up on this thread, I gather somebody might find this useful. So in my case, it turned out that my script was attempting to activate the virtual environment while I was already on it (the workon statement is issued from my .profile file). And so the solution was to simply deactivate the environment first and then run the script.

    0 讨论(0)
提交回复
热议问题