Invalid syntax while importing libraries

Hi, I am encountering the above error while importing the libraries while working on an EC2 instance, however the same code runs fine on my computer.

I would highly appreciate help on this issue :slight_smile:

What version of python are you using? Typically this error is thrown when you are using a python version earlier than version 3.6.

Note: to check your version open python and run the following:
import sys

1 Like

Hi metachi,

Oh I see. I was using Python 3.6 on my computer while Python 2.7 on the EC2 instance. This may be the reason for the error.

That’s definitely it. I think the easiest way to get this running on EC2 or anywhere is using anaconda. You may also want to try using one of the images (ami’s) Jeremy talked about. There are some setup instructions from the lesson 2 wiki located here:

1 Like

Thank you so much @metachi This is very helpful :slight_smile:

Hi, for some reasons I can’t post a new topic so I’ll try replying to this that looks like the closest to my issue.
I setup my machine in paperspace and was testing the code in jupyter to make sure everything was fine, but I get this