Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Winshell error win32con not found after installing Python winshell

Traceback (most recent call last):
  File "C:/Users/owner/Desktop/2/test2.py", line 1, in <module>
    import os, winshell
  File "C:\py35\lib\site-packages\winshell.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:\py35\scripts
pip install winshell

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

like image 860
Luke Avatar asked Dec 30 '25 01:12

Luke


2 Answers

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:\downloads\new in this example.]
pip install C:\downloads\new\winshell-0.6.4-py2.py3-none-any.whl
like image 161
JPaget Avatar answered Dec 31 '25 14:12

JPaget


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

cd pathto\pythondirectory\scripts
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/

like image 31
Luke Avatar answered Dec 31 '25 14:12

Luke



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!