Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ModuleNotFoundError: No module named 'win32gui' on the Windows installer #22112

Closed
10 tasks done
GeolChao opened this issue May 22, 2024 · 7 comments
Closed
10 tasks done

Comments

@GeolChao
Copy link

GeolChao commented May 22, 2024

Issue Report Checklist

  • Searched the issues page for similar reports
  • Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
  • Reproduced the issue after updating with conda update spyder (or pip, if not using Anaconda)
  • Could not reproduce inside jupyter qtconsole (if console-related)
  • Tried basic troubleshooting (if a bug/error)
    • Restarted Spyder
    • Reset preferences with spyder --reset
    • Reinstalled the latest version of Anaconda
    • Tried the other applicable steps from the Troubleshooting Guide
  • Completed the Problem Description, Steps to Reproduce and Version sections below

Problem Description

Sorry for potentially asking a stupid question: I installed spyder(5.5.4) via standalone Windows installer which has come with the pywin32 package. But when I run import win32gui
, I get:ModuleNotFoundError: No module named 'win32gui'

What steps reproduce the problem?

  1. pip show win32gui
  2. import win32gui

What is the expected output? What do you see instead?

I expect to see import win32gui smoothly.

Paste Traceback/Error Below (if applicable)

pip show pywin32
Name: pywin32
Version: 306
Summary: Python for Window Extensions
Home-page: https://github.com/mhammond/pywin32
Author: Mark Hammond (et al)
Author-email: mhammond@skippinet.com.au
License: PSF
Location: f:\spyder\pkgs
Requires: 
Required-by: jupyter-core
Note: you may need to restart the kernel to use updated packages.

import win32gui
Traceback (most recent call last):
  Cell In[5], line 1
    import win32gui
ModuleNotFoundError: No module named 'win32gui'

Versions

  • Spyder version: 5.5.4
  • Python version: 3.8.10 64-bit
  • Qt version: 5.15.2
  • PyQt version: 5.15.10
  • Operating System name/version: Windows 10 (AMD64)

Dependencies

# Mandatory:
atomicwrites >=1.2.0          :  1.4.1 (OK)
chardet >=2.0.0               :  5.2.0 (OK)
cloudpickle >=0.5.0           :  3.0.0 (OK)
cookiecutter >=1.6.0          :  2.6.0 (OK)
diff_match_patch >=20181111   :  20230430 (OK)
intervaltree                  :  None (OK)
IPython >=8.12.2,<8.13.0      :  8.12.3 (OK)
jedi >=0.17.2,<0.20.0         :  0.19.1 (OK)
jellyfish >=0.7               :  1.0.3 (OK)
jsonschema >=3.2.0            :  4.21.1 (OK)
keyring >=17.0.0              :  25.1.0 (OK)
nbconvert >=4.0               :  7.16.3 (OK)
numpydoc >=0.6.0              :  1.7.0 (OK)
paramiko >=2.4.0              :  3.4.0 (OK)
parso >=0.7.0,<0.9.0          :  0.8.4 (OK)
pexpect >=4.4.0               :  4.9.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.9.8 (OK)
pygments >=2.0                :  2.17.2 (OK)
pylint >=3.1,<4               :  3.1.0 (OK)
pylint_venv >=3.0.2           :  3.0.3 (OK)
pyls_spyder >=0.4.0           :  0.4.0 (OK)
pylsp >=1.11.0,<1.12.0        :  1.11.0 (OK)
pylsp_black >=2.0.0,<3.0.0    :  2.0.0 (OK)
qdarkstyle >=3.2.0,<3.3.0     :  3.2.3 (OK)
qstylizer >=0.2.2             :  0.2.2 (OK)
qtawesome >=1.3.1,<1.4.0      :  1.3.1 (OK)
qtconsole >=5.5.1,<5.6.0      :  5.5.1 (OK)
qtpy >=2.1.0                  :  2.4.1 (OK)
rtree >=0.9.7                 :  1.2.0 (OK)
setuptools >=49.6.0           :  69.2.0 (OK)
sphinx >=0.6.6                :  7.1.2 (OK)
spyder_kernels >=2.5.1,<2.6.0 :  2.5.1 (OK)
textdistance >=4.2.0          :  4.6.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog                      :  4.0.0 (OK)
zmq >=24.0.0                  :  25.1.2 (OK)

# Optional:
cython >=0.21                 :  3.0.10 (OK)
matplotlib >=3.0.0            :  3.7.5 (OK)
numpy >=1.7                   :  1.24.4 (OK)
pandas >=1.1.1                :  2.0.3 (OK)
scipy >=0.17.0                :  1.10.1 (OK)
sympy >=0.7.3                 :  1.12 (OK)

@ccordoba12
Copy link
Member

Hey @GeolChao, thanks for reporting. I'm really not sure what's happening but we'll take a look at it.

@dalthviz, could you take a look at what's happening here? Thanks!

@dalthviz
Copy link
Member

dalthviz commented Jul 9, 2024

Note: Maybe related with mhammond/pywin32#1730 (comment)

@ccordoba12
Copy link
Member

Thanks for checking @dalthviz. An additional question for you: are you able to run import win32gui in our installer? Or do you get the same error as @GeolChao?

@dalthviz
Copy link
Member

I get the same ModuleNotFoundError for win32gui but when I was checking this I also tried to import win32api and I got an ImportError:

image

Which lead me to post the Note above

@ccordoba12
Copy link
Member

Ok, and what happens with our Spyder 6 beta2 installer? I don't know if pywin32 is available there, but if it is, the problem shouldn't be present because our new installers use Conda packages.

@dalthviz
Copy link
Member

Using Spyder 6.0.0b2 installer on Windows I'm unable to reproduce this:

image

@ccordoba12 ccordoba12 added this to the v6.0rc1 milestone Jul 18, 2024
@ccordoba12 ccordoba12 changed the title ModuleNotFoundError: No module named 'win32gui' ModuleNotFoundError: No module named 'win32gui' on the Windows installer Jul 18, 2024
@ccordoba12 ccordoba12 changed the title ModuleNotFoundError: No module named 'win32gui' on the Windows installer ModuleNotFoundError: No module named 'win32gui' on the Windows installer Jul 18, 2024
@ccordoba12
Copy link
Member

Using Spyder 6.0.0b2 installer on Windows I'm unable to reproduce this

Ok, that's great!

@GeolChao, given that the error is fixed in our new installers, I'm going to close this issue as solved for Spyder 6. That version will be released in three weeks or so, so you won't need to wait too long to get it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants