DEV Community

Cover image for CentOS 7 裝 mycli
Leon
Leon

Posted on • Originally published at editor.leonh.space

CentOS 7 裝 mycli

pip

因為本人的某種對新版的偏執的愛好,就是想用 Python 3,可是卻又找不到 python3-pip 這個包,故有以下解。

裝 Python 3:

$ sudo yum install python
Enter fullscreen mode Exit fullscreen mode

然後參考一下 Recommended way to install pip(3) on centos7 這篇:

$ sudo python36 -m ensurepip
Enter fullscreen mode Exit fullscreen mode

有興趣可以自己去調查一下 ensurepip 的由來。

這樣就有 pip 了!(撒花)

再用 pip 把它自己更新一下:

$ sudo -H pip3 install --upgrade pip
Enter fullscreen mode Exit fullscreen mode

mycli

mycli 有多種安裝途徑,做為全域工具,比較建議的裝法是透過 pipx。

所以話鋒一轉,我們要先搞定 pipx。

一行安裝:

$ python3 -m pip install --user pipx
Enter fullscreen mode Exit fullscreen mode

pipx 加到 PATH

$ python3 -m pipx ensurepath
Enter fullscreen mode Exit fullscreen mode

因為改了 PATH 環境變數,要重新登入。

重新登入完應該就可以用了。

用 pipx 裝 mycli:

$ pipx install mycli
Enter fullscreen mode Exit fullscreen mode

一行就裝完囉!

$ mycli -u root
Enter fullscreen mode Exit fullscreen mode

可以連入應該就是沒問題。

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

AWS Security LIVE!

Hosted by security experts, AWS Security LIVE! showcases AWS Partners tackling real-world security challenges. Join live and get your security questions answered.

Tune in to the full event

DEV is partnering to bring live events to the community. Join us or dismiss this billboard if you're not interested. ❤️