ModuleNotFoundError: No module named 'windows&

2020-03-30 04:28发布

I'm working on a project and I need to use the PyMouse module.

pip install pymouse

installed pymouse correctly, so I assumed all was fine. However, when importing PyMouse:

from pymouse import PyMouse

I got the following error running my program:

Traceback (most recent call last):
  File "4opeenrij.py", line 1, in <module>
    from pymouse import PyMouseEvent
  File "C:\Users\lcdew\AppData\Local\Programs\Python\Python37-32\lib\site-packages\pymouse\__init__.py", line 92, in <module>
    from windows import PyMouse, PyMouseEvent
ModuleNotFoundError: No module named 'windows'

I can't seem to figure out what might cause this error message. Any help would be much appreciated.

Additional info:

I'm using Python 3.7 32 bit

Current pip version: 18.1

I have Windows 10

working on a 64-bit operating system

标签: python-3.7
1条回答
Animai°情兽
2楼-- · 2020-03-30 05:06

I had I look into this and became puzzled at first, so looked deeper. It turns out that pymouse is absolutely full of errors. More that I bothered to find. The error you got is just one of many errors caused by bad coding.

The code says:

from windows import PyMouse, PyMouseEvent

And it should say:

from .windows import PyMouse, PyMouseEvent

Also, PyUserInput, a sister package that is free from the pymouse errors, requires pyhook, which is unsupported by python 3. After a lot of looking around, the conclusion that there is no way around the problems found, except maybe installing a really early version.

You could also try the keyboard module.

查看更多
登录 后发表回答