Setup problems: AWS

(Quan Sun) #208

./ line 119: syntax error: unexpected end of file error on mac

Hi, this is a great DL course, thanks very much!

I got “./line 119: syntax error: unexpected end of file” when trying to run the setup_p2 script on a mac machine. I have tried to use dos2unix and the method described in #17

but didn’t fix the error.

Have you seen a similar error? Thanks!

(Elizabeth) #209


on OS Sierra (10.12.1) using python 2.7; same error with p2 and t2 setups

errors: line 5: syntax error near unexpected token newline' line 5: line 5: syntax error near unexpected token newline' line 5:

(sai kiran) #210

While initialising AWS. I’m getting the following message,
Enter passphrase for key ‘/home/Sai Kiran/.ssh/aws-key.pem’:

Kindly advice. I didn’t see any message of this kind in the video!

(Marc) #211

Guys, I am still stuck with this error when trying to configure my aws server:

$ aws
C:\Users\Marc\Anaconda2\python.exe: can’t open file ‘/cygdrive/c/Users/Marc/Anaconda2/Scripts/aws’: [Errno 2] No such file or directory

Although I think the problem shouldnt be that hard I cant seem to crack it. Would anybody be up for helping me set this up (by fe videochat). Would be really grateful as I really want to get this course starting…

(Jeremy Howard) #212

Try this: Installation [Windows]

(Jeremy Howard) #213

It sounds like the “unexpected token newline” problem is specific to macs. I can’t see anything odd with the file - it’s using standard unix line endings. What if you copy and paste the contents of into a new file? Does that work?

(james wolf) #214

@jeremy that is what I tried the other day when I first made my comment about it not working (copy and paste the raw github code), but it still didnt work. I was finally able to test the @stevejburr solution and copy and pasted from this url:
this appears to have worked (because I get this:
Waiting for instance start…

All done. )
but I havent connected to the instance yet to check.

Thanks @stevejburr for the assist!

FYI: I have a macbook pro, and it is probably just an incorrectly closed quote, but there are so many varieties of quoting in the file it is tough to see. I would suggest someone does a diff from the latest and look at the changes.

(james wolf) #215

@jeremy uh-oh, I spoke too soon. Looks like that script I am pointing to above doesnt set up the server correctly. The next set after logging in to the server (following your video) is to test the nvidia setup with this command:
but that gives me this error:
Failed to initialize NVML: Driver/library version mismatch

I decided to start over and retry your file again, the file seems to work now (didnt have the end of file issue), but i still cant run nvidia-smi (same issue as above). I decided to continue on anyways and just see how much further I could get, so I setup jupyter notebook, but when I test importing theano I get the following error:
WARNING (theano.sandbox.cuda): CUDA is installed, but device gpu is not available (error: Unable to get the number of gpus available: no CUDA-capable device is detected)

(james wolf) #216

Sorry for the excessive posts, but I went back and looked at the file and noticed that there were notes about my “failed to initialize NVML…” issue that said that it needed to reboot. I rebooted the server and logged back in and found that nvidia-smi now works as described, it sees the GPU.

(Vikramjit Sidhu) #217

I am currently getting a similar error, on running:
$ bash line 3: $’\r’: command not found line 7: $’\r’: command not found line 119: syntax error: unexpected end of file

I am running Cygwin on Windows 10, I made sure I have the latest version of the git repository before running the file.
I also tried copy pasting the code from github, but that didn’t work too.

(Vikramjit Sidhu) #218

Found out how to solve this, the problem is with file endings that Windows automatically adds which Shell can’t understand.
Install dos2unix:
apt-cyg install dos2unix

Then run the dos2unix command on the file:

I referred to these 2 Stack Overflow answers:

(Jeremy Howard) #219

How did you get the script. git clone, wget, or something else? Using the cygwin version of the commands, or windows version? (If not sure, which git will tell you)


Git has a setting which can change the line endings in your local copy vs those in the repository on checkout (and v.v. on commit). In my case that was the cause of my line ending problems - it was changing the Unix-style endings to Windows-style in my local copy.

Running the following fixed it for me (sets git to leave line endings alone):
git config --global core.autocrlf false

(deora) #221

In the setup I am getting this error. How to solve this?

bipuls-MacBook-Pro:~ bipuldeora$ wget
-bash: wget: command not found


Hi all, wanted to see if anyone has encountered the following:

I tried to run the bash setup yesterday ( and got “PendingVerification” error, with text saying that verification normally takes less than 2 hours. I waited overnight and although that message is now gone, I am getting “InstanceLimitExceeded” - stating that my current instance limit is zero which exceeds the request of one. I’ve sent a copy of basically this exact text to AWS about 6 hours ago and have heard nothing back. I know from reading the Wiki that we are suppose to receive expedited access using ‘ MOOC’ as the case description, so not sure what the delay is. Did anybody else have to wait a while to receive approval?


(NB) #223

you don’t have wget installed. i would suggest you install brew, start here

(NB) #224

delete all the .pem keys, then do chmod 700 ~/.ssh and follow the “start over” procedure listed in the wiki – I just had the same issues and that fixed it

(Vikramjit Sidhu) #225

wget was a part of the Cygwin install, I’m not sure which git is being used. I had git already installed on my computer so it could have picked that version up

(Cherie Chin-A-Fo) #226

Hi Rachel,

I get a “page not found error” when I use the following link to get the setup_p2_ireland.

Am I using the right url:


(Rachel Thomas) #227

@Cherie I have updated the setup scripts so that one script works for all regions now:

You will need to set your region as eu-west-1. You can do this in ~/.aws/config

I’ve tried to update links on the wiki and the website to remove references to, please let me know if there are any stray references I’ve missed.