enigmaticcard
enigmaticcard

Reputation: 83

Error when installing pywin32 (on Ubuntu)

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)

Upvotes: 8

Views: 31781

Answers (3)

Aname
Aname

Reputation: 610

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)

Upvotes: 0

Vernon Cole
Vernon Cole

Reputation: 121

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.

Upvotes: 2

TerraBug1011
TerraBug1011

Reputation: 101

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/

Upvotes: 7

Related Questions