Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Sample script doesn't work #8

Closed
leolorenzoluis opened this issue Jul 25, 2019 · 2 comments
Closed

Sample script doesn't work #8

leolorenzoluis opened this issue Jul 25, 2019 · 2 comments

Comments

@leolorenzoluis
Copy link

leolorenzoluis commented Jul 25, 2019

I get the following logs:

15:25:59
/bin/bash: /tmp/OnStart_2019-07-25-15-25eklvadz0: /bin/bash^M: bad interpreter: No such file or directory

15:41:03
/bin/bash: /tmp/OnStart_2019-07-25-15-41dneui_mc: /bin/bash^M: bad interpreter: No such file or directory

This is now just pure copy paste from your sample scripts


#!/bin/bash

set -e

# OVERVIEW
# This script installs a single pip package in all SageMaker conda environments, apart from the JupyterSystemEnv which is a 
# system environment reserved for Jupyter.
# Note this may timeout if the package installations in all environments take longer than 5 mins, consider using "nohup" to run this 
# as a background process in that case.

sudo -u ec2-user -i <<'EOF'

# PARAMETERS
PACKAGE=scipy

# Note that "base" is special environment name, include it there as well.
for env in base /home/ec2-user/anaconda3/envs/*; do
    source /home/ec2-user/anaconda3/bin/activate $(basename "$env")

    if [ $env = 'JupyterSystemEnv' ]; then
      continue
    fi

    pip install --upgrade "$PACKAGE"

    source /home/ec2-user/anaconda3/bin/deactivate
done

EOF
@KoenBal
Copy link

KoenBal commented Jul 25, 2019

copy to notepad++
view>show symbol>show all symbols
replace "/r" with nothing
CRLF should become LF which is valid in unix
copy and paste as plain text!!!

@Nov05
Copy link

Nov05 commented Apr 2, 2021

Using Notepad++ to change end of line characters (CRLF to LF)

  1. Click on Search > Replace (or Ctrl + H)
  2. Find what: \r\n.
  3. Replace with: \n.
  4. Search Mode: select Extended.
  5. Replace All.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants