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

Python: Fix issue related to Pyenchant with executing linters on Apple Silicons #4818

Conversation

dhruv-pratap
Copy link
Contributor

If you are using an M1 Mac to run tox, there is currently an issue with pyenchant that you would run into while running linters. This happens because python distributions installed by pyenv are in the default M1 architecture (aarch64), and can't find a compatible enchant library. As a workaround, you can follow the below steps.

Install enchant with Homebrew

brew install enchant

Set environment variable PYENCHANT_LIBRARY_PATH to point to the installed enchant library before running tox.

export PYENCHANT_LIBRARY_PATH = /opt/homebrew/lib/libenchant-2.dylib

You can set this environment variable in your ~/.zshrc or in your IDE to avoid doing it everytime.

Copy link
Contributor

@Fokko Fokko left a comment

Choose a reason for hiding this comment

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

Looks good. Still not sure why at @samredai it worked right away after installing enchant without setting the environment variable.

@samredai are you on M1 as well?

python/README.md Show resolved Hide resolved
python/README.md Outdated Show resolved Hide resolved
python/README.md Outdated Show resolved Hide resolved
@samredai
Copy link
Collaborator

riable.

@samredai are you on M1 as well?

I actually was using an intel macbook when we fixed this (my primary workstation 😄 ). I do have an M1 so I'll try this out there to confirm I get the same issue and I'll try the solution described in this PR.

dhruv-pratap and others added 3 commits May 19, 2022 15:26
Co-authored-by: Fokko Driesprong <fokko@apache.org>
Co-authored-by: Fokko Driesprong <fokko@apache.org>
@kbendick
Copy link
Contributor

I have an M1 macbook as well, so I can test this out too. I am still using my Intel macbook as my primary computer while working on migrating to the M1 machine,

@samredai
Copy link
Collaborator

samredai commented Jun 1, 2022

Looks like we need to resolve this conflict now that tox has been replace by pre-commit. @Fokko is there a way to pass the PYENCHANT_LIBRARY_PATH to the venv? Would this be done in the Poetry config?

@Fokko Fokko mentioned this pull request Jun 17, 2022
@rdblue
Copy link
Contributor

rdblue commented Jun 28, 2022

I'm going to close this since it is documentation for tox, but we've switched to using pre-commit and poetry. Thanks, @dhruv-pratap!

@rdblue rdblue closed this Jun 28, 2022
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.

None yet

5 participants