質問をすることでしか得られない、回答やアドバイスがある。

15分調べてもわからないことは、質問しよう!

新規登録して質問してみよう
ただいま回答率
85.48%
Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

解決済

1回答

13897閲覧

pipコマンドが認識されません

almark7032

総合スコア4

Python 3.x

Python 3はPythonプログラミング言語の最新バージョンであり、2008年12月3日にリリースされました。

MacOS(OSX)

MacOSとは、Appleの開発していたGUI(グラフィカルユーザーインターフェース)を採用したオペレーションシステム(OS)です。Macintoshと共に、市場に出てGUIの普及に大きく貢献しました。

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

0グッド

0クリップ

投稿2020/08/29 15:25

前提・実現したいこと

signateというコマンドラインインターフェイスをインストールしたくてpip install signateをターミナルで実行したのですが、zsh: command not found: pipと表示されpipコマンドが実行されず困っています。

発生している問題・エラーメッセージ

Last login: Wed Aug 26 22:23:09 on ttys001
**@kitabatotonoMBP ~ % pip install signate
zsh: command not found: pip
**@kitabatotonoMBP ~ % which pip3
/usr/local/bin/pip3
**@kitabatotonoMBP ~ % find / -name pip3
/usr/bin/pip3
find: /usr/sbin/authserver: Permission denied
/usr/local/bin/pip3
/usr/local/Cellar/python@3.8/3.8.5/bin/pip3

/System/Volumes/Data/usr/local/bin/pip3
/System/Volumes/Data/usr/local/Cellar/python@3.8/3.8.5/bin/pip3
find: /System/Volumes/Data/.Spotlight-V100: No such file or directory
find: /System/Volumes/Data/Library/Application Support/Apple/ParentalControls/Users: Permission denied

find: /System/Volumes/Data/Library/Application Support/com.apple.TCC: Operation not permitted
/System/Volumes/Data/Library/Developer/CommandLineTools/usr/bin/pip3

find: /System/Volumes/Data/private/var/folders/pm/mt3kk4nj0tbg7r4j_8jvfl300000gn/0/com.apple.ScreenTimeAgent/Store: Operation not permitted

/Applications/Xcode.app/Contents/Developer/usr/bin/pip3
/opt/anaconda3/bin/pip3
/opt/anaconda3/pkgs/pip-20.1.1-py38_1/bin/pip3
find: /dev/fd/3: Not a directory
**@kitabatotonoMBP ~ % pip install signate
zsh: command not found: pip
**@kitabatotonoMBP ~ % which pip
pip not found
**@kitabatotonoMBP ~ % which pip3
/usr/local/bin/pip3
**@kitabatotonoMBP ~ % sudo chown -R $(whoami):admin /usr/local
Password:
Sorry, try again.
Password:
chown: /usr/local: Operation not permitted
**@kitabatotonoMBP ~ % brew postinstall python3
==> Postinstalling python@3.8
==> /usr/local/Cellar/python@3.8/3.8.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/
==> /usr/local/Cellar/python@3.8/3.8.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/
==> /usr/local/Cellar/python@3.8/3.8.5/bin/python3 -s setup.py --no-user-cfg install --force --verbose --install-scripts=/
**@kitabatotonoMBP ~ % pip install signate
zsh: command not found: pip
**@kitabatotonoMBP ~ % python3 -m pip

Usage:
/usr/local/bin/python3 -m pip <command> [options]

Commands:
install Install packages.
(中略)
General Options:
-h, --help Show help.
--isolated Run pip in an isolated mode, ignoring environment variables and user configuration.
-v, --verbose Give more output. Option is additive, and can be used up to 3 times.
-V, --version Show version and exit.
-q, --quiet Give less output. Option is additive, and can be used up to 3 times (corresponding to
WARNING, ERROR, and CRITICAL logging levels).
--log <path> Path to a verbose appending log.
--proxy <proxy> Specify a proxy in the form [user:passwd@]proxy.server:port.
--retries <retries> Maximum number of retries each connection should attempt (default 5 times).
--timeout <sec> Set the socket timeout (default 15 seconds).
--exists-action <action> Default action when a path already exists: (s)witch, (i)gnore, (w)ipe, (b)ackup, (a)bort.
--trusted-host <hostname> Mark this host or host:port pair as trusted, even though it does not have valid or any
HTTPS.
--cert <path> Path to alternate CA bundle.
--client-cert <path> Path to SSL client certificate, a single file containing the private key and the
certificate in PEM format.
--cache-dir <dir> Store the cache data in <dir>.
--no-cache-dir Disable the cache.
--disable-pip-version-check
Don't periodically check PyPI to determine whether a new version of pip is available for
download. Implied with --no-index.
--no-color Suppress colored output
--no-python-version-warning
Silence deprecation warnings for upcoming unsupported Pythons.
**@kitabatotonoMBP ~ % pip install signate
zsh: command not found: pip
**@kitabatotonoMBP ~ % python -m ensurepip
Looking in links: /var/folders/pm/mt3kk4nj0tbg7r4j_8jvfl300000gn/T/tmpwCy0kc
Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (41.0.1)
Collecting pip
Installing collected packages: pip
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the --user option or check the permissions.

