Hi, I’m having a problem and I hope someone can help me
I installed python-3.12.7 64bits in my windows 10 laptop. I’m trying to run from VSCode this sentence : “source .venv/Scripts/activate” but it isn’t working, I get the message “source is not recognized as a cmdlet, function, script file or executable program”.
What’s wrong? How can I fix it?
Thanks very much for your help
“source .venv/Scripts/activate” is for a unix shell. On Windows, you want to run the “.venv/Scripts/activate.ps1”
If there is no file at “.venv/Scripts/activate.ps1”, you want to try running “.venv/bin/activate.ps1” instead.
You may want to set vscode to use this virtual environment as well. You can do that by bring up the command palette (or View-> command Palette) then type “select python interpreter” then pick the “.venv/bin/python” (you can use the “Pick Interpreter Path” then “Find” to manually pick the file.)
Hi, thanks for your help.
I tried what you indicated, but it didn’t work, I got a message that say that "Scripts execution are dishabilitated in your system
Then I tried something else, “.venv/Scripts/activate.bat”, and this run without problem, I guess that’s right
Thanks a lot, you were very helpfull
Look into this: Set-ExecutionPolicy (Microsoft.PowerShell.Security) - PowerShell