virtualenvwrapper functions unavailable in shell scripts

前端 未结 8 820
夕颜
夕颜 2020-12-01 03:44

So, once again, I make a nice python program which makes my life ever the more easier and saves a lot of time. Ofcourse, this involves a virtualenv, made with the mkvi

8条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-01 03:53

    Apparently, I was doing this the wrong way. Instead of saving the virtualenv's name in the .venv file, I should be putting the virtualenv's directory path.

    (cdvirtualenv && pwd) > .venv
    

    and in the bin/run-app, I put

    source "$(cat .venv)/bin/activate"
    python main.py
    

    And yay!

提交回复
热议问题