How do I run linode-cli on Mac OS?
I'm getting an error using linode-cli Mac OS. I have a successful install but I can't use linode-cli
% pip3 install linode-cli --upgrade
Requirement already up-to-date: linode-cli in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (3.1.3)
Requirement already satisfied, skipping upgrade: colorclass in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from linode-cli) (2.2.0)
Requirement already satisfied, skipping upgrade: PyYAML in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from linode-cli) (5.3.1)
Requirement already satisfied, skipping upgrade: terminaltables in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from linode-cli) (3.1.0)
Requirement already satisfied, skipping upgrade: requests in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from linode-cli) (2.24.0)
Requirement already satisfied, skipping upgrade: enum34 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from linode-cli) (1.1.10)
Requirement already satisfied, skipping upgrade: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from requests->linode-cli) (1.25.11)
Requirement already satisfied, skipping upgrade: idna<3,>=2.5 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from requests->linode-cli) (2.10)
Requirement already satisfied, skipping upgrade: chardet<4,>=3.0.2 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from requests->linode-cli) (3.0.4)
Requirement already satisfied, skipping upgrade: certifi>=2017.4.17 in /Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/site-packages (from requests->linode-cli) (2020.6.20)% linode-cli
zsh: command not found: linode-cli
4 Replies
Is the directory where linode-cli is stored in your $PATH?
-- sw
Yes, I have tried that but still not working…
But it works on my Linux system even without adding it to path. I don't know how to get it to work on Mac OS
I had to use sudo…
stevewi $ sudo pip3 install linode-cli --upgrade
Password:
<irrelevant warnings omitted>
Collecting linode-cli
Downloading https://files.pythonhosted.org/packages/9a/0a/284d106739bc602855c92a2990b0f12029323620464c1fa4f391dcead870/linode_cli-3.1.3-py2.py3-none-any.whl (156kB)
100% |████████████████████████████████| 163kB 4.3MB/s
Collecting requests (from linode-cli)
Downloading https://files.pythonhosted.org/packages/45/1e/0c169c6a5381e241ba7404532c16a21d86ab872c9bed8bdcd4c423954103/requests-2.24.0-py2.py3-none-any.whl (61kB)
100% |████████████████████████████████| 71kB 11.6MB/s
Collecting enum34 (from linode-cli)
Downloading https://files.pythonhosted.org/packages/63/f6/ccb1c83687756aeabbf3ca0f213508fcfb03883ff200d201b3a4c60cedcc/enum34-1.1.10-py3-none-any.whl
Collecting terminaltables (from linode-cli)
Collecting colorclass (from linode-cli)
Collecting PyYAML (from linode-cli)
Collecting idna<3,>=2.5 (from requests->linode-cli)
Downloading https://files.pythonhosted.org/packages/a2/38/928ddce2273eaa564f6f50de919327bf3a00f091b5baba8dfa9460f3a8a8/idna-2.10-py2.py3-none-any.whl (58kB)
100% |████████████████████████████████| 61kB 9.9MB/s
Collecting chardet<4,>=3.0.2 (from requests->linode-cli)
Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB)
100% |████████████████████████████████| 143kB 4.2MB/s
Collecting urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 (from requests->linode-cli)
Downloading https://files.pythonhosted.org/packages/56/aa/4ef5aa67a9a62505db124a5cb5262332d1d4153462eb8fd89c9fa41e5d92/urllib3-1.25.11-py2.py3-none-any.whl (127kB)
100% |████████████████████████████████| 133kB 7.0MB/s
Collecting certifi>=2017.4.17 (from requests->linode-cli)
Downloading https://files.pythonhosted.org/packages/5e/c4/6c4fe722df5343c33226f0b4e0bb042e4dc13483228b4718baf286f86d87/certifi-2020.6.20-py2.py3-none-any.whl (156kB)
100% |████████████████████████████████| 163kB 7.1MB/s
Installing collected packages: idna, chardet, urllib3, certifi, requests, enum34, terminaltables, colorclass, PyYAML, linode-cli
Successfully installed PyYAML-5.3.1 certifi-2020.6.20 chardet-3.0.4 colorclass-2.2.0 enum34-1.1.10 idna-2.10 linode-cli-3.1.3 requests-2.24.0 terminaltables-3.1.0 urllib3-1.25.11
You are using pip version 19.0.3, however version 20.2.4 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
stevewi:~ $ whereis linode-cli
stevewi:~ $ linode-cli
Welcome to the Linode CLI. This will walk you through some
initial setup.
First, we need a Personal Access Token. To get one, please visit
https://cloud.linode.com/profile/tokens and click
"Add a Personal Access Token". The CLI needs access to everything
on your account to work correctly.
Personal Access Token: ^C
<irrelevant tombstone omitted>
Here's my PATH:
PATH=.:/Users/stevewi/bin:/Users/stevewi/sbin:/Users/stevewi/.gems/bin: \
/Users/stevewi/.rbenv/shims:/usr/local/bin: \
/usr/local/sbin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/Apple/usr/bin
n.b.,
- /Users/stevewi/.gems/bin:/Users/stevewi/.rbenv/shims:/usr/local/bin are for rbenv installed via Homebrew;
- /usr/local/bin:/usr/local/sbin are for Homebrew; and
- /Library/Apple/usr/bin appears to be part of Xcode.
Perhaps you could install the Homebrew version of python3/pip and use that. I've had far more luck with that approach for ruby than using the Apple-supplied one… I have a lot more control over the environment it uses and it's updated a lot more frequently too.
-- sw
P.S. Homebrew also offers pyenv that does the same thing as rbenv except for python:
stevewi:~ $ brew info pyenv
pyenv: stable 1.2.21 (bottled), HEAD
Python version management
https://github.com/pyenv/pyenv
Not installed
From: https://github.com/Homebrew/homebrew-core/blob/HEAD/Formula/pyenv.rb
License: MIT
==> Dependencies
Required: autoconf ✔, openssl@1.1 ✔, pkg-config ✔, readline ✔
==> Options
--HEAD
Install HEAD version
==> Analytics
install: 94,388 (30 days), 214,150 (90 days), 733,960 (365 days)
install-on-request: 91,151 (30 days), 206,491 (90 days), 693,634 (365 days)
build-error: 0 (30 days)