Activate virtualenv via os.system()

前端 未结 4 804
一生所求
一生所求 2020-12-10 20:33

I\'m writing a Python-based shell script to boilerplate a Django app with virtualenv, pip, and fabric. Should be straightforward enough, but it appears that I\'m not able to

4条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-10 20:53

    You could also install virtualenvwrapper, and use the postmkvirtualenv hook. I use it to automatically bring in fresh copies of pip and IPython into virtualenvs I create (as I don't want it using my system IPython). I also use it to copy pythonw into the virtualenv, otherwise wx-based stuff won't work. Looks like this:

    easy_install pip
    pip install -I ipython
    cd ~/bin
    python install_pythonw.py ${VIRTUAL_ENV}
    

提交回复
热议问题