Python-Skript nicht ausführbar

L I V E Stammtisch ab 20:30 Uhr im Chat
  • Hallo zusammen,
    ich möchte gerade ein Python-Skript für den Raspberry Pi schreiben, auf den ich per SSH zugreife.
    In die erste Zeile des Skriptes habe ich #!/usr/bin/python geschrieben und habe die Datei dann ausführbar gemacht.
    Beim Öffnen mit ./script.py erhalte ich die Fehlermeldung -bash: ./script.py: usr/bin/python: bad interpreter: No such file or directory.
    Der Befehl which python ergibt /usr/bin/python.
    Der Befehl ls -l /usr/bin/python* ergibt
    lrwxrwxrwx 1 root root 9 Feb 8 2013 /usr/bin/python -> python2.7
    -rwxr-xr-x 1 root root 2674528 Jan 13 2013 /usr/bin/python2.7
    lrwxrwxrwx 1 root root 9 Oct 21 2012 /usr/bin/python3 -> python3.2
    lrwxrwxrwx 1 root root 11 Mar 1 15:40 /usr/bin/python3.2 -> python3.2mu
    -rwxr-xr-x 1 root root 2814320 Mar 1 15:40 /usr/bin/python3.2mu
    lrwxrwxrwx 1 root root 11 Oct 21 2012 /usr/bin/python3mu -> python3.2mu

    Bin gerade etwas ratlos.
    Viele Grüße

  • Hallo,
    mit sudo python script.py wird das Skript ordnungsgemäß ausgeführt (Die LED geht an).
    Da ich gerade meine ersten Versuche mit der GPIO-Programmierung mache, ist das Skript nichts besonderes:

    #!usr/bin/python


    import RPi.GPIO as GPIO


    GPIO.setmode(GPIO.BCM)

    GPIO.setup(25, GPIO.OUT)

    GPIO.output(25, GPIO.HIGH)

    Einmal editiert, zuletzt von Echinocactus (17. August 2013 um 23:41)

Jetzt mitmachen!

Du hast noch kein Benutzerkonto auf unserer Seite? Registriere dich kostenlos und nimm an unserer Community teil!