Spyder Help

Get your science fix here: research, quackery, activism and all the rest
Post Reply
User avatar
TopBadger
Catbabel
Posts: 789
Joined: Mon Nov 11, 2019 6:33 pm
Location: Halfway up

Spyder Help

Post by TopBadger » Fri Nov 03, 2023 5:48 pm

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.
You can't polish a turd...
unless its Lion or Osterich poo... http://dsc.discovery.com/videos/mythbus ... -turd.html

User avatar
jaap
Catbabel
Posts: 680
Joined: Mon Nov 11, 2019 2:05 pm
Location: Netherlands
Contact:

Re: Spyder Help

Post by jaap » Fri Nov 03, 2023 6:20 pm

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)

Holylol
Sindis Poop
Posts: 79
Joined: Tue Nov 19, 2019 10:14 am

Re: Spyder Help

Post by Holylol » Fri Nov 03, 2023 7:20 pm


User avatar
nekomatic
Dorkwood
Posts: 1380
Joined: Mon Nov 11, 2019 3:04 pm

Re: Spyder Help

Post by nekomatic » Sun Nov 05, 2023 5:19 pm

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?
Move-a… side, and let the mango through… let the mango through

User avatar
TopBadger
Catbabel
Posts: 789
Joined: Mon Nov 11, 2019 6:33 pm
Location: Halfway up

Re: Spyder Help

Post by TopBadger » Mon Nov 06, 2023 9:31 am

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".
You can't polish a turd...
unless its Lion or Osterich poo... http://dsc.discovery.com/videos/mythbus ... -turd.html

Post Reply