9

I'm trying to install the pywin32 module on Ubuntu for python 3.6, I've tried pip3 install pywin32 and got the following output:

Collecting pywin32  
  Could not find a version that satisfies the requirement pywin32 (from versions: )
  No matching distribution found for pywin32

Then I tried pip3 install pypiwin32 and got the following output:

Collecting pypiwin32
  Using cached https://files.pythonhosted.org/packages/d0/1b/2f292bbd742e369a100c91faa0483172cd91a1a422a6692055ac920946c5/pypiwin32-223-py3-none-any.whl
Collecting pywin32>=223 (from pypiwin32)
  Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: )
No matching distribution found for pywin32>=223 (from pypiwin32)
1
  • i have same problem. how can salve this on ubuntu 20.04 Commented Aug 22, 2023 at 8:51

3 Answers 3

8

The pywin32 and pypiwin32 is "Python extensions for Microsoft Windows Provides access to much of the Win32 API, the ability to create and use COM objects, and the Pythonwin environment."

One supported OS is Microsoft Windows, because you can access the Win32 API only from Windows.


Source: https://pypi.org/project/pywin32/

Sign up to request clarification or add additional context in comments.

1 Comment

I am currently working on Windows machine and the pipeline is present in Gitlab with linux env. Is it possible to use the same requirements.txt file with "pywin32" package in both environments without updating it and it failing at "pywind32" step in Gitlab?
5

requirements.txt files for packages which are designed to run on multiple operating systems should not attempt to install pywin32 unless running on Windows. The line in requirements.txt should look like pywin32;sys_platform == 'win32' Also, any import statements in the Python code must test for Windows first. Things which are done using Windows system calls (which is what pywin32 is for) must be done another way -- such as using Posix system calls.

2 Comments

thanks, good explanation; meant I didn't have to fiddle with the requirements.txt file between windows and linux
I had to remove the library in the Linux requirements file and it works!
0

https://superuser.com/a/924195/142674 suggests that you could do it anyways somehow, but after installing wine

Also, it seems to work for https://www.geeksforgeeks.org/how-to-install-pywin32-on-linux/, but I think he uses some sort of embedded linux on windows (KALI). (=> console showing a path starting with C:/ in the screenshot)

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.