Page 1 of 1

Spyder Help

Posted: Fri Nov 03, 2023 5:48 pm
by TopBadger
Request to the hivemind... any Spyder users here that have successfully got pywin32 to import?

Spyder doesn't include it OOB so they have a video on how to build a different environment with the packages you want

https://www.youtube.com/watch?v=i7Njb3xO4Fw&t=35s

I followed this guidance and added "pywin32" to the conda install:

C:\Users\xxxxx>conda install spyder-kernels pywin32 -y

pywin32 is listed in the packages to download, and pywin-305 (latest version) shows as installed. Yet when I try to import it I get the dreaded:

ModuleNotFoundError: No module named 'pywin32'

No idea what is going wrong. It's at times like these that I really hate Python.

Re: Spyder Help

Posted: Fri Nov 03, 2023 6:20 pm
by jaap
As far as I understand it, pywin32 is not the name of a module. The package pywin32 has various modules in it, none of which have the name of the package.

(P.S. I now nothing about Spyder, and very little about Python, so this may well be completely wrong)

Re: Spyder Help

Posted: Fri Nov 03, 2023 7:20 pm
by Holylol

Re: Spyder Help

Posted: Sun Nov 05, 2023 5:19 pm
by nekomatic
If the above suggestions don’t include the answer, you may need to make sure Spyder is using the Python interpreter from the same environment you installed pywin32 in. If the env is called myenv and you do

conda activate myenv
spyder

then it should work, but if not then check the interpreter setting in Spyder’s preferences.

Which programming languages do you like then?

Re: Spyder Help

Posted: Mon Nov 06, 2023 9:31 am
by TopBadger
Thanks all... win32com is indeed the module name I need and not the package name.

Now I just need to work through the other vagaries of COM.

I like Python... my statement could equally have been "at times like this I hate coding".