VSCode terminal shows incorrect python version and path, launching terminal from anaconda works perfectly

后端 未结 5 643
予麋鹿
予麋鹿 2021-02-05 17:03

I have been stuck on this one problem for hours now and believe I have tried everything outside of throwing my computer out of the window.

I have a virtual environment s

5条回答
  •  悲&欢浪女
    2021-02-05 17:44

    I just ran into the same problem. Try switching out of the powershell terminal to the windows terminal. Then restart. It should restart with the anaconda terminal. If that does not work you could:

    First change the default terminal from within Visual Code to the CMD terminal instead of Powershell. Add the following code to a batch file.

    call "c:\path\to\anaconda3\Scripts\activate"
    

    Then I named the batch file and saved it to my root directory. In my case snake.bat. Now when I launch my CMD terminal I just type c:\snake.bat and the CMD prompt changes into an Anaconda prompt.

提交回复
热议问题