When you use MySQL Shell with extra Python plugins (like these available on GitHub), sometimes, you could need extra Python modules.
Some of my plugins require requests
and prettytable
for example.
MySQL 8.0.26 uses embedded Python 3.9 and if your system doesn’t have that version (like Oracle Linux 8), you won’t be able to install the missing module.
So how could we install the missing modules ? The easiest method is to use PIP, but if you don’t have PIP for Python 3.9 installed on the system, this will be more complicated…. not really !
This how to install PIP in MySQL Shell:
wget https://bootstrap.pypa.io/get-pip.py mysqlsh --py -f get-pip.py
And now you can use PIP to install extra modules:
mysqlsh --pym pip install --user prettytable
When you know how to do it, it’s very easy.
Enjoy MySQL and MySQL Shell !
Thank you for sharing this data with us. It will be more advantageous for me.
[…] Now if you run msyqlsh the plugins will be loaded. If some modules are missing (on default OCI compute instance, the module requests should be missing), you can install those modules using the method described in this post: […]
Please guide how we can perform above steps on the server doesn’t have internet.
Hi Moshin,
first you create a directory where you will download the modules you need and you run the command as follow
Then you copy the directory and its content on the target host.
Finally you install the module(s) like this: