Я пытаюсь настроить VSCode, чтобы позволить мне запускать программы на Python.
Я на Windows 10.
В настоящее время все работает нормально, если я создаю простые программы, такие как:
# This all works fine
print("Hello World")
arr = [1,2,3]
print(arr)
Однако, когда я использую любую внешнюю библиотеку, например, numpy, я получаю следующую ошибку:
Traceback (последний вызов был последним): файл "c: /Users/jerry/Desktop/hello.py", строка 3, в импорте numpy as np ImportError: Нет модуля с именем 'numpy'
Итак, я выдаю в окне терминала VSCode следующее: pip install numpy
Что дает мне следующее:
PS C:\Users\jerry> pip install numpy
Collecting numpy
Exception:
Traceback (most recent call last):
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 539, in urlopen
self._prepare_proxy(conn)
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 727, in _prepare_proxy
conn.connect()
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connection.py", line 238, in connect
ssl_version=resolved_ssl_version)
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py", line 279, in ssl_wrap_socket
return context.wrap_socket(sock, server_hostname=server_hostname)
File "c:\python35-32\lib\ssl.py", line 376, in wrap_socket
_context=self)
File "c:\python35-32\lib\ssl.py", line 747, in __init__
self.do_handshake()
File "c:\python35-32\lib\ssl.py", line 983, in do_handshake
self._sslobj.do_handshake()
File "c:\python35-32\lib\ssl.py", line 628, in do_handshake
self._sslobj.do_handshake()
ssl.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:646)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\adapters.py", line 370, in send
timeout=timeout
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\packages\urllib3\connectionpool.py", line 574, in urlopen
raise SSLError(e)
pip._vendor.requests.packages.urllib3.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:646)
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\python35-32\lib\site-packages\pip\basecommand.py", line 211, in main
status = self.run(options, args)
File "c:\python35-32\lib\site-packages\pip\commands\install.py", line 294, in run
requirement_set.prepare_files(finder)
File "c:\python35-32\lib\site-packages\pip\req\req_set.py", line 334, in prepare_files
functools.partial(self._prepare_file, finder))
File "c:\python35-32\lib\site-packages\pip\req\req_set.py", line 321, in _walk_req_to_install
more_reqs = handler(req_to_install)
File "c:\python35-32\lib\site-packages\pip\req\req_set.py", line 491, in _prepare_file
session=self.session)
File "c:\python35-32\lib\site-packages\pip\download.py", line 825, in unpack_url
session,
File "c:\python35-32\lib\site-packages\pip\download.py", line 673, in unpack_http_url
from_path, content_type = _download_http_url(link, session, temp_dir)
File "c:\python35-32\lib\site-packages\pip\download.py", line 857, in _download_http_url
stream=True,
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 477, in get
return self.request('GET', url, **kwargs)
File "c:\python35-32\lib\site-packages\pip\download.py", line 373, in request
return super(PipSession, self).request(method, url, *args, **kwargs)
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 465, in request
resp = self.send(prep, **send_kwargs)
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\sessions.py", line 573, in send
r = adapter.send(request, **kwargs)
File "c:\python35-32\lib\site-packages\pip\_vendor\cachecontrol\adapter.py", line 46, in send
resp = super(CacheControlAdapter, self).send(request, **kw)
File "c:\python35-32\lib\site-packages\pip\_vendor\requests\adapters.py", line 431, in send
raise SSLError(e, request=request)
pip._vendor.requests.exceptions.SSLError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed (_ssl.c:646)
You are using pip version 7.1.2, however version 19.0.3 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.
Я не уверен, что делатьили как исправить эту ошибку.Я просмотрел следующие ресурсы:
Ни один не имелвыполнимое решение.Буду признателен за любой совет или помощь.