achillesrasquinha / pipupgrade

🗽 Like yarn outdated/upgrade, but for pip. Upgrade all your pip packages and automate your Python Dependency Management.
https://git.io/pipupgrade
MIT License
587 stars 28 forks source link

[SSL: CERTIFICATE_VERIFY_FAILED] #124

Closed ghost closed 3 years ago

ghost commented 3 years ago

Hello,

Since I have update my Python version (from Python 3.9 to 3.10), I have the problem below (see between ###..). When I return to Python 3.9 everything works fine and I'm able to upgrade all my python's package.

Either i run the command "pipupgrade --verbose --latest" or just "pipupgrade" the problem is the same. My os is a "Mac OS X Big Sur v 11.6.1"

Let me know if you need more informations and thanks for your help. Cheers Giulio

#################################################################################

2021-10-28 09:49:43,047 | INFO | Fetching package setuptools information from DB... 2021-10-28 09:49:43,047 | INFO | Fetching PyPI info for package <Package setuptools (57.4.0)>... 2021-10-28 09:49:43,047 | INFO | Dispatching GET request with arguments ('https://pypi.org/pypi/setuptools/json',) and parameters {}.

concurrent.futures.process._RemoteTraceback: """ concurrent.futures.process._RemoteTraceback: """ Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bpyutils/request/init.py", line 28, in get import requests as req ModuleNotFoundError: No module named 'requests'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1348, in do_open h.request(req.get_method(), req.selector, req.data, headers, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1276, in request self._send_request(method, url, body, headers, encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1322, in _send_request self.endheaders(body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1271, in endheaders self._send_output(message_body, encode_chunked=encode_chunked) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1031, in _send_output self.send(msg) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 969, in send self.connect() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/http/client.py", line 1448, in connect self.sock = self._context.wrap_socket(self.sock, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 512, in wrap_socket return self.sslsocket_class._create( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1070, in _create self.do_handshake() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/ssl.py", line 1341, in do_handshake self._sslobj.do_handshake() ssl.SSLCertVerificationError: [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 243, in _process_worker r = call_item.fn(*call_item.args, *call_item.kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 202, in _process_chunk return [fn(args) for args in chunk] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 202, in return [fn(args) for args in chunk] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pipupgrade/model/package.py", line 138, in init _pypi_info = _get_pypi_info(self.name, raise_err = False) or { } File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pipupgrade/model/package.py", line 29, in _get_pypi_info res = req.get(url) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/bpyutils/request/init.py", line 35, in get http_response = urlopen(url) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 216, in urlopen return opener.open(url, data, timeout) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 519, in open response = self._open(req, data) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 536, in _open result = self._call_chain(self.handle_open, protocol, protocol + File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 496, in _call_chain result = func(args) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1391, in https_open return self.do_open(http.client.HTTPSConnection, req, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/urllib/request.py", line 1351, in do_open raise URLError(err) urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)> """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 243, in _process_worker r = call_item.fn(*call_item.args, call_item.kwargs) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 202, in _process_chunk return [fn(args) for args in chunk] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 202, in return [fn(args) for args in chunk] File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pipupgrade/commands/helper.py", line 331, in get_registry_from_pip registry = Registry(source = pip_path, packages = packages, File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pipupgrade/model/registry.py", line 119, in init for package in pool.imap_unordered(partial(Package, args), packages): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 567, in _chain_from_iterable_of_lists for element in iterable: File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 608, in result_iterator yield fs.pop().result() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 445, in result return self.get_result() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 390, in get_result raise self._exception urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)> """

The above exception was the direct cause of the following exception:

Traceback (most recent call last): File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pipupgrade/commands/init.py", line 79, in command return _command(**ARGUMENTS) File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/site-packages/pipupgrade/commands/init.py", line 240, in _command for registry in pool.imap_unordered( File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/process.py", line 567, in _chain_from_iterable_of_lists for element in iterable: File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 608, in result_iterator yield fs.pop().result() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 445, in result return self.get_result() File "/Library/Frameworks/Python.framework/Versions/3.10/lib/python3.10/concurrent/futures/_base.py", line 390, in get_result raise self._exception urllib.error.URLError: <urlopen error [SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)>

An error occured while performing the above command. This could be an issue with "pipupgrade". Kindly post an issue at https://github.com/achillesrasquinha/pipupgrade/issues

############################################################################################

achillesrasquinha commented 3 years ago

The issue is in your answer. No module named 'requests'.

While pipupgrade uses the native HTTP library packaged with Python under the hood, I think it's best to use requests that pipupgrade uses as well.

Simply

$ pip install requests

And you should be good to go!

ghost commented 3 years ago

Thanks a lot Achilles, I appreciate your fast response. Cheers

Le jeu. 28 oct. 2021 à 23:33, Achilles Rasquinha @.***> a écrit :

The issue is in your answer. No module named 'requests'.

While pipupgrade uses the native HTTP library packaged with Python under the hood, I think it's best to use requests that pipupgrade uses as well.

Simply

$ pip install requests

And you should be good to go!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/achillesrasquinha/pipupgrade/issues/124#issuecomment-954239962, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWH5SCMN76IWZNN5T4IFET3UJG6RRANCNFSM5G4GP5RA . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&referrer=utm_campaign%3Dnotification-email%26utm_medium%3Demail%26utm_source%3Dgithub.