mhammond / pywin32

Python for Windows (pywin32) Extensions
5.06k stars 799 forks source link

pip install works, setuptools doesn't (Windows Python 3.6.8) #1320

Open fdav10 opened 5 years ago

fdav10 commented 5 years ago

I'm finding that installing pywin32 using pip succeeds whereas listing it as a dependency using the install_requires argument to setup in a setup.py file fails. This is on Windows 10 using Python 3.6.8 64 bit and pywin32==224.

My steps:

Pip install

  1. Set up an empty virtual env
  2. pip install pywin32
  3. python -c "import win32api"

Results in no output - i.e. successful imoprt

Setuptools

  1. Set up another fresh virtualenv
  2. create a minimal setup.py consisting of:
    
    from setuptools import setup

setup(name='testpackage', version=1, install_requires=[ "pywin32", ])

3. at shell run `python setup.py install`
4. `python -c "import win32api"`
5.  On my machine this results in 

Traceback (most recent call last): File "", line 1, in ModuleNotFoundError: No module named 'win32api'

macginitie commented 5 years ago

when I try "pip install pywin32" I get: Could not find a version that satisfies the requirement pywin32 (from versions: ) No matching distribution found for pywin32

Aareon commented 5 years ago

Looks suspiciously like a circular dependency issue

shriharshmishra commented 5 years ago

when I try "pip install pywin32" I get: Could not find a version that satisfies the requirement pywin32 (from versions: ) No matching distribution found for pywin32

I am also facing similar issue when running - pip install -r requirements.txt and my requirement.txt contains pywin32==224

Avasam commented 8 months ago

3. at shell run python setup.py install

Note to readers that python setup.py and the use of setup.py as a command line tool are deprecated. pywin32 itself needs to move away from it. #2208

Avasam commented 2 months ago

@fdav10 Due to many changes in the Python packaging ecosystem and improvements to pywin32's own installation, could you try again using:


@shriharshmishra & @macginitie Could you also make sure you are trying to install from a Windows machine ?