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

[Poetry]: Can't install xlwings; Could not find a version that satisfies the requirement pywin32==227 #1265

Closed
paxcodes opened this issue Feb 22, 2020 · 12 comments · Fixed by #1855
Milestone

Comments

@paxcodes
Copy link

paxcodes commented Feb 22, 2020

OS

macOS Mojave

Versions of xlwings, Excel and Python

Python 3.7.4

Describe your issue (incl. Traceback!)

When I install xlwings, it gives an error. (I use poetry if that makes any difference. But I think it shouldn't since it uses pip under the hood.)

$ poetry add xlwings
Using version ^0.18.0 for xlwings

Updating dependencies
Resolving dependencies... (3.7s)

Writing lock file


Package operations: 3 installs, 0 updates, 0 removals

  - Installing comtypes (1.1.7)
  - Installing pywin32 (227)

[EnvCommandError]
Command ['/Users/iflc/Library/Caches/pypoetry/virtualenvs/basecamp-CocmzNCA-py3.7/bin/pip', 'install', '--no-deps', 'pywin32==227'] errored with the following return code 1, and output: 
Collecting pywin32==227
  Could not find a version that satisfies the requirement pywin32==227 (from versions: )
No matching distribution found for pywin32==227
@fzumstein
Copy link
Member

It's in fact a poetry issue, same as here: python-poetry/poetry#1287
The easiest fix for that would probably be to upload wheels instead of only the current source package.

@fzumstein fzumstein changed the title Can't install xlwings; Could not find a version that satisfies the requirement pywin32==227 Can't install xlwings; Could not find a version that satisfies the requirement pywin32==227 [wheels would fix] Feb 22, 2020
@marcosfelt
Copy link

marcosfelt commented Feb 25, 2021

It seems that xlwings needs to switch to the environment markers specification. Something like this in setup.py:

install_requires = [
    "pywin32>=224; sys_platform==win; python_version>=3.7",
    "pywin32; sys_platform==win; python_version<3.7",
    "psutil>=2.0.0; sys_platform==darwin",
    "appscript>=1.0.1; sys_platform==darwin",
]

However, I'm not sure how to handle the data_files in this case, since they are in different locations between windows and MacOS.

It's unfortunate that xlwings currently doesn't work with poetry, so I'd like to fix that.

@fzumstein
Copy link
Member

are you using poetry?

@marcosfelt
Copy link

Yes, and the error is still the same as the OP

@marcosfelt
Copy link

Perhaps the way around the issue with setup.py is to use pathlib.symlink_to in init.py, which completely removes the need for data_files.

@fzumstein
Copy link
Member

for the time being, you should be able to install pywin32 directly, correct?

@marcosfelt
Copy link

The issue is on MacOS. Poetry somehow skips the sys.platform code and tries to install pywin32 on Mac.

@fzumstein
Copy link
Member

gotcha

@fzumstein fzumstein changed the title Can't install xlwings; Could not find a version that satisfies the requirement pywin32==227 [wheels would fix] [Poetry]: Can't install xlwings; Could not find a version that satisfies the requirement pywin32==227 [wheels would fix] Feb 25, 2021
@jaymegordo
Copy link

+1 also having this issue!

@stonebig
Copy link

PyPy3 is not support per pywin32, would it be possible to switch to alternate ctypes thing ? like in jupyter/jupyter_core#230

@fzumstein
Copy link
Member

PyPy3 is not support per pywin32, would it be possible to switch to alternate ctypes thing ? like in jupyter/jupyter_core#230

see #1603

@fzumstein
Copy link
Member

@fzumstein fzumstein changed the title [Poetry]: Can't install xlwings; Could not find a version that satisfies the requirement pywin32==227 [wheels would fix] [Poetry]: Can't install xlwings; Could not find a version that satisfies the requirement pywin32==227 Feb 9, 2022
@fzumstein fzumstein added this to the 0.27.0 milestone Mar 7, 2022
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

5 participants