반응형
_bz2, _ctypes, readline, _ssl 등 ModuleNotFoundError
pyenv 설치 이후 아래와 같은 문제가 발생하는 경우가 있다. 필요한 라이브러리들이 설치가 안된 경우다.
문제
Downloading Python-3.8.16.tar.xz...
-> https://www.python.org/ftp/python/3.8.16/Python-3.8.16.tar.xz
Installing Python-3.8.16...
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/linuxias/.pyenv/versions/3.8.16/lib/python3.8/bz2.py", line 19, in <module>
from _bz2 import BZ2Compressor, BZ2Decompressor
ModuleNotFoundError: No module named '_bz2'
WARNING: The Python bz2 extension was not compiled. Missing the bzip2 lib?
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/linuxias/.pyenv/versions/3.8.16/lib/python3.8/ctypes/__init__.py", line 7, in <module>
from _ctypes import Union, Structure, Array
ModuleNotFoundError: No module named '_ctypes'
WARNING: The Python ctypes extension was not compiled. Missing the libffi lib?
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'readline'
WARNING: The Python readline extension was not compiled. Missing the GNU readline lib?
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/home/linuxias/.pyenv/versions/3.8.16/lib/python3.8/ssl.py", line 98, in <module>
import _ssl # if we can't import it, let the error propagate
ModuleNotFoundError: No module named '_ssl'
ERROR: The Python ssl extension was not compiled. Missing the OpenSSL lib?
해결
sudo apt-get install build-essential zlib1g-dev libffi-dev libssl-dev libbz2-dev libreadline-dev libsqlite3-dev liblzma-dev
반응형
'Language > Python' 카테고리의 다른 글
[Python] Sliding Window (0) | 2023.08.24 |
---|---|
[Python] Poetry - Jupyter (0) | 2023.05.26 |
abstract class에서 abstract property 생성하기 (0) | 2019.05.28 |
[Python] 문자열에 문자열 리스트의 요소가 포함되어 있는지 찾기 (1) | 2019.03.20 |
[python] isinstance (0) | 2019.03.12 |