I started a python virtual environment in the folder /media/suraj/Extra Drive 1/testEnv/
. Notice the space in the path. Now everything works fine except when I use pip freeze.
(testEnv) bin > pip freeze
bash: /media/suraj/Extra Drive 1/testEnv/bin/pip: "/media/suraj/Extra: bad interpreter: No such file or directory
So, I fix the environment variable in activate source file VIRTUAL_ENV="/media/suraj/Extra Drive 1/testEnv"
to VIRTUAL_ENV="/media/suraj/Extra\ Drive\ 1/testEnv"
. Now, after reactivating the environment I check which python
but it points to the global python binary. I check if the PATH variable has the environment directory as the first directory and it does.
(testEnv) Extra Drive 1 > echo $PATH
/media/suraj/Extra\ Drive\ 1/testEnv/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/home/suraj/.config/composer/vendor/bin/:/usr/local/aws/bin
So, I change the VIRTUAL_ENV to the original path without escaped space. Now things work fine but pip freeze doesn't work. Any ideas what could possibly be wrong?