IJ_123
IJ_123

Reputation: 507

Unable to install pypiwin32 and win10toast

I upgraded to Python 3.10.0 and I am unable to install a few modules using pip. This problem wasn't there for older versions.

When I try to pip install pypiwin32, it gives the following error:

ERROR: Command errored out with exit status 1:
     command: 'C:\Users\username\AppData\Local\Programs\Python\Python310\python.exe' -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-d9m6kfyx\\pypiwin32_e35bdff1e22f442e83e718653c555e3a\\setup.py'"'"'; __file__='"'"'C:\\Users\\username\\AppData\\Local\\Temp\\pip-install-d9m6kfyx\\pypiwin32_e35bdff1e22f442e83e718653c555e3a\\setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base 'C:\Users\username\AppData\Local\Temp\pip-pip-egg-info-c3dic37e'
         cwd: C:\Users\username\AppData\Local\Temp\pip-install-d9m6kfyx\pypiwin32_e35bdff1e22f442e83e718653c555e3a\
    Complete output (6 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:\Users\username\AppData\Local\Temp\pip-install-d9m6kfyx\pypiwin32_e35bdff1e22f442e83e718653c555e3a\setup.py", line 121
        print "Building pywin32", pywin32_version
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    SyntaxError: Missing parentheses in call to 'print'. Did you mean print(...)?
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/2b/ca/5c086c18de8f70222787b3e824e755b68d99272531522e77bb381d4f60c8/pypiwin32-219.zip#sha256=06d478295c89dbdd4187e1ac099bb8eab93c29e298bded4e2fbc77009287fa44 (from https://pypi.org/simple/pypiwin32/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement pywin32>=223 (from pypiwin32) (from versions: none)
ERROR: No matching distribution found for pywin32>=223

Is there any way to solve this? The same error occurs when I try to install win10toast.

Any help would be appreciated.

If you want: I am on Windows 11 build 22000.194 (the stable one) This issue was happening even when I was on Win10.

Thanks and regards, Ishaan

Upvotes: 1

Views: 4491

Answers (2)

foosion
foosion

Reputation: 7898

You can download the wheels file from https://github.com/mhammond/pywin32/actions/runs/1250371344, extract the wheel for python 3.10 and install that with pip. The wheels file is a zip.

pip install pywin32-301.1-cp310-cp310-win_amd64.whl

Upvotes: 2

FlyingTeller
FlyingTeller

Reputation: 20472

The most recent version of pywin32 only has whl files on pypi, but those go up to python 3.9. That is why you didn't have any issues with python versions <=3.9. Now that you are at 3.10, pip has no other option than to go back through the version list and grab the latest version that had a source package available.

From your error, it seems that said version is written in python2. Something you can try is to install pywin32 directly from the github source code

Be aware though that , currently, python 3.10 is rather new and you will probably face similar issues with other packages for some time. If you don't desperately need features from 3.10, it might be better for you to just stick to an earlier python version with better support.

Upvotes: 2

Related Questions