Pip install on a fresh python 3.6 fails with NameError: name 'win32console' is not defined

it looks like the odrive install script cannot work unless pywin32 is installed upfront.

I had just installed a fresh python 3.6 32bits on a win7 and i got

NameError: name ‘win32console’ is not defined

after installing pywin32, odrive successfully installed.

ocal\Programs\Python\Python36-32\python.exe -m pip install odrive
Collecting odrive
Using cached https://files.pythonhosted.org/packages/f6/a6/a6d88eebc45d45beab2
Complete output from command python setup.py egg_info:
Could not init terminal features.
Traceback (most recent call last):
File “”, line 1, in
File “C:\Users\FRMTBU~1.DEC\AppData\Local\Temp\pip-install-b97ig9zt\odrive
\setup.py”, line 48, in
import odrive.version
File “C:\Users\FRMTBU~1.DEC\AppData\Local\Temp\pip-install-b97ig9zt\odrive
\odrive_init_.py”, line 8, in
import fibre
File “C:\Users\FRMTBU~1.DEC\AppData\Local\Temp\pip-install-b97ig9zt\odrive
\fibre_init_.py”, line 2, in
from .discovery import find_any, find_all
File “C:\Users\FRMTBU~1.DEC\AppData\Local\Temp\pip-install-b97ig9zt\odrive
\fibre\discovery.py”, line 113, in
timeout=None, logger=Logger(verbose=False)):
File “C:\Users\FRMTBU~1.DEC\AppData\Local\Temp\pip-install-b97ig9zt\odrive
\fibre\utils.py”, line 152, in init
self._stdout_buf = win32console.GetStdHandle(win32console.STD_OUTPUT_HAN
NameError: name ‘win32console’ is not defined


Command “python setup.py egg_info” failed with error code 1 in C:\Users\FRMTBU~1

forget it.
it’s clearly documented that pywin32 should installed first.


Your error dump is still useful, this false install-time dep that is preventing the automatic installation is something we want to fix soon.

Interestingly, when i install from a vanilla python environment, I get the failure unless I install pywin32==223 first, which is then replaced by 222 during odrive install. After install, odrive doesn’t run until i replace 222 with 223 again. If in install with anaconda, version 222 does the trick.

for the record, on two win7 64bits machines, both running a fresh install of python 3.6, i got a
“could not load DLL” issue. but the issue would not reproduce on my win10 laptop with same fresh python 3.6

interestingly, the error was from
import win32console
(i could reproduce it just by making a single line python script)

by using ProcMon, i nailed down the problem being pywintypes36.dll not found in the path
I solved it by copy/pasting pywintypes36.dll and pythoncom36.dll

Also, for those looking for the odrivetool on windows, it’s burried in

(probably some path wasn’t made properly by the python install i guess)

Thanks for that tip, although copying those dll’s to System32 didn’t work for me. I copied them to the C:\Users\<<username>>\AppData\Local\Programs\Python\Python36\Scripts folder where the ordrivetool scrip sits and that worked out for me. I guess System32 is just not in pythons path for modules for me somehow.