Linux 환경에서 pip를 설치하려고 했으나 제대로 설치되지 않았습니다.
파이썬 버전 - 2.6.6
다음 명령을 사용하여 pip를 설치하려고 하면,
파이썬 setup.py 설치
아래는 제가 받은 메시지입니다.
running install
running bdist_egg
running egg_info
writing src/pip.egg-info/PKG-INFO
writing top-level names to src/pip.egg-info/top_level.txt
writing dependency_links to src/pip.egg-info/dependency_links.txt
writing entry points to src/pip.egg-info/entry_points.txt
reading manifest file 'src/pip.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
warning: no files found matching 'docs/docutils.conf'
...............
...............
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/cachecontrol/adapter.py to adapter.pyc
SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/pip/_vendor/cachecontrol/adapter.py', 13, 34, ' invalidating_methods = {"PUT", "DELETE"}\n'))
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/cachecontrol/heuristics.py to heuristics.pyc
SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/pip/_vendor/cachecontrol/heuristics.py', 101, 12, ' 200, 203, 204, 206, 300, 301, 404, 405, 410, 414, 501\n'))
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/requests/help.py to help.pyc
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/requests/exceptions.py to exceptions.pyc
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/requests/_internal_utils.py to _internal_utils.pyc
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/requests/status_codes.py to status_codes.pyc
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/requests/api.py to api.pyc
byte-compiling build/bdist.linux-x86_64/egg/pip/_vendor/requests/sessions.py to sessions.pyc
SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/pip/_vendor/requests/sessions.py', 750, 52, ' state = {attr: getattr(self, attr, None) for attr in self.__attrs__}\n'))
SyntaxError: ('invalid syntax', ('build/bdist.linux-x86_64/egg/pip/_vendor/requests/models.py', 655, 51, ' return {attr: getattr(self, attr, None) for attr in self.__attrs__}\n'))
하지만 오류 메시지가 끝나면
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/req/req_uninstall.py', 180, 37, ' os.path.join(folder, "*") for folder in folders\n'))
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/cli/parser.py', 157, 37, ' section_items = {name: [] for name in override_order}\n'))
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/cli/cmdoptions.py', 96, 48, " binary_only = FormatControl(set(), {':all:'})\n"))
pip 19.0.3 is already the active version in easy-install.pth
Installing pip script to /usr/bin
Installing pip2.6 script to /usr/bin
Installing pip2 script to /usr/bin
Installed /usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg
Processing dependencies for pip==19.0.3
Finished processing dependencies for pip==19.0.3
pip 버전을 확인하면 다음과 같은 결과가 나타납니다.
$ pip --version
Traceback (most recent call last):
File "/usr/bin/pip", line 9, in <module>
load_entry_point('pip==19.0.3', 'console_scripts', 'pip')()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 299, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2229, in load_entry_point
return ep.load()
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 1948, in load
entry = __import__(self.module_name, globals(),globals(), ['__name__'])
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/lib/python2.6/site-packages/pip-19.0.3-py2.6.egg/pip/_vendor/urllib3/connectionpool.py", line 92
_blocking_errnos = {errno.EAGAIN, errno.EWOULDBLOCK}
다음은 Linux 시스템의 세부 사항입니다.
$ uname -r
2.6.32-279.11.1.el6.x86_64
$ cat /etc/system-release-cpe
cpe:/o:oracle:oracle_linux:6server:ga:server
$ cat /etc/redhat-release
Red Hat Enterprise Linux Server release 6.3 (Santiago)
답변1
"python-pip"을 설치하는 것이 더 나을 수도 있습니다. 에펠수동 설치보다. 수행한 작업에 따라 손상된 Python 라이브러리로 인해 호스트가 "yum"을 통해 소프트웨어 업데이트를 받을 수 없게 되었을 수도 있습니다.
또한 Oracle Linux 6.3을 실행하는 경우 시스템은 최소 6년 이상 된 것입니다.