Python SSL root certificates

Python3.12安装好之后,pip仍然指向旧的3.11版本:

bash 复制代码
~ % pip --version      
pip 23.3.1 from /Library/Frameworks/Python.framework/Versions/3.11/lib/python3.11/site-packages/pip (python 3.11)

需要删除旧的3.11路径 (MAC 版本)

删除办法,打开终端窗口,然后输入:

open -e ~/.zprofile

并删除以下代码:

bash 复制代码
# Setting PATH for Python 3.11
# The original version is saved in .zprofile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.11/bin:${PATH}"
export PATH

关闭终端窗口,重新打开,重新执行pip命令

bash 复制代码
~ % pip --version
zsh: command not found: pip

发现找不到pip,解决办法,打开以下路径:/Library/Frameworks/Python.framework/Versions/3.12/bin

找到pip3或pip3.12,复制并重命名为pip,再次执行命令:

bash 复制代码
pip --version
pip 24.0 from /Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/pip (python 3.12)

pip已经重新指向3.12!!!

同时可以将相同目录下的python3.12复制为python,以避免找不到python。

使用where python来查找python路径:

bash 复制代码
% where python
/Library/Frameworks/Python.framework/Versions/3.12/bin/python

同时在bin下也有python的踪迹:

bash 复制代码
% ls /usr/local/bin/python*
/usr/local/bin/python3			/usr/local/bin/python3.11-intel64
/usr/local/bin/python3-config		/usr/local/bin/python3.12
/usr/local/bin/python3-intel64		/usr/local/bin/python3.12-config
/usr/local/bin/python3.11		/usr/local/bin/python3.12-intel64

可使用rm命令删除不需要的python

Congratulations! Python 3.12.3 for macOS 10.9 or later was successfully installed.

One more thing: to verify the identity of secure network connections, this Python needs a set of SSL root certificates. You can download and install a current curated set from the Certifi project by double-clicking on the Install Certificates icon in the Finder window. See the ReadMe file for more information.

This package will install Python 3.12.3 for macOS 10.9 or later for the following architecture(s): arm64, x86_64.

恭喜你!Python 3.12.3 for macOS 10.9或更高版本已成功安装。

还有一件事:为了验证安全网络连接的身份,这个Python需要一组SSL根证书。通过双击Finder窗口中的"安装证书"图标,可以从Certifi项目下载并安装当前的管理集。有关更多信息,请参阅ReadMe文件。

此包将为以下架构安装Python 3.12.3 for macOS 10.9或更高版本:arm64, x86_64。

Certificate verification and OpenSSL

This package includes its own private copy of OpenSSL 3.0. The trust certificates in system and user keychains managed by the Keychain Access application and the security command line utility are not used as defaults by the Python ssl module. A sample command script is included in /Applications/Python 3.12 to install a curated bundle of default root certificates from the third-party certifi package (certifi · PyPI). Double-click on Install Certificates to run it.

证书验证和OpenSSL

这个包包含它自己的OpenSSL 3.0的私有副本。由Keychain Access应用程序和security命令行实用程序管理的系统和用户Keychain中的信任证书不会被Python ssl模块默认使用。/Applications/Python 3.12中包含一个示例命令脚本,用于从第三方证书包(certifi·PyPI)中安装默认根证书的管理包。双击Install Certificates来运行它。

The bundled pip has its own default certificate store for verifying download connections.

捆绑的pip有自己的默认证书存储,用于验证下载连接。

Install Options

You can control some aspects of what is installed by this package. To see the options, click on the Customize button in the Installation Type step of the macOS installer app. Click on a package name in the list shown to see more information about that option,

您可以控制这个包安装的内容的某些方面。要查看选项,请单击macOS安装程序应用程序的安装类型步骤中的自定义按钮。单击显示列表中的软件包名称以查看有关该选项的更多信息。

Using IDLE or other Tk applications

This package includes its own private version of Tcl/Tk 8.6. It does not use any system-supplied or third-party supplied versions of Tcl/Tk.

这个包包含它自己的专用版本Tcl/Tk 8.6。它不使用任何系统提供的或第三方提供的Tcl/Tk版本。

Due to new security checks on macOS 10.15 Catalina, when launching IDLE macOS may open a window with a message "Python" would like to access files in your Documents folder . This is normal as IDLE uses your Documents folder as its default when opening and saving files; you can still choose other locations in the Open and Save file dialog windows. Click on the OK button to proceed.

由于macOS 10.15 Catalina上新的安全检查,当启动IDLE时,macOS可能会打开一个窗口,提示"Python"想要访问文档文件夹中的文件。这是正常的,因为IDLE在打开和保存文件时使用文档文件夹作为默认值;您仍然可以在打开和保存文件对话框窗口中选择其他位置。单击OK按钮继续。

Apple Silicon Mac support

On Apple Silicon Macs, it is possible to run Python either with native ARM64 code or under Intel 64 emulation using Rosetta2. This option might be useful for testing or if binary wheels are not yet available with native ARM64 binaries. To easily force Python to run in emulation mode, invoke it from a command line shell with the python3-intel64 command instead of just python3.

在Apple Silicon mac上,既可以使用本地ARM64代码运行Python,也可以使用Rosetta2在Intel 64仿真下运行Python。此选项可能对测试有用,或者如果本机ARM64二进制文件还不能使用二进制轮。要轻松地强制Python以仿真模式运行,请使用python3-intel64命令而不是python3从命令行shell调用它。

Other changes

For other changes in this release, see the What's new section in the Documentation Set for this release and its Release Notes link at Download Python | Python.org.

certifi · PyPI

Project description

Certifi provides Mozilla's carefully curated collection of Root Certificates for validating the trustworthiness of SSL certificates while verifying the identity of TLS hosts. It has been extracted from the Requests project.

Certifi提供Mozilla精心策划的根证书集合,用于验证SSL证书的可信度,同时验证TLS主机的身份。它是从Requests项目中提取出来的。

Installation

certifi is available on PyPI. Simply install it with pip:

复制代码
$ pip install certifi

Usage

To reference the installed certificate authority (CA) bundle, you can use the built-in function:

复制代码
>>> import certifi

>>> certifi.where()
'/usr/local/lib/python3.7/site-packages/certifi/cacert.pem'

Or from the command line:

复制代码
$ python -m certifi
/usr/local/lib/python3.7/site-packages/certifi/cacert.pem

Enjoy!

Addition/Removal of Certificates

Certifi does not support any addition/removal or other modification of the CA trust store content. This project is intended to provide a reliable and highly portable root of trust to python deployments. Look to upstream projects for methods to use alternate trust.

Certifi不支持对CA信任存储库内容进行任何添加/删除或其他修改。该项目旨在为python部署提供可靠且高度可移植的信任根。在上游项目中寻找使用替代信任的方法。

Project details

Verified details

These details have been verified by PyPI

相关推荐
好看资源平台25 分钟前
网络爬虫——综合实战项目:多平台房源信息采集与分析系统
爬虫·python
进击的六角龙1 小时前
深入浅出:使用Python调用API实现智能天气预报
开发语言·python
檀越剑指大厂1 小时前
【Python系列】浅析 Python 中的字典更新与应用场景
开发语言·python
湫ccc1 小时前
Python简介以及解释器安装(保姆级教学)
开发语言·python
孤独且没人爱的纸鹤1 小时前
【深度学习】:从人工神经网络的基础原理到循环神经网络的先进技术,跨越智能算法的关键发展阶段及其未来趋势,探索技术进步与应用挑战
人工智能·python·深度学习·机器学习·ai
羊小猪~~1 小时前
tensorflow案例7--数据增强与测试集, 训练集, 验证集的构建
人工智能·python·深度学习·机器学习·cnn·tensorflow·neo4j
lzhlizihang1 小时前
python如何使用spark操作hive
hive·python·spark
q0_0p1 小时前
牛客小白月赛105 (Python题解) A~E
python·牛客
极客代码1 小时前
【Python TensorFlow】进阶指南(续篇三)
开发语言·人工智能·python·深度学习·tensorflow
庞传奇1 小时前
TensorFlow 的基本概念和使用场景
人工智能·python·tensorflow