3

Importing winshell (version 0.6) causes the following error:

>>> import winshell
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Python39\lib\site-packages\winshell.py", line 32, in <module>
    from win32com.shell import shell, shellcon
ImportError: DLL load failed while importing shell: The specified procedure could not be found.
egeres
  • 77
  • 3
  • 9
  • 1
    winshell doesn't claim to be supported on any version of Python newer than 3.2, according to the GitHub page you link to, nor on any version of Windows newer than Windows 7 [(link)](https://winshell.readthedocs.io/en/latest/). The project seems abandoned, as the GitHub repository hasn't been updated for over 7 years, so errors are perhaps to be expected. – Luke Woodward Mar 25 '22 at 11:06
  • Oh, you're right... – egeres Mar 25 '22 at 11:14

7 Answers7

8

I finally managed to get Anaconda to start working by executing the line:

pip install pywin32==300

I had to do it twice, because the first time it went for 301, not 300. The second time then dropped it to 300. This was from the Anaconda for Windows installer downloaded just two days ago from the Anaconda website and doing a "clean install"!

What a fiasco!

Until that point, NOTHING really worked. Almost every important command within Anaconda would fail with the Win32com error, and Navigator would not even start. Apparently the latest version of pywin32 is 304, but it doesn't work either. Is anyone looking into this? For a newbie like me, this is a very bad look for Anaconda as a tool! I was on the brink of simply giving up when I literally stumbled onto this thread.

Note that it has been MONTHS between my post and the one before mine. I'd say that this has probably caused a lot of people to simply give up (assuming that there are many who actually try to install this on Windows per month, that is).

Alex T
  • 375
  • 3
  • 8
5

I've had similar in the past,was about to give up on Anaconda. Here's the solution

Apparently the wrong version of pywin32 gets installed.

I had the installed version 301 and after downgrading to 228 with pip install --upgrade pywin32==228 everything just started working.

2

Try pip install --upgrade pywin32==228

This should resolve the issue

0

Version 300 of pywin32 solved this issue for me! Check this other question for more info

egeres
  • 77
  • 3
  • 9
  • 1
    While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes. - [From Review](/review/late-answers/31889468) – Emi OB Jun 01 '22 at 07:59
0

Had the same issue with Conda and librosa in Python 3.9.

Librosa references from win32com.shell import shellcon,shell, which was causing the same error you received.

Installing pywin32 via conda fixed the error for me:

conda install -c conda-forge librosa
jbnunn
  • 6,161
  • 4
  • 40
  • 65
0

I ran into this issue when trying to get Anaconda to run at all on a new installation. I followed Alex T's recommendation to install version 300 of pywin32. Like him, I had to run it twice because it first installed version 302 for some reason. After running it the second time I can now run conda commands in that environment

pip install pywin32==300
0

My simple solution is to install an Older version of Anaconda. This worked perfectly for me. I installed Anaconda3-2021.11-Windows-x86 version.

The Newer Version of Anaconda has some problems with pywin32. I first tried the command :

pip install --upgrade pywin32==228

but It didn't workd for me. Installing an older version finally solved the problem of anaconda navigator not launching.

Yash
  • 1
  • 1