google-code-export / winpython

Automatically exported from code.google.com/p/winpython
2 stars 1 forks source link

WinPython ImportError: No module named pyodbc #102

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
I'm using WinPython 2.7 which has the pyodbc.py file in it.  The IDE does not 
give me any error or warning on the import, nor on the paths.  I tried it with 
just the import first and still got the same thing.

I know I must be missing something simple like copying a file to another 
directory or importing something else but I can't seem to find it on the 
internet.  Any ideas?

import pyodbc
pyodbc.path.append("C:\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Lib\site-packa
ges\sqlalchemy")
pyodbc.path.append("C:\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Lib\site-packa
ges\sqlalchemy\sql")
pyodbc.path.append("C:\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\Lib\site-packa
ges\sqlalchemy\ext")

connection = pyodbc.connect ('DRIVER={SQL Server Native Client 
10.0};SERVER=localhost;DATABASE=db;UID=sa;PWD=sa')
cursor = connection.cursor()

What steps will reproduce the problem?
1. Run the program in the winpython ide

What is the expected output? What do you see instead?
This is what I see.
>>> runfile('C:/WinPython-64bit-2.7.6.4/scripts/script.py', 
wdir=r'C:/WinPython-64bit-2.7.6.4/scripts')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\WinPython-64bit-2.7.6.4\python-2.7.6.amd64\lib\site-packages\spyderlib\widgets\externalshell\sitecustomize.py", line 540, in runfile
    execfile(filename, namespace)
  File "C:/WinPython-64bit-2.7.6.4/scripts/script.py", line 3, in <module>
    import pyodbc

What version of the product are you using? On what operating system?
WinPython 2.7 on Windows 7 64 bit

Please provide any additional information below.

Original issue reported on code.google.com by travlr2...@gmail.com on 13 Jun 2014 at 5:03