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

Fixed Python module installation failure on Windows #12127

Closed
wants to merge 1 commit into from

Conversation

shelaf
Copy link
Contributor

@shelaf shelaf commented Mar 6, 2021

Depending on the settings in the Windows code page, the installation of some Python modules may fail. Therefore, force the code page to UTF-8.

Description

Types of Changes

  • Core
  • Bugfix
  • New feature
  • Enhancement/optimization
  • Keyboard (addition or update)
  • Keymap/layout/userspace (addition or update)
  • Documentation

Issues Fixed or Closed by This PR

Checklist

  • My code follows the code style of this project: C, Python
  • I have read the PR Checklist document and have made the appropriate changes.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • I have tested the changes and verified that they work and don't break anything (as well as I can manage).

Depending on the settings in the Windows code page, the installation of some Python modules may fail. Therefore, force the code page to UTF-8.
@drashna drashna requested a review from a team March 7, 2021 23:32
@fauxpark fauxpark requested a review from skullydazed March 12, 2021 21:58
Copy link
Member

@fauxpark fauxpark left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you provide more details on this? How does the code page figure into it?

@shelaf
Copy link
Contributor Author

shelaf commented Mar 13, 2021

On Japanese Windows, the dotty_dict python module will fail to install without the PYTHONUTF8 variable. The default system locale for Japanese Windows is SJIS (cp932).

Collecting dotty-dict
  Using cached dotty_dict-1.3.0.tar.gz (32 kB)
    ERROR: Command errored out with exit status 1:
     command: C:/msys64/mingw64/bin/python3.exe -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:/Users/shela/AppData/Local/Temp/pip-install-8orid9bf/dotty-dict_d72650ddf926482ca2de14f98eb4cbc4/setup.py'"'"'; __file__='"'"'C:/Users/shela/AppData/Local/Temp/pip-install-8orid9bf/dotty-dict_d72650ddf926482ca2de14f98eb4cbc4/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base C:/Users/shela/AppData/Local/Temp/pip-pip-egg-info-5grnb9d1
         cwd: C:/Users/shela/AppData/Local/Temp/pip-install-8orid9bf/dotty-dict_d72650ddf926482ca2de14f98eb4cbc4/
    Complete output (5 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "C:/Users/shela/AppData/Local/Temp/pip-install-8orid9bf/dotty-dict_d72650ddf926482ca2de14f98eb4cbc4/setup.py", line 16, in <module>
        readme = readme_file.read()
    UnicodeDecodeError: 'cp932' codec can't decode byte 0x82 in position 119: illegal multibyte sequence
    ----------------------------------------
WARNING: Discarding https://files.pythonhosted.org/packages/a7/da/fc25898c4edb9549b2aac0f7329fec027d654e94d4c4b89849d4c5fff0a4/dotty_dict-1.3.0.tar.gz#sha256=eb0035a3629ecd84397a68f1f42f1e94abd1c34577a19cd3eacad331ee7cbaf0 (from https://pypi.org/simple/dotty-dict/). Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

@stale
Copy link

stale bot commented Jun 2, 2021

Thank you for your contribution!
This pull request has been automatically marked as stale because it has not had activity in the last 45 days. It will be closed in 30 days if no further activity occurs. Please feel free to give a status update now, or re-open when it's ready.
For maintainers: Please label with awaiting review, breaking_change, in progress, or on hold to prevent the issue from being re-flagged.

@skullydazed
Copy link
Member

Apologies for how long it took me to get back to this, initially I had hoped that upstream would release a fixed package but that hasn't materialized. I've published a qmk-dotty-dict package that should be installable without this workaround. Can you give #13460 a try?

@shelaf
Copy link
Contributor Author

shelaf commented Jul 6, 2021

I tried.

Python qmk package requires dotty_dict, so dependency definition should be qmk-dotty-dict.

@skullydazed
Copy link
Member

Python qmk package requires dotty_dict, so dependency definition should be qmk-dotty-dict.

I've released qmk 0.2.0 which changes that dependency. Can you give this another try?

@shelaf
Copy link
Contributor Author

shelaf commented Jul 13, 2021

Great!
qmk package was successfully installed without the PYTHONUTF8 variable.
As another test, I confirmed that qmk-dotty-dict package is automatically installed when I run qmk compile command after manually uninstalling qmk-dotty-dict package.

@shelaf
Copy link
Contributor Author

shelaf commented Jul 14, 2021

This issue was resolved in #13460.

@shelaf shelaf closed this Jul 14, 2021
@shelaf shelaf deleted the patch-1 branch July 14, 2021 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants