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

Pywin32 issues running under embedded python #12

Open
Zarxrax opened this issue Jan 13, 2025 · 2 comments
Open

Pywin32 issues running under embedded python #12

Zarxrax opened this issue Jan 13, 2025 · 2 comments

Comments

@Zarxrax
Copy link

Zarxrax commented Jan 13, 2025

Hi, thanks for PythonEmbed4Win, this is been very helpful!
I came across some issues with the package Pywin32, and was wondering how PythonEmbed4Win might be updated to better accommodate it?
It turns out this package was a dependency of a dependency of a dependency for another application I was trying to run, so I don't really know why it may not be working correctly with embedded python, but it looks like it copies some dll files and has a script that runs post install.
There is more info here: mhammond/pywin32#1618
However, I tried the steps listed there, but couldn't resolve the issue.

@jtmoon79
Copy link
Owner

Hi @Zarxrax thanks for reporting.
Can you list the exact commands you ran, and the exact error that occurred, and the platform you are running on?

@Zarxrax
Copy link
Author

Zarxrax commented Feb 16, 2025

Hi, thanks for getting back to me.
It ultimately turned out that the pywin32 package was not a critical dependency, and I was able to easily remove it from what I was using, so I don't particularly care about it any more.
But for completeness, I was trying to install SAM2. Following the instructions they provide for installation and the sample code for image prediction. (and I am running windows 10)
Then it would ultimately come down to the following error:

    import portalocker  # type: ignore
    ^^^^^^^^^^^^^^^^^^
  File "F:\sam2\python-3.12.5-embed-amd64\Lib\site-packages\portalocker\__init__.py", line 1, in <module>
    from . import __about__, constants, exceptions, portalocker
  File "F:\sam2\python-3.12.5-embed-amd64\Lib\site-packages\portalocker\portalocker.py", line 22, in <module>
    import pywintypes
ModuleNotFoundError: No module named 'pywintypes'

And searching about "No module named 'pywintypes'" on Google showed me many posts talking about a post-installation script which led me to the github issue I linked in my first post.

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

No branches or pull requests

2 participants