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

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

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

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

Q&A

解決済

1回答

917閲覧

python3.0でpip:command not foundになります。

gaijin

総合スコア30

Python 3.x

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

0グッド

1クリップ

投稿2018/11/03 14:04

pythonを独学にて勉強しているものです。
どうぞよろしくお願い致します。

下記のようにpipコマンドを入力しrequestsパッケージをインストールしようとすると

$ pip install requests

下記のエラーが表示されます。

-bash: pip: command not found

以前にも質問があったのでそこから同じように試しているのですが、結果は変わりません。

MAC OS X EL Capitan
バージョン 10.11.6
を使用しております。

ご教授お願いいたします。

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

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

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

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

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

hayataka2049

2018/11/03 14:24 編集

python3はどうやってインストールしましたか。また、正確なバージョンはいくつですか
gaijin

2018/11/03 14:33

返信ありがとうございます。pythonのホームページよりインストールしました。 バージョンはpython3.7.0でございます。
hayataka2049

2018/11/03 14:36

一応ダウンロードしたページヘのリンクを貼ってください。pythonコマンドやpython3コマンドでpython3.7.0自体は起動しますか?
gaijin

2018/11/03 14:44

https://www.python.org/downloads/ こちらがダウンロードリンクです。 ターミナルではちゃんと起動しております。python -vで内容を確認するとこのように表示されます。 Python 3.7.0 (v3.7.0:1bf9cc5093,  大変ぶしつけな質問で申し訳ございません。
gaijin

2018/11/03 14:45

こちらpython3コマンドのみで起動は致します。
tachikoma

2018/11/03 15:10

pip3は動きます?pip3 -vでバージョン確認してみて下さい。
hayataka2049

2018/11/03 15:20

macだとシステムにプリインストールされているpythonもあるので、それが本当に新しく入れたpython3.7.0なのかは何らかの手段で確認しておいてください。大丈夫ならpython -m pip等でpipコマンドが使えると思います
gaijin

2018/11/04 11:07

hayataka2049 様 返信遅くなり申し訳ございません。 今仕事から帰宅いたしました。 今しがた入力し試してみました。  /usr/bin/python: No module named pip このように表記されています。 これはpipがないという解釈でよろしいでしょうか?
gaijin

2018/11/04 11:15

tachikoma 様 返信遅れ申し訳ありません、仕事より今帰宅いたしました。 python -m pipで入力したところ Usage: pip3 <command> [options] Commands: install Install packages. download Download packages. uninstall Uninstall packages. freeze Output installed packages in requirements format. list List installed packages. show Show information about installed packages. check Verify installed packages have compatible dependencies. config Manage local and global configuration. search Search PyPI for packages. wheel Build wheels from your requirements. hash Compute hashes of package archives. completion A helper command used for command completion. help Show help for commands. 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 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このような感じで長文が表示されました。 自分は初心者でこれがどのようなものなのかわかっていないのですが、どこを確認すれば良いのでしょうか。。。
tachikoma

2018/11/04 11:18

pip3 --version、でした。すみません。pip3は生きてそうなのでpip3 install requestsで行けるんじゃないかなぁ。
gaijin

2018/11/04 11:27 編集

早急な返信ありがとうございます。今打ち込みました。教本とは異なる表示ですが、こちらで正解なのでしょうか? どうぞよろしくお願い致します。  Collecting requests Downloading https://files.pythonhosted.org/packages/f1/ca/10332a30cb25b627192b4ea272c351bce3ca1091e541245cccbace6051d8/requests-2.20.0-py2.py3-none-any.whl (60kB) 100% |████████████████████████████████| 61kB 874kB/s Collecting idna<2.8,>=2.5 (from requests) Downloading https://files.pythonhosted.org/packages/4b/2a/0276479a4b3caeb8a8c1af2f8e4355746a97fab05a372e4a2c6a6b876165/idna-2.7-py2.py3-none-any.whl (58kB) 100% |████████████████████████████████| 61kB 3.6MB/s Collecting certifi>=2017.4.17 (from requests) Downloading https://files.pythonhosted.org/packages/56/9d/1d02dd80bc4cd955f98980f28c5ee2200e1209292d5f9e9cc8d030d18655/certifi-2018.10.15-py2.py3-none-any.whl (146kB) 100% |████████████████████████████████| 153kB 3.6MB/s Collecting urllib3<1.25,>=1.21.1 (from requests) Downloading https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl (118kB) 100% |████████████████████████████████| 122kB 5.1MB/s Collecting chardet<3.1.0,>=3.0.2 (from requests) Downloading https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl (133kB) 100% |████████████████████████████████| 143kB 4.8MB/s Installing collected packages: idna, certifi, urllib3, chardet, requests Successfully installed certifi-2018.10.15 chardet-3.0.4 idna-2.7 requests-2.20.0 urllib3-1.24.1 You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via the 'pip install --upgrade pip' command.
tachikoma

2018/11/04 12:34 編集

python3、とターミナルで実行して>>> import requestsが通ればokです。
gaijin

2018/11/04 12:49

>>> このように通りました! これでrequestsパッケージがインストールされたということでよろしいでしょか? 本当にありがとうございます!
guest

回答1

0

ベストアンサー

セッティングお疲れ様です。

もしターミナル操作に慣れてらっしゃるのでしたら、.bashrc

alias python=python3 alias pip=pip3

を書いておくと、python, pipでそれぞれ今回インストールしたものを使えるようになります。ご参考までに。

投稿2018/11/04 13:57

tachikoma

総合スコア3601

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

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

gaijin

2018/11/04 23:40

本当に何から何までご丁寧にありがとうございます! すぐにさせていただきます!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問