#🔒 python venv won't activate properly when specifying version

21 messages · Page 1 of 1 (latest)

gentle hull
#

for some reason when i use
py -3.10 -m venv env and then activate it using ./source/Scripts/activate. However, for some reason it nests paths. Like such:

/c/Users/name/Desktop/LU/Zelf-ontplooiing/Project 2 - tts/\Users\name\Desktop\LU\Zelf-ontplooiing\Project 2 - tts\env/Scripts/python
(env) ```

Not sure why or how to fix this. This doesn't happen when I make a regular venv without specifying a version
naive agateBOT
#

@gentle hull

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

hollow goblet
#

You’re on Windows but then you have a Linux style shell and paths
Are you on Git Bash or WSL?

flint latch
#

if its same as his old post then iirc he mentioned he was in git bash terminal in vsc

hollow goblet
#

I wonder if OP sees the same thing were they to use CMD or Powershell

hollow goblet
#

After all, if they use Git Bash to activate the venv then they are using a script intended for Linux, not for Windows

gentle hull
#

heyy, sorry i was in a meeting

#

so when i tried to do it in cmd i got this:

#

but i'm used to running my files from the git bash terminal so then when i try to go back there to continue, the git bash terminal is still not in the virtual env

hollow goblet
gentle hull
#

ah i see

#

that's good to know

#

but then i'm still a bit lost on how to set up my env in git bash with a specific python, because my regular "python -m venv env" just takes my current/most updated python version, but i'm trying to use the 3.10 one; but if i were to do "python3.10 -m venv env" in git bash, it just throws an error

hollow goblet
#

The simplest solution here is not to use Git Bash to launch Python

#

If you really want a Linux shell then use the proper thing and set up WSL

gentle hull
#

ah, alright

gentle hull
#

it works now, thank you

naive agateBOT
#
Python help channel closed using Discord native close action

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.