Issue with virtualenv - cannot activate

前端 未结 25 1866
借酒劲吻你
借酒劲吻你 2020-12-04 05:20

I created a virtualenv around my project, but when I try to activate it I cannot. It might just be syntax or folder location, but I am stumped right now.

You can see

相关标签:
25条回答
  • 2020-12-04 05:33

    Similar to everyone but a bit simple. I just .\<path of a env>\Scripts\activate on PowerShell with Administrator right

    0 讨论(0)
  • 2020-12-04 05:34
    1. Open your project using VS code editor .
    2. Change the default shell in vs code terminal to git bash.

    3. now your project is open with bash console and right path, put "source venv\Scripts\activate" in Windows

    0 讨论(0)
  • 2020-12-04 05:34

    Navigate to your virtualenv folder eg ..\project1_env> Then type

    source scripts/activate

    eg ..\project1_env>source scripts/activate

    0 讨论(0)
  • 2020-12-04 05:34

    Incase you are using Anaconda / miniconda on windows - in your command prompt use

    conda activate <your-environmentname>
    

    e.g. peopleanalytics is name of my virtual environment - Is say

    conda activate peopleanalytics
    
    0 讨论(0)
  • 2020-12-04 05:34

    The best way is, using backward slahes and using .bat at the end of activate

    C:\Users>your_env_name\Scripts\activate.bat
    
    0 讨论(0)
  • 2020-12-04 05:37
    :: location of bat file
    ::C:\Users\gaojia\Dropbox\Projects\free_return\venv\Scripts\activate.bat 
    :: location of the cmd bat file and the ipython notebook
    ::C:\Users\gaojia\Dropbox\Projects\free_return\scripts\pre_analysis
    source ..\..\venv\Scripts\activate
    PAUSE
    jupyter nbconvert --to html --execute consumer_response_DID.ipynb
    PAUSE
    

    Above is my bat file through which I try to execute an ipython notebook. But the cmd window gives me nothing and shut down instantly, any suggestion why would this happen?

    0 讨论(0)
提交回复
热议问题