Reputation: 103
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)
Upvotes: 0
Views: 1987
Reputation: 13
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.
Upvotes: 0