**@kitabatotonoMBP ~ % pip install --user signate
zsh: command not found: pip
**@kitabatotonoMBP ~ % install pip --user
install: pip: No such file or directory
**@kitabatotonoMBP ~ % cd ..
**@kitabatotonoMBP /Users % pwd
/Users
**@kitabatotonoMBP /Users % cd ~
**@kitabatotonoMBP ~ % pip install --user signate
zsh: command not found: pip
**@kitabatotonoMBP ~ % python -m ensurepip
Looking in links: /var/folders/pm/mt3kk4nj0tbg7r4j_8jvfl300000gn/T/tmpP5Qjit
Requirement already satisfied: setuptools in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (41.0.1)
Collecting pip
Installing collected packages: pip
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/pip'
Consider using the --user option or check the permissions.

**@kitabatotonoMBP ~ % sudo pip install --upgrade pip --user
Password:
sudo: pip: command not found
**@kitabatotonoMBP ~ % curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 1840k 100 1840k 0 0 1121k 0 0:00:01 0:00:01 --:--:-- 1122k
@kitabatotonoMBP ~ % python get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Using cached pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
WARNING: The scripts pip, pip2 and pip2.7 are installed in '/Users/
/Library/Python/2.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.2.2
@kitabatotonoMBP ~ % python get-pip.py
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Defaulting to user installation because normal site-packages is not writeable
Collecting pip
Using cached pip-20.2.2-py2.py3-none-any.whl (1.5 MB)
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 20.2.2
Uninstalling pip-20.2.2:
Successfully uninstalled pip-20.2.2
WARNING: The scripts pip, pip2 and pip2.7 are installed in '/Users/
/Library/Python/2.7/bin' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pip-20.2.2
**@kitabatotonoMBP ~ % pip install signate
zsh: command not found: pip
**@kitabatotonoMBP ~ % xcode-select -install
xcode-select: error: invalid argument '-install'
Usage: xcode-select [options]

Print or change the path to the active developer directory. This directory
controls which tools are used for the Xcode command line tools (for example,
xcodebuild) as well as the BSD development commands (such as cc and make).

Options:
-h, --help print this help message and exit
-p, --print-path print the path of the active developer directory
-s <path>, --switch <path> set the path for the active developer directory
--install open a dialog for installation of the command line developer tools
-v, --version print the xcode-select version
-r, --reset reset to the default command line tools path
**@kitabatotonoMBP ~ % pip install signate
zsh: command not found: pip

ディレクトリ名(?)でがっつり本名が入ってしまっている箇所があるので、そこは**で置き換えさせて頂きました。

また、エラーメッセージが字数制限の関係で入りきらなかったので、似たような箇所は一部省略しました。

試したこと

以下のサイトを参考にいろいろなコマンドを試しました
xcode-select –install(https://tabinou.com/archives/1259)

python -m ensurepip(https://teratail.com/questions/35614)

pip install --user signate(https://pyteyon.hatenablog.com/entry/2019/05/24/003924)

sudo pip install --upgrade pip --user(https://off.tokyo/blog/%E8%A7%A3%E6%B1%BA%E3%81%99%E3%82%8B-error-could-not-install-packages-due-to-an-environmenterror-errno-1-operation-not-permitted-bin-pip/)

python get-pip.py(https://ja.stackoverflow.com/questions/18218/sudo-pip-install%E3%81%A7sudo-pip-command-not-found%E3%81%AE%E3%82%A8%E3%83%A9%E3%83%BC)

補足情報(FW/ツールのバージョンなど)

macOS Catalina
バージョン10.15.6
Python 3.8.5
です。

初心者なので下手な質問をしてしまっているかもしれませんが、ご回答頂ければ幸いです。

気になる質問をクリップする

クリップした質問は、後からいつでもMYページで確認できます。

またクリップした質問に回答があった際、通知やメールを受け取ることができます。

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

meg_

2020/08/29 16:14

pythonはどのような方法でインストールしましたか?
guest

回答1

0

ベストアンサー

Python3用のpipがpip3という名前でインストールされているので、参考にしている本やサイトの説明中のpipをpip3に読み替えてください。
たとえば、何かインストールするなら「pip3 install (以下略)」とするか、「python3 -m pip install (以下略)」としてください。

投稿2020/08/30 00:00

Daregada

総合スコア11990

バッドをするには、ログインかつ

こちらの条件を満たす必要があります。

almark7032

2020/08/30 02:42

pip3 install signateで出来ました! ありがとうございました!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

15分調べてもわからないことは
teratailで質問しよう!

ただいまの回答率
85.48%

質問をまとめることで
思考を整理して素早く解決

テンプレート機能で
簡単に質問をまとめる

質問する

関連した質問