728x90
pip install -U setuptools fails in fresh conda environment
setuptools 를 업그레이드하는 경우 Cannot remove entries from nonexistent file 에러가 발생하는 경우에는 다음과 같이 처리한다.
1 2 3 4 5 6 7 8 9 10 11 | # pip install -U pip setuptools Requirement already up-to-date: pip in /root/anaconda/envs/envalicia/lib/python3.5/site-packages Collecting setuptools Using cached setuptools-35.0.2-py2.py3-none-any.whl Requirement already up-to-date: packaging>=16.8 in /root/anaconda/envs/envalicia/lib/python3.5/site-packages (from setuptools) Requirement already up-to-date: appdirs>=1.4.0 in /root/anaconda/envs/envalicia/lib/python3.5/site-packages (from setuptools) Requirement already up-to-date: six>=1.6.0 in /root/anaconda/envs/envalicia/lib/python3.5/site-packages (from setuptools) Requirement already up-to-date: pyparsing in /root/anaconda/envs/envalicia/lib/python3.5/site-packages (from packaging>=16.8->setuptools) Installing collected packages: setuptools Found existing installation: setuptools 27.2.0 Cannot remove entries from nonexistent file /root/anaconda/envs/envalicia/lib/python3.5/site-packages/easy-install.pth | cs |
위의 에러 메시지는 site-package 에 easy-install.pth 가 없다는 것으로 정확한 표현이다. 그러니깐 pip 가 이전 setuptools 패키지를 제거하려고 할 때 발생한다.
/pip/req/req_uninstall.py
1 2 3 4 5 6 7 8 9 | class UninstallPthEntries(object): def __init__(self, pth_file): if not os.path.isfile(pth_file): raise UninstallationError( "Cannot remove entries from nonexistent file %s" % pth_file ) self.file = pth_file self.entries = set() self._saved_lines = None | cs |
해결책은 2가지이다. 하나는 --ignore-installed
옵션을 붙여서 업그레이드 한다.
2 3 4 5 6 7 8 9 10 11 12 13 14 15 | # pip install -U pip setuptools --ignore-installed Collecting pip Using cached pip-9.0.1-py2.py3-none-any.whl Collecting setuptools Using cached setuptools-35.0.2-py2.py3-none-any.whl Collecting six>=1.6.0 (from setuptools) Using cached six-1.10.0-py2.py3-none-any.whl Collecting packaging>=16.8 (from setuptools) Using cached packaging-16.8-py2.py3-none-any.whl Collecting appdirs>=1.4.0 (from setuptools) Using cached appdirs-1.4.3-py2.py3-none-any.whl Collecting pyparsing (from packaging>=16.8->setuptools) Using cached pyparsing-2.2.0-py2.py3-none-any.whl Installing collected packages: pip, six, pyparsing, packaging, appdirs, setuptools Successfully installed appdirs-1.4.3 packaging-16.8 pip-9.0.1 pyparsing-2.2.0 setuptools-35.0.2 six-1.10.0 | cs |
또 다른 방법으로는 ez_setup.py 를 다운로드하여 실행한다. 이 경우 없는 pth 파일을 생성한다.
728x90
'프로그래밍 Programming' 카테고리의 다른 글
장고 소셜 로그인 구현하기 Python Social Auth in Django - Twitter, Facebook,Google+, GitHub (0) | 2017.05.29 |
---|---|
Django Debug Toolbar 설치 + uWSGI 패널 추가하기 (0) | 2017.05.20 |
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 (0) | 2017.05.10 |
장고 임포트(import) 순서 및 명시적 성격의 상대 임포트 (0) | 2017.05.09 |
리스프 리스트 데이터 타입 Common Lisp: LIST - the most versatile data type (3) (0) | 2017.04.24 |