简体   繁体   中英

Python activating environment variables

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?

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>

I had trouble because of typing

".virtualenv/MyEnv/bin/activate" 

instead of

". virtualenv/MyEnv/bin/activate"

missed the blank space. try!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM