including Fehler

Probleme bei der Installation?
Antworten
Michael

Hallo,
mir ist aufgefallen das ich nichts importieren kann.

>>> form math include *
File "<stdin>", line 1
form math include *
^
SyntaxError: invalid syntax

Kann mir jemand sagen wo die include Dateien liegen und warum sich das nicht includen lässt?

Gruss Michael
Dookie
Python-Forum Veteran
Beiträge: 2010
Registriert: Freitag 11. Oktober 2002, 18:00
Wohnort: Salzburg
Kontaktdaten:

Hi michael,
Kann mir jemand sagen wo die include Dateien liegen und warum sich das nicht includen lässt?
weil das bei Python import und nicht include heißt!


Gruß

Dookie
[code]#!/usr/bin/env python
import this[/code]
Leonidas
Python-Forum Veteran
Beiträge: 16025
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Und dass es from und nicht form heißt.
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
Michael

Jo stimmt :) Shit C/C++ :)

JEdoch wo finde ich die Dateien die ich damit importiere?

Gruss Michael
Michael

Jo stimmt :) Shit C/C++ :)

JEdoch wo finde ich die Dateien die ich damit importiere?

Gruss Michael
Leonidas
Python-Forum Veteran
Beiträge: 16025
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Code: Alles auswählen

import sys
print sys.path
verschafft dir Klarheit. Dort kannst du auch noch deine eigenen Verzeichnisse während der Laufzeit eintragen.
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
Michael

Irgendwie hab ich das ganze noch nicht richtig configuriert.

>>> from turtle import *
Traceback (most recent call last):
File "<stdin>", line 1, in ?
File "/usr/local/lib/python2.4/lib-tk/turtle.py", line 4, in ?
import Tkinter
File "/usr/local/lib/python2.4/lib-tk/Tkinter.py", line 38, in ?
import _tkinter # If this fails your Python may not be configured for Tk
ImportError: No module named _tkinter

Mache das Python für Kids Buch durch nur irgendwie steht da nix weiter wie man das configuriert.
Leonidas
Python-Forum Veteran
Beiträge: 16025
Registriert: Freitag 20. Juni 2003, 16:30
Kontaktdaten:

Ich würde sagen, du hast Python ohne Tk installiert (ach, das liebe Tk, macht doch immer wieder Ärger und ist auch sonst oft pingelig).

So wie ich das sehe, hast du Python aus den Sourcen selbstkompiliert. Da du aber kein Tk-dev (oder wie das sich bei deinder Distribution nennt) hast, wurde es nicht mitkompiliert. Also sollstest du das Paket nachinstallieren und danach Python Tkinter kompilieren lassen (im Python-2.4/ nochmal ein ./configure und ein make, danach nochmal ein make install).

Hoffe es hilft.
My god, it's full of CARs! | Leonidasvoice vs (former) Modvoice
Antworten