-1

I am trying to activate a virtual environment making the environment worked fine, but when I try to activate it(source virt/Scripts/activate), it throws up

$ source activate bash: $'\r': command not found bash: activate: line 4: syntax error near unexpected token $'{\r'' ash: activate: line 4: deactivate () {

and I am a beginner and I am clueless about what I should do

Thanks!

  • Turn on logging with `set -x`, to see which command exactly produces the error mesage. Also, the error mesage suggests that one of your file may have a carriage return character in it (Hex 0d), so you could check for this too. – user1934428 Jul 02 '21 at 06:59

1 Answers1

0

On Windows

python -m venv virt
virt\scripts\activate

On Unix or MacOS

python -m venv virt
source virt/bin/activate
AJITH
  • 1,145
  • 7
  • 8