Home [Python] M1에서 Could not import the lzma module
Post
Cancel

[Python] M1에서 Could not import the lzma module

해결방법

1
2
3
>>> import pandas
UserWarning: Could not import the lzma module. Your installed Python is incomplete. Attempting to use lzma compression will result in a RuntimeError.
  warnings.warn(msg)
1
2
3
brew install xz
brew install readline xz
brew install lima

해도 에러가 계속 나고 있어서 찾아보니, M1에서는 아래와 같이 설치

1
2
pyenv uninstall 3.9.4
CFLAGS="-I$(brew --prefix xz)/include" LDFLAGS="-L$(brew --prefix xz)/lib" pyenv install 3.9.4

잘 동작한다.

Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas as pd

참고

This post is licensed under CC BY 4.0 by the author.

[MySQL] Docker로 실행했을때 한글 깨짐

[Airflow] Docker로 실행하기 Apple Silicon