Troubleshooting
poetry 오류 ImportError: cannot import name 'user_data_dir' from 'platformdirs' (unknown location)
Wibaek
2024. 2. 9. 12:19
728x90
MacOS 환경에서 brew로 poetry install을 하여 1.6.1 -> 1.7.1 버전 업그레이드를 했을때 문제가 발생했다. poetry쪽 문제는 아니고 brew쪽의 문제인듯?
brew install python-platformdirs 로 설치해주라는 해결 방법을 찾았다.
wibaek@Wibaeks-MacBook-Air ~ % brew install python-platformdirs
Warning: python-platformdirs 4.2.0 is already installed, it's just not linked.
To link this version, run:
brew link python-platformdirs
실행 해보니 이미 존재하고 link를 해달라 했고,
wibaek@Wibaeks-MacBook-Air ~ % brew link python-platformdirs
Linking /opt/homebrew/Cellar/python-platformdirs/4.2.0...
Error: Could not symlink lib/python3.11/site-packages/platformdirs/__init__.py
Target /opt/homebrew/lib/python3.11/site-packages/platformdirs/__init__.py
already exists. You may want to remove it:
rm '/opt/homebrew/lib/python3.11/site-packages/platformdirs/__init__.py'
To force the link and overwrite all conflicting files:
brew link --overwrite python-platformdirs
To list all files that would be deleted:
brew link --overwrite --dry-run python-platformdirs
링크중 오류 발생했고 뭔가 많이 쌓인것 같아 그냥 force overwrite 했다.
wibaek@Wibaeks-MacBook-Air ~ % brew link --overwrite python-platformdirs
Linking /opt/homebrew/Cellar/python-platformdirs/4.2.0... 32 symlinks created.
이후 문제 해결.
https://github.com/python-poetry/poetry/issues/8853
728x90