1

I am trying to build a test Django application and I want to connect to a MSSQL server. When I tried running my program I get an error ImportError: No module named pythoncom. So I figured it's a missing module so I downloaded pywin32(32bit) for python 2.7 and installed it(Successfully). The problem is that error still appears and I can't seem to get rid of it. I've tried everything from running the install as admin to ActivePtyhon(freezes at determining disk space..)

This is the original Exception message:

    self.ensure_connection()
  File "C:\Users\pce-coop\Desktop\Test Power Monitoring App\Test Django App\Blan
kProject\BlankProject\env\lib\site-packages\django\db\backends\__init__.py", lin
e 133, in ensure_connection
    self.connect()
  File "C:\Users\pce-coop\Desktop\Test Power Monitoring App\Test Django App\Blan
kProject\BlankProject\env\lib\site-packages\django\db\backends\__init__.py", lin
e 122, in connect
    self.connection = self.get_new_connection(conn_params)
  File "C:\Users\pce-coop\Desktop\Test Power Monitoring App\Test Django App\Blan
kProject\BlankProject\env\lib\site-packages\sqlserver_ado\base.py", line 244, in
 get_new_connection
    conn = Database.connect(**conn_params)
  File "C:\Users\pce-coop\Desktop\Test Power Monitoring App\Test Django App\Blan
kProject\BlankProject\env\lib\site-packages\sqlserver_ado\dbapi.py", line 171, i
n connect
    import pythoncom
ImportError: No module named pythoncom
john
  • 3,949
  • 7
  • 34
  • 56
  • duplicate of http://stackoverflow.com/questions/4145079/importerror-no-module-named-pythoncom – sax Feb 11 '15 at 19:44
  • I already looked at the post and tried everything it suggested and it still doesn't work... hence why I posted the question – john Feb 11 '15 at 20:29

2 Answers2

0

used easy_install in my virtual environment and instead of entering the command, I used the path name to the pywin32.exe. In my case it was "C:\Users\PC\Downloads\pywin32-219.win32-py2.7.exe"

john
  • 3,949
  • 7
  • 34
  • 56
0

pythoncom is also included in pypiwin32 package:

> pip install pypiwin32
Leonel Sanches da Silva
  • 6,972
  • 9
  • 46
  • 66