question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Installing pypiwin32 Fails; Python 2.x Print Statement?

See original GitHub issue

Details

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!

Expected Result

Installation of pypiwin32

Actual Result

Error message during build as shown above.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
jmdelahantycommented, Oct 11, 2021

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!

1reaction
jmdelahantycommented, Nov 17, 2021

I have solved the problem! It turns out I was mocking things incorrectly because in my module I use win32com to actually use pywin32!

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found