0

I created a venv using "python -m venv env" and I'm trying to activate it but it kept showing "The system cannot find the path specified"

I tried activating using env\Scripts\activate please any idea on how i can solve this?

i use python 3.11, window 11

Yash Mehta
  • 2,025
  • 3
  • 9
  • 20
  • Navigate to Scripts folder. ./activate.ps1. Or check https://stackoverflow.com/questions/18713086/virtualenv-wont-activate-on-windows – Mark Dec 06 '22 at 03:24
  • @Mark tried navigating to the env but still showing me same problem – Abdulsamad Salihu Dec 06 '22 at 03:30
  • Which operating system? Are you using the CMD shell or powershell? – tdelaney Dec 06 '22 at 03:33
  • I use command prompt – Abdulsamad Salihu Dec 06 '22 at 03:48
  • 2
    If you're using the command prompt, then it should be `env\Scripts\activate.bat` – nigh_anxiety Dec 06 '22 at 06:38
  • Provide debugging details, including commands and logs. See [mre]. – relent95 Dec 06 '22 at 06:52
  • @nigh_anxiety Normally `bat` is included in `PATHEXT`, so it shouldn't matter if the suffix (file extension) is typed in. – iBug Dec 06 '22 at 12:14
  • Did you create the environment with command prompt in Admin mode or not? This may impact the location of the venv folder and the list of environments available to activate (learned this the hard way). Try running CMD in the same mode as you used to create the environment. – StephanT Dec 06 '22 at 12:27
  • @iBug Right, it should just work, but being explicit with the `.bat`doesn't hurt anything, and would work around any messed up PATHEXT. Also, I was clarifying against the previous comment which suggested to use `activate.ps1`, which won't work directly from the command prompt. – nigh_anxiety Dec 06 '22 at 16:54

0 Answers0