MySQL连接器Python PIP安装离线安装

发布于 2025-02-12 21:30:47 字数 1174 浏览 1 评论 0原文

我正在尝试在没有Internet连接的服务器上安装MySQL-Connector-Python模块。我可以在8.0.19之后安装任何版本。我尝试了很多,但失败了。我尝试了两种方法。

OS信息: Windows Server 2019-64位

Python信息: Python 3.8.0-64位

第一种方法:

我从下面的URL下载并安装了MSI,它已成功安装,但是当我在命令行上键入“ PIP列表”时,我会看到该软件包未安装。

下载URL: href =“ https://dev.mysql.com/downloads/connector/python/”

< a 强>第二种方法:

我从下面的URL下载了WHL文件,并尝试使用“ PIP安装”安装。但是在安装过程中,我会收到下面分享的错误。我一直在处理这个问题约2-3个小时。你能帮助我吗?什么原因是什么?

下载URL: https://pypi.org/project/project/project/mysql-connector-python/#files < /a>

软件包: mysql_connector_python-8.0.0.29-py2.py3-none-any.whl(342.0 kb视图哈希斯)

错误: 警告:重试(重试(总计= 0,连接= none,read = none,redirect = none,status = none))在连接通过'protocoleRror破裂('Connection duded''。 )由远程主机',none,10054,none))':/simple/protobuf/

error:找不到满足要求的版本Protobuf&gt; = 3.0.0(来自mysql-connector-python == 8.0.29)(来自版本:无) 错误:未找到Protobuf&gt; = 3.0.0的匹配分布(来自mySQL-Connector-Python == 8.0.29)

I'm trying to install the mysql-connector-python module on a server with no internet connection. I can install any version after 8.0.19. I tried many but failed. I tried two ways for this.

OS Info:
Windows Server 2019 - 64 Bit

Python Info:
Python 3.8.0 - 64 Bit

First way:

I downloaded and installed MSI from the url below, it was installed successfully, but when I type "pip list" on the command line, I see that the package is not installed.

Download URL:
https://dev.mysql.com/downloads/connector/python/

Second way:

I downloaded whl file from below url and tried to install with "pip install". But during installation I am getting the error I shared below. I've been dealing with this issue for about 2-3 hours. Can you help me? What would be the reason?

Download URL:
https://pypi.org/project/mysql-connector-python/#files

Package:
mysql_connector_python-8.0.29-py2.py3-none-any.whl (342.0 kB view hashes)

Error:
WARNING: Retrying (Retry(total=0, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ProtocolError('Connection aborted.', ConnectionResetError(10054, 'An existing connection was forcibly) closed by the remote host', None, 10054, None))': /simple/protobuf/

ERROR: Could not find a version that satisfies the requirement protobuf>=3.0.0 (from mysql-connector-python==8.0.29) (from versions: none)
ERROR: No matching distribution found for protobuf>=3.0.0 (from mysql-connector-python==8.0.29)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

情绪少女 2025-02-19 21:30:47

您必须为连接器版本安装正确的依赖项(Protobuf)版本。
就我而言,我正在安装mysql_connector_python-8.1.0-cp38-cp38-win_amd64,并且需要Protobuf版本&gt; = 4.21.1,&&&&&lt; = 4.21.12。 ( https://dev.mysql.com/doc/relnotes/connector-python/en/news-8-1-0.html

以确定正确的ProtoBuf版本在Internet连接的机器上进行Python并安装PIP安装连接器。它将自动下载并安装正确的依赖项版本。然后,您可以搜索该版本的车轮,下载其轮子并在离线机上安装。

You must install the correct dependency (protobuf) version for your connector version.
In my case, I was installing mysql_connector_python-8.1.0-cp38-cp38-win_amd64 and it requires protobuf version >= 4.21.1, <=4.21.12. (https://dev.mysql.com/doc/relnotes/connector-python/en/news-8-1-0.html)

To figure the correct protobuf version for which case, you can install python on a internet connected machine and pip install the connector. It will automatically download and install the correct dependency version. Then you can search for that version wheel, download its wheel and install on the offline machine.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文