Forums

Error: Invalid syntax

Hi! I´m trying to run instapay on https://www.pythonanywhere.com but I always have the same error: invalid syntax

Could you tell me how to fix it? It could be due to the fact that my Python version which is installed on my pc is 3.8.3 and the max version on python anywhere is 3.7?

Thanks a lot in advanced!

What command are you using to run it? And what is the exact error message that you're getting?

Hi, Here you can check them:

https://i.postimg.cc/50VT26JV/2.png

https://i.postimg.cc/wvQPygxs/3.png

https://i.postimg.cc/J07FjvtY/Error.png

Thanks a lot in advanced!

OK, it looks like you have three separate (albeit similar) errors there.

https://i.postimg.cc/50VT26JV/2.png

In this one, you appear to have copied instapy into your account the directory that contains your code. You should install it using one of the different pip commands, instead. There's more about installing new modules on this help page.

https://i.postimg.cc/wvQPygxs/3.png

In this one you are already running Python, and then you are trying to run the Bash command that starts Python inside it.

https://postimg.cc/r0bgkh15

In this one, you have started a Bash console, and you are trying to run a Python 3 script using Python 2. You should use the "python3.7" command to run the script instead of the "python" one.

Hi, Thanks a lot that issues were fixed, but now I have this error:

https://i.ibb.co/f1XgC2b/error.jpg

Please, could you help me to fix it? Thanks a lot again and again!!!!!

You appear to be using a version of selenium that does not support the options argument. Make sure that the version of selenium that you're using is the one that the code was written for.

Ok, let me try and I´ll tell you. Thanks a lot!

I made changes to the model on pythonanywhere and I ran python manage.py migrate. The bash gave me the error below File "manage.py", line 17 ) from exc ^ SyntaxError: invalid syntax

That normally happens if you try to run a Python 3 manage.py using Python 2. I see that your website uses a virtualenv; have you activated it in the shell where you're trying to run the migration?

Yes of course it's activated

Could you post a screenshot showing the command and the error, perhaps?

Thank you I didn't activate my virtualenv