0

I have been have a tough time to install virtualenvwrapper, I see that I have installed python 3, also installed virtualenvwrapper by running

pip3 install virtualenvwrapper

then adding there three lines on .bash_profile

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

but it gives me

-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory
-bash: /Users/user/.bash_profile: line 43: unexpected EOF while looking for matching `''
-bash: /Users/user/.bash_profile: line 46: syntax error: unexpected end of file

I though it may be not on the path /usr/local/bin/virtualenvwrapper.sh. Run find / -name virtualenvwrapper.sh, but no luck (just a lots of permission denide lines) How can I figure out?

virtualenv itself works, just need to setup vertalenvwrapper, thank you.

Ichi
  • 369
  • 2
  • 4
  • 11
  • did you try `which virutalenvwrapper.sh`? (src: https://teamtreehouse.com/community/installing-virtualenvwrapper-on-mac-osx-yosemite) – chickity china chinese chicken Aug 17 '17 at 19:16
  • Yes I have tried it but the same result. source `which virtualenvwrapper.sh` but the same out come – Ichi Aug 17 '17 at 19:22
  • ok, maybe try inspecting `/Library/Frameworks/Python.framework/Versions/3.x/bin/` directory, change `3.x` to the python version. (src: [Where is virtualenvwrapper.sh after pip install?](https://stackoverflow.com/questions/12647266/where-is-virtualenvwrapper-sh-after-pip-install)) – chickity china chinese chicken Aug 17 '17 at 19:38
  • Oh, I am not sure how I can inspect the directories! Could you possibly tell me? – Ichi Aug 17 '17 at 19:48
  • Sure, in your `Terminal` shell, type `ls` (lowercase LS) to "list" the contents of directories, so type command `ls /Library/Frameworks/Python.framework/Versions/` then press `tab` key to see the directories of Python Versions. So if you have Python 3.4, for example, type `ls /Library/Frameworks/Python.framework/Versions/3.4/bin/` and see if `virtualenvwrapper.sh` is in the `bin` folder – chickity china chinese chicken Aug 17 '17 at 19:52
  • Thank you, but I am on myname ~$ on bash, do I have to come out from it? and how?x – Ichi Aug 17 '17 at 19:58
  • I think that that will work too. after the `$` prompt in bash, type `ls /Library/Frameworks/Python.framework/Versions/` and press enter – chickity china chinese chicken Aug 17 '17 at 20:01
  • yes, there is !! I was typing wrong :0 – Ichi Aug 17 '17 at 20:05
  • great try using that path in your `.bash_profile` – chickity china chinese chicken Aug 17 '17 at 20:06
  • Thanks, I added source /Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenvwrapper.sh but it gives me exactly the same error. Yes exactly, -bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory. Why does .bash_profile not taking my new source? – Ichi Aug 17 '17 at 20:15
  • this is the whole error, `-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory` `-bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory` `-bash: /Users/satokoichimura/.bash_profile: line 43: unexpected EOF while looking for matching `''` `-bash: /Users/satokoichimura/.bash_profile: line 59: syntax error: unexpected end of file` I am not sure if there is some file corruption, or may be because I am doing it for version 3.6 which is not really supported. – Ichi Aug 17 '17 at 20:36
  • did you try that same command on bash at a command prompt? `source /Library/Frameworks/Python.framework/Versions/3.6/bin/virtua‌​lenvwrapper.sh`, see if that gives you the same error? – chickity china chinese chicken Aug 17 '17 at 22:59
  • I just tried what you suggested then it gives me `/usr/bin/python: 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/python and that PATH is set properly.` So I tried `VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.Framework/Versions/3.6/bin` on bash_profile then tried again your suggestion on command prompt but the same comment came up... – Ichi Aug 18 '17 at 19:27
  • It seems like your system python default is still `python2.7`. Could you share what is the output of `/usr/bin/python -V`? – chickity china chinese chicken Aug 18 '17 at 19:45
  • I found this, [basic links](https://stackoverflow.com/questions/29149853/no-module-named-virtualenvwrapper) I will follow the suggestion of export for VIRTUALENVWRAPPER_PYTHON and VIRTUALENVWRAPPER_VIRTUALENV – Ichi Aug 18 '17 at 19:45
  • yes my out put is Python 2.7.10 I was not sure how to set the default so when I check the version, I always do python3 and use pip3 command to install virtualenvwrapper – Ichi Aug 18 '17 at 19:47
  • ok, sound good. just make sure you include `python` and `virtualenv` at the end of `export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3` and `export VIRTUALENVWRAPPER_VIRTUALENV=/Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenv` as shown in the "basic links" answer you pointed to. Just change `python3` and `virtualenv` to the commands that exist in your `bin` directory – chickity china chinese chicken Aug 18 '17 at 19:52
  • just done it but, but no luck. I checked if I wrongly typed many. `export WORKON_HOME=$HOME/.virtualenvs export VIRTUALENVWRAPPER_PYTHON=/Library/Frameworks/Python.framework/Versions/3.6/bin/python3 export VIRTUALENVWRAPPER_VIRTUALENV=/Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenv source /Library/Frameworks/Python.framework/Versions/3.6/bin/virtualenvwrapper.sh satokoichimura ~ $ source ~/.bash_profile -bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory -bash: /usr/local/bin/virtualenvwrapper.sh: No such file or directory ` – Ichi Aug 18 '17 at 20:15
  • I think I need to look into this message `-bash: /Users/satokoichimura/.bash_profile: line 43: unexpected EOF while looking for matching \`'' -bash: /Users/satokoichimura/.bash_profile: line 81: syntax error: unexpected end of file` these shows up every time tried `source ~/.bash_profile`. bash somehow don't read these export and source with some reason. Would you have any ideas? I have been searching through... – Ichi Aug 18 '17 at 21:46
  • Yes, it sounds like there is an opening single quote `'` in `~/.bash_profile` that doesn't have a matching closing single quote `'` somewhere in the file, possibly somewhere around `line 43` – chickity china chinese chicken Aug 18 '17 at 23:08

1 Answers1

0

I decided move on to anaconda env as I needed so many libraries (& jupyter notebook) to use. Still don't know how it could be worked out.

Ichi
  • 369
  • 2
  • 4
  • 11