python3.10
이 기본인 ubuntu 22.04에서 python3.9 설치 후 virtualenv로 환경을 분리했다.activate
하고 평상시처럼 pip3 install -r requirements.txt
로 의존성 설치 시도시 아래의 오류가 발생한다. Traceback (most recent call last):
File "/home/seongheum/pyconkr/zappa/bin/pip3", line 5, in <module>
from pip._internal.cli.main import main
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/cli/main.py", line 9, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/cli/autocompletion.py", line 10, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/cli/main_parser.py", line 9, in <module>
from pip._internal.build_env import get_runnable_pip
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/build_env.py", line 20, in <module>
from pip._internal.cli.spinners import open_spinner
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/cli/spinners.py", line 9, in <module>
from pip._internal.utils.logging import get_indentation
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/utils/logging.py", line 29, in <module>
from pip._internal.utils.misc import ensure_dir
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/utils/misc.py", line 42, in <module>
from pip._internal.locations import get_major_minor_version
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/locations/__init__.py", line 67, in <module>
from . import _distutils
File "/home/seongheum/pyconkr/zappa/lib/python3.9/site-packages/pip/_internal/locations/_distutils.py", line 20, in <module>
from distutils.cmd import Command as DistutilsCommand
ModuleNotFoundError: No module named 'distutils.cmd'
sudo apt-get install python3-distutils
이걸 해보라고 해서 설치해보았다.결과는 동일했다.
disutils
가 다르다고 다르다고 한다.참고자료: https://stackoverflow.com/questions/55749206/modulenotfounderror-no-module-named-distutils-core
나는 python3.9 사용을 원했기에, sudo apt-get install python3.9-distutils
이렇게 설치했고, 이후 정상적으로 진행가능했따.