AttributeError: module 'socks' has no attribute 'create_***
5838 단어 pip
문제 버그
pip install $PAK_NAME
를 실행하면 다음과 같은 오류가 표시됩니다.ERROR: Exception:
Traceback (most recent call last):
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 188, in _main
status = self.run(options, args)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 185, in wrapper
return func(self, options, args)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 333, in run
reqs, check_supported_wheels=not options.target_dir
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 179, in resolve
discovered_reqs.extend(self._resolve_one(requirement_set, req))
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 362, in _resolve_one
abstract_dist = self._get_abstract_dist_for(req_to_install)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 313, in _get_abstract_dist_for
self._populate_link(req)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/resolution/legacy/resolver.py", line 279, in _populate_link
req.link = self.finder.find_requirement(req, upgrade)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 901, in find_requirement
req.name, specifier=req.specifier, hashes=hashes,
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 883, in find_best_candidate
candidates = self.find_all_candidates(project_name)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 828, in find_all_candidates
project_url, link_evaluator=link_evaluator,
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 792, in process_project_url
html_page = self._link_collector.fetch_page(project_url)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 612, in fetch_page
return _get_html_page(location, session=self.session)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 451, in _get_html_page
resp = _get_html_response(url, session=session)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 166, in _get_html_response
"Cache-Control": "max-age=0",
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 543, in get
return self.request('GET', url, **kwargs)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_internal/network/session.py", line 421, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 530, in request
resp = self.send(prep, **send_kwargs)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 643, in send
r = adapter.send(request, **kwargs)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py", line 449, in send
timeout=timeout
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 672, in urlopen
chunked=chunked,
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 387, in _make_request
conn.request(method, url, **httplib_request_kw)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/http/client.py", line 1252, in request
self._send_request(method, url, body, headers, encode_chunked)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/http/client.py", line 1298, in _send_request
self.endheaders(body, encode_chunked=encode_chunked)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/http/client.py", line 1247, in endheaders
self._send_output(message_body, encode_chunked=encode_chunked)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/http/client.py", line 1026, in _send_output
self.send(msg)
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/http/client.py", line 966, in send
self.connect()
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/urllib3/connection.py", line 184, in connect
conn = self._new_conn()
File "/home/$USER_NAME/anaconda3/envs/py37/lib/python3.7/site-packages/pip/_vendor/urllib3/contrib/socks.py", line 90, in _new_conn
conn = socks.create_connection(
AttributeError: module 'socks' has no attribute 'create_connection'
솔루션
이전에 설정된 전역 에이전트의 원인이 의심됩니다. 보기 ~/.bashrc, 아래에서 발견하기 전에 코드를 다음과 같이 추가합니다.
export TERM=xterm-256color
export all_proxy="socks5://127.0.0.1:51342"
그러므로 다음을 수행합니다.
#export all_proxy="socks5://127.0.0.1:51342"
unset all_proxy
이 내용에 흥미가 있습니까?
현재 기사가 여러분의 문제를 해결하지 못하는 경우 AI 엔진은 머신러닝 분석(스마트 모델이 방금 만들어져 부정확한 경우가 있을 수 있음)을 통해 가장 유사한 기사를 추천합니다:
Pipenv의 pyenv 지원 (자동 버전 설치)이 작동하지 않을 때빠져서 메모. 20191209 시점의 이야기. 이런 느낌이 들면, 이제 OK Pipenv에는 이 있습니다. 하지만, 현재 issue : 해보면 이런 느낌으로, Success와 나오지만 제대로 움직이지 않는다. iss...
텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
CC BY-SA 2.5, CC BY-SA 3.0 및 CC BY-SA 4.0에 따라 라이센스가 부여됩니다.