Reputation: 29
For the last 3 days, I have been trying to set up virtual Env on Vs Code for python with some luck but I have a few questions that I cant seem to find the answer to.
For extra context I have oh-my-ZSH set up and using the ubuntu command line on my windows device. Any information will be helpful at this point because I am losing my mind.
Upvotes: 1
Views: 3662
Reputation: 1
Run powershell as adminstrator
then excute this;Set-ExecutionPolicy RemoteSigned
then type;y
Enter
Now you can activate in vs code without restrictions every time.
Upvotes: 0
Reputation: 179
Run Set-ExecutionPolicy Unrestricted -scope process
before activating virtual environment.
All the best
Upvotes: 3
Reputation: 16000
You don't have to create a virtual environment under WSL, it will work anywhere. But the reason you don't have a Scripts/
directory is because (I bet) you're running VS Code with git bash and that makes Python think you're running under Unix. In that case it creates a bin/
directory. That will also confuse VS Code because the extension thinks you're running under Windows.
I would either create a virtual environment using a Windows terminal like PowerShell or Command Prompt or use WSL2.
Upvotes: 0
Reputation: 406
If you have the python extension installed you should be able to select your python interpreter at the bottom.
You should then be able to select the appropriate path
Upvotes: 2