15

Using environment variables, successful in creating vartualenv but when I am trying to activate it by myenv/bin/activate it says badly places ()'s.

virtualenv my env
source myenv/bin/activate
badly placed()'s

I've also tried ./myenv/bin/activate. How do I solve this? where should I place ()'s?

2 Answers2

46

If you use *csh or fish, use activate.csh or activate.fish instead of activate:

falsetru@ubuntu:/tmp$ tcsh
ubuntu:/tmp> virtualenv aa
New python executable in aa/bin/python
Installing setuptools............done.
Installing pip...............done.
ubuntu:/tmp> source aa/bin/ac
activate          activate.csh      activate.fish     activate_this.py
ubuntu:/tmp> source aa/bin/activate      # <----------------
Badly placed ()'s.
ubuntu:/tmp> source aa/bin/activate.csh  # <----------------
[aa] ubuntu:/tmp>
falsetru
  • 357,413
  • 63
  • 732
  • 636
  • 2
    consider editing: find which shell you using echo $shell if ../csh then activate.csh etc – Rubber Duck Sep 23 '14 at 13:10
  • @RubberDuck, `echo $SHELL` does not show current shell, but the login shell. See this question: http://stackoverflow.com/questions/3327013/how-to-determine-the-current-shell-im-working-on – falsetru Sep 23 '14 at 13:22
-2

I had trouble because of typing

".virtualenv/MyEnv/bin/activate" 

instead of

". virtualenv/MyEnv/bin/activate"

missed the blank space. try!

Bhargav Rao
  • 50,140
  • 28
  • 121
  • 140