안녕하세요,
재재입니다.
pipenv 가 설치되었으나,
가상환경 진입에 문제 pipenv AttributeError가 발생했을 때 해결방법입니다.
(1) 가상환경 진입 (실패)
pipenv --version
Traceback (most recent call last):
File "/usr/bin/pipenv", line 33, in <module>
sys.exit(load_entry_point('pipenv==11.9.0', 'console_scripts', 'pipenv')())
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 722, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 696, in main
with self.make_context(prog_name, args, **extra) as ctx:
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 621, in make_context
self.parse_args(ctx, args)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 1018, in parse_args
rest = Command.parse_args(self, ctx, args)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 875, in parse_args
parser = self.make_parser(ctx)
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 821, in make_parser
for param in self.get_params(ctx):
File "/usr/lib/python3/dist-packages/pipenv/vendor/click/core.py", line 774, in get_params
help_option = self.get_help_option(ctx)
File "/usr/lib/python3/dist-packages/pipenv/cli.py", line 26, in get_help_option
from .import core
File "/usr/lib/python3/dist-packages/pipenv/core.py", line 21, in <module>
import requests
File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/__init__.py", line 65, in <module>
from . import utils
File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/utils.py", line 27, in <module>
from .cookies import RequestsCookieJar, cookiejar_from_dict
File "/usr/lib/python3/dist-packages/pipenv/vendor/requests/cookies.py", line 172, in <module>
class RequestsCookieJar(cookielib.CookieJar, collections.MutableMapping):
AttributeError: module 'collections' has no attribute 'MutableMapping'
(2) pipenv AttributeError 해결방법
apt 로 설치된 pipenv package 를 삭제해주세요.
그리고, pip 로 다시 설치해주시면 됩니다.
sudo apt remove pipenv
pip install pipenv
(3) 정상동작 확인
pipenv shell
pipenv AttributeError 해결하기