Winshell error win32con not found after installing Python winshell

Question:

Traceback (most recent call last):
  File "C:/Users/owner/Desktop/2/test2.py", line 1, in <module>
    import os, winshell
  File "C:py35libsite-packageswinshell.py", line 30, in <module>
    import win32con
ImportError: No module named 'win32con'

I’ve seen:
http://error.news/question/6131746/why-does-pip-install-winshell-not-work-on-python-v342/

But I installed pywin32 64 bit separately and done it via the exe:

https://drive.google.com/file/d/0B2FZnKhR7OOJZ1hYZER2WUwyUzA/view?usp=sharing&resourcekey=0-smer5McVyGEsbvsm6DJPHg

So how about: Why does pip install winshell not work on Python v3.4.2?

Err, no. I Installed it separtely.

I then went to see: What's win32con module in python? Where can I find it?

I need to know: What do I need to do to get winshell to work. I have manually installed pywin32 (64bit), I ran the exe for pywin32 (64bit) and completed it successfully, I then proceeded to CMD and did:

cd c:py35scripts
pip install winshell

The install completed successfully. However, importing winshell still doesn’t work!

Asked By: Luke

||

Answers:

IT WORKED AT LAST
What I did:
Run CMD with elevated privileges and commands:

cd pathtopythondirectoryscripts
pywin32_postinstall.py -install

Turns out that this would not have run and the DLLs would not have copied over correctly if you didn’t have full admin.

Also a very notable page: https://blogs.msdn.microsoft.com/pythonengineering/2016/04/11/unable-to-find-vcvarsall-bat/

Answered By: Luke

There is a bug in the dependencies list for the winshell package. The pypiwin32 package is required. This bug has already been reported to the maintainers of the winshell package, but unfortunately it appears that the maintainers have stopped supporting it. I used the winshell package from http://www.lfd.uci.edu/~gohlke/pythonlibs/#winshell since it is newer (ver. 0.6.4) than the one on PyPI (ver. 0.6). See What's win32con module in python? Where can I find it? for more information and helpful links.

pip install pypiwin32
[Download Gohlke's package to a local folder, C:downloadsnew in this example.]
pip install C:downloadsnewwinshell-0.6.4-py2.py3-none-any.whl
Answered By: JPaget

While some people say to do various things in an elevated command prompt, what worked for me was to just run pip install pywin32 in a normal command prompt.

Answered By: Allan