pip install 安装SSL证书验证失败解决方法ProxyError

AI技术分享2年前发布 AIGC吧
3,233 0

今天在使用pip安装Flask的时候遇到了一个SSL证书验证失败的问题。导致使用pip安装任何第三方的包都有问题。今天就教大家一个解决的方法,以macOS为列。

WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by ‘ProxyError(‘Cannot connect to proxy.’, RemoteDisconnected(‘Remote end closed connection without response’))’

pip install 安装SSL证书验证失败解决方法ProxyError

1. 更新 certifi 包:

certifi 是一个 Python 库,用于管理 SSL 证书。你可以尝试更新它来解决证书问题。

pip install –upgrade certifi

2. 安装系统的根证书 (适用于 macOS):

在 macOS 上,如果根证书缺失,你可以手动安装它们。

1.打开你的终端。

2. 运行以下命令,找到 Install Certificates.command 并执行:

open /Applications/Python\ 3.x(你当前的版本号)/Install\ Certificates.command

执行完毕后再次使用pip安装就没有任何问题了。

pip install 安装SSL证书验证失败解决方法ProxyError

 

© 版权声明

相关文章

暂无评论

none
暂无评论...

Fatal error: Uncaught TypeError: Cannot access offset of type string on string in /www/wwwroot/aigcba.com/wp-content/themes/onenav/inc/functions/io-search.php:442 Stack trace: #0 /www/wwwroot/aigcba.com/wp-content/themes/onenav/inc/functions/io-footer.php(374): io_search_body_html() #1 /www/wwwroot/aigcba.com/wp-content/themes/onenav/inc/functions/io-footer.php(336): io_nav_search_html() #2 /www/wwwroot/aigcba.com/wp-includes/class-wp-hook.php(353): io_get_footer_content() #3 /www/wwwroot/aigcba.com/wp-includes/class-wp-hook.php(377): WP_Hook->apply_filters() #4 /www/wwwroot/aigcba.com/wp-includes/plugin.php(523): WP_Hook->do_action() #5 /www/wwwroot/aigcba.com/wp-includes/general-template.php(3457): do_action() #6 /www/wwwroot/aigcba.com/wp-content/themes/onenav/footer.php(41): wp_footer() #7 /www/wwwroot/aigcba.com/wp-includes/template.php(880): require_once('...') #8 /www/wwwroot/aigcba.com/wp-includes/template.php(815): load_template() #9 /www/wwwroot/aigcba.com/wp-includes/general-template.php(92): locate_template() #10 /www/wwwroot/aigcba.com/wp-content/themes/onenav/single.php(49): get_footer() #11 /www/wwwroot/aigcba.com/wp-includes/template-loader.php(132): include('...') #12 /www/wwwroot/aigcba.com/wp-blog-header.php(19): require_once('...') #13 /www/wwwroot/aigcba.com/index.php(17): require('...') #14 {main} thrown in /www/wwwroot/aigcba.com/wp-content/themes/onenav/inc/functions/io-search.php on line 442