A Python script that activates the virtualenv and then runs another Python script?

前端 未结 5 1001
别跟我提以往
别跟我提以往 2020-12-04 10:19

On Windows Vista, I need a script that starts the activate (to activate the virtualenv) script in:

C:\\Users\\Admin\\Desktop\\venv\\Scripts         


        
5条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-04 10:54

    I am using Anaconda 3 and python 3.7.6 on Windows. Had to do this in my .bat file:

    CALL path\to\base\virtual\environment\Scripts\activate.bat path\to\your\virtual\environment [path\to\your\virtual\environment]python.exe path\to\your\script\yoursript.py

    Without activate.bat nothing works. I was getting an error about mkl-server. This error is described here https://github.com/numpy/numpy/issues/15523. People complained there about conda being broken, i.e. just calling python.exe yoursript.py does not work.

提交回复
热议问题