Ich habe folgendes Problem, ich möchte eine db connection zu einem NW internen UNIX Server aufbauen, folgendes Problem tritt auf.
Das SQL Modul habe ich installiert.
Fehlermeldung:
Code: Alles auswählen
Traceback (most recent call last):
File "Z:\Python\scripts\dbconnection.py", line 1, in ?
import MySQLdb
File "Z:\Python\Lib\site-packages\MySQLdb\__init__.py", line 34, in ?
from sets import ImmutableSet
ImportError: cannot import name ImmutableSet
Code: Alles auswählen
import MySQLdb
import sys
class cursorDash:
strHost = "*****"
strUser = "*****"
strPass = "*****"
strDB = "*****"
def __init__(self):
connectionDash = MySQLdb.connect(host=self.strHost, user=self.strUser, passwd=self.strPass, db=self.strDB)
self.cursorDash = connectionDash.cursor()
self.cursorDash
def execute(self, strQuery):
self.cursorDash.execute(strQuery)
def fetchall(self):
return self.cursorDash.fetchall()
def fetchone(self):
return self.cursorDash.fetchone()
Danke für eure Hilfe
Gruss Stoner