0

I have both python 2.7 and 3.8 and wanted to run virtualenv on 3.8. As the result of which python3 was /usr/local/bin/python3 I did virtualenv -p /usr/local/bin/python3 virEnv and then source virEnv/bin/activate to start the virtualenv. Now I switched to another terminal (on visual studio code) and ran workon virEnv and it gave workon:command not found. I searched for the solution on stackoverflow and found this thread workon:command not found and did

export WORKON_HOME=~/.virtualenvs
VIRTUALENVWRAPPER_PYTHON='/usr/local/bin/python3'
source /usr/local/bin/virtualenvwrapper.sh

But the third line is resulting in

/usr/local/bin/python3: Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: 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/local/bin/python3 and that PATH is
set properly

I want to work on my virtualenv on any terminal by running workon name. Please help.

nkhl
  • 140
  • 2
  • 13
  • 1
    With this command `virtualenv -p /usr/local/bin/python3 virEnv`, You are using `virtualenv` here, not `virtualenvwrapper`. To make a separate environment using `virtualenvwrapper` you need to run `mkvirtualenv ENV_NAME` where ENV_NAME is env name you want to set to. Also, have you tried installing virtualenvwrapper with `pip3 install virtualenvwrapper`? – harryghgim Aug 03 '20 at 07:36
  • 1
    Consider visiting MDN Django page where it covers [virtualenvwrapper setting](https://developer.mozilla.org/en-US/docs/Learn/Server-side/Django/development_environment#macOS_virtual_environment_setup) – harryghgim Aug 03 '20 at 07:40
  • @harryghgim Whenever I use pip3 I get `WARNING: pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.` – nkhl Aug 03 '20 at 12:52
  • I'm not sure about that message, but [this stackoverflow page](https://stackoverflow.com/questions/41328451/ssl-module-in-python-is-not-available-when-installing-package-with-pip3) might help – harryghgim Aug 04 '20 at 02:22

0 Answers0