Installing pypiwin32 Fails; Python 2.x Print Statement?
See original GitHub issueDetails
Installing pypiwin32 during RTD build fails due to what appears to be a Python 2 print statement. It collects the package successfully, but when it tries to install it I get the following message during the process:
Collecting pypiwin32
Downloading pypiwin32-219.zip (4.8 MB)
ERROR: Command errored out with exit status 1:
command: /home/docs/checkouts/readthedocs.org/user_builds/bruker-control/envs/latest/bin/python -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-1zxucya9/pypiwin32_977510538cc24a8fbce43efbe8ebacda/setup.py'"'"'; __file__='"'"'/tmp/pip-install-1zxucya9/pypiwin32_977510538cc24a8fbce43efbe8ebacda/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 /tmp/pip-pip-egg-info-ydauo4rq
cwd: /tmp/pip-install-1zxucya9/pypiwin32_977510538cc24a8fbce43efbe8ebacda/
Complete output (6 lines):
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-install-1zxucya9/pypiwin32_977510538cc24a8fbce43efbe8ebacda/setup.py", line 121
print "Building pywin32", pywin32_version
^
SyntaxError: Missing parentheses in call to 'print'. Did you mean print("Building pywin32", pywin32_version)?
I read up that the version I’m using here was built for Python 2 on the package’s pypi page, but it’s the version that works with the API I’m using to control a cool microscope.
Also, RTD is great! Thank you for all your work maintainers!
- Read the Docs project URL: https://bruker-control.readthedocs.io/en/latest/
- Build URL (if applicable): https://readthedocs.org/projects/bruker-control/builds/14893925/
- Read the Docs username (if applicable): jmdelahanty
Expected Result
Installation of pypiwin32
Actual Result
Error message during build as shown above.
Issue Analytics
- State:
- Created 2 years ago
- Comments:8 (3 by maintainers)
Top Results From Across the Web
Unable to install pypiwin32 and win10toast - Stack Overflow
From your error, it seems that said version is written in python2. Something you can try is to install pywin32 directly from the...
Read more >pyttsx3 - PyPI
pyttsx3 is a text-to-speech conversion library in Python. Unlike alternative libraries, it works offline, and is compatible with both Python 2 and 3....
Read more >Issues closed in the 1.0 development cycle — IPython 7.30.0 ...
This documentation covers IPython versions 6.0 and higher. Beginning with version 6.0, IPython stopped supporting compatibility with Python versions lower than ...
Read more >i am installing wordcloud using pip but i am unable to do that i ...
Running setup.py install for wordcloud ... error ERROR: Command errored out with exit status 1: command: 'c:\python38\python.exe' -u -c ...
Read more >Release 4.10 David Cortesi - PyInstaller Documentation
Then you have a command shell window in which commands such as pyinstaller execute in that Python environment. 1.4.2 Installing in Mac OS...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
That makes sense! I was looking for a way to build it without mocking the imports. I’ve tried mocking before, but didn’t seem to get it working properly. I’ll give that a shot today and see if I make any progress. I’ll update here if I run into any issues. Thank you so much for your help!
I have solved the problem! It turns out I was mocking things incorrectly because in my module I use
win32com
to actually usepywin32
!When I have:
autodoc_mock_imports = ['win32com']
My docs build like they’re supposed to!
I’ll close the issue with this. Thanks for all your help everyone!