Invalid syntax while importing libraries


(Himani Agrawal) #1

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:


(Jeff Lee) #2

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
print(sys.version)


(Himani Agrawal) #3

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.


(Jeff Lee) #4

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:
https://github.com/reshamas/fastai_deeplearn_part1/blob/master/aws_ami_gpu_setup.md


(Himani Agrawal) #5

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


(Francesco) #6

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