Forums

'SyntaxError: invalid syntax' when installing modules

I'm a beginner programmer, I've made a programme locally, this is the first time trying to host it online. I am following the tutorial: https://help.pythonanywhere.com/pages/InstallingNewModules

When I type pip3.8 install --user pwhich in the console, I get the following error:

pip3.8 install --user pwhich File "<stdin>", line 1 pip3.8 install --user pwhich ^ SyntaxError: invalid syntax

I am using a 'Python3.8 console' that I created. Am I using the console wrong or is additional setup needed?

ah- for installs, you should use the bash console instead of the python console

Thanks, I will give that a go

I have made a bash console now and am trying the command. I still get the same error, what would be the cause of this? Bash console:

pip3.8 install --user pwhich File "<stdin>", line 1 pip3.8 install --user pwhich ^ SyntaxError: invalid syntax

Are there any recommended guides?

That's a Python syntax error, so you are typing that into a Python interpreter, not Bash.

Ok, thanks. No idea how I got that wrong. The commands to setup the virtual environment seem to be going through now, I will see how that goes.

Edit: I had entered into Python script, that's why I was getting python errors. I've found the exit() command, so i'm back into bash now, which is what i needed.

OK, glad you got it sorted!