#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2010
    Posts
    26
    Rep Power
    0

    Pyodbc strange issue


    Hello.
    i have posted in python.org and the pyodbc group but haven't had any luck with them yet...

    I am running windows 7 pro 64 bit and python 3.3.1 64bit and this installer of pyodbc: pyodbc-3.0.6.win-amd64-py3.3

    when i run from command line:
    Code:
    c:\> python
    >>> import pyodbc
    >>>
    everything works great!

    now when i create a py file: test1.py
    with contents:
    Code:
    import pyodbc
    and put it in C:\
    and call
    Code:
    C:/> test1.py
    i get an error that: ImportError: No module name pyodbc

    another piece of info:
    If i call python and the file..
    Code:
    C:/> python C:/test1.py
    it runs fine as well.
    What am i doing wrong in that the module is not being called in the file execution?

    thanks!
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Posts
    40
    Rep Power
    11
    I've experienced exactly the same problem with psutils and god knows how many other python modules. If you read some of my recent posts you'll see what I mean. At first I thought it was a problem with site-packages not being listed/searched in sys.path, but now I think it is a bug with that release of python.

    A possible solution for the time being is to have the folder of the things you want to import in your work directory. (If you are familiar with python source, you can try to find the bug yourself and recompile).

IMN logo majestic logo threadwatch logo seochat tools logo