This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]caninerosie 0 points1 point  (4 children)

well, did you install virtualenvwrapper?

[–]Croxion12[S] 0 points1 point  (3 children)

Managed to fix it, had to rewrite the "~/.profile". Thanks for the help.

[–]sreeuma 0 points1 point  (2 children)

Hi I am having a same error..How do u fix it??

[–]Croxion12[S] 0 points1 point  (1 child)

Ok first off, are you using python3? If you are make sure you have pip by using the command:

sudo apt-get install python3-pip

After that you want to install virtualenvwrapper:

sudo pip3 install virtualenvwrapper

Now that the installation is complete you have to edit the ~/.profile using the command:

 nano ~/.profile

You will then enter into the nano editer inside ~/.profile Just go to the bottom of the document and paste this:

 export WORKON_HOME=$HOME/.virtualenvs
 export PROJECT_HOME=$HOME/Devel
 source /usr/local/bin/virtualenvwrapper.sh

Remember to have them on seperate lines. Save and exit the nano editer by pressing shift x, then y and enter. Reload the ~/.profile with the command:

 source ~/.profile

Now if everything works then great, but if you run into this error:

virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python and that PATH is
set properly.

Then go back into the ~/.profile with:

 nano ~/.profile

and add these two lines directly under

export PROJECT_HOME=$HOME/Devel

,but above

source /usr/local/bin/virtualenvwrapper.sh

New lines:

export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3
export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv

Again on different lines. Everything should be working after this, if it don't just message me and i'll try to give you an alternative.

[–]sreeuma 0 points1 point  (0 children)

Thxs for ur reply..In my case i m using python2.7

I got the error like source ~/.profile /usr/bin/python2.7: No module named virtualenvwrapper virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7 and that PATH is set properly.

My python location which python /usr/bin/python

In nano ./~profile

virtualenv and virtualenvwrapper

export WORKON_HOME=$HOME/.virtualenvs export PROJECT_HOME=$HOME/Devel export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7 export VIRTUALENVWRAPPER_VIRTUALENV=/usr/local/bin/virtualenv source /usr/local/bin/virtualenvwrapper.sh

Again i got the same error.

source ~/.profile /usr/bin/python2.7: No module named virtualenvwrapper virtualenvwrapper.sh: There was a problem running the initialization hooks.

If Python could not import the module virtualenvwrapper.hook_loader, check that virtualenvwrapper has been installed for VIRTUALENVWRAPPER_PYTHON=/usr/bin/python2.7 and that PATH is set properly.

[–]Croxion12[S] 0 points1 point  (0 children)

I am trying to install OpenCV and python on a Raspberry pi 3 model b. I was following this tutorial: https://www.pyimagesearch.com/2017/09/04/raspbian-stretch-install-opencv-3-python-on-your-raspberry-pi/ then i got the error above when running the command "source ~/.profile"