pythonを独学にて勉強しているものです。
どうぞよろしくお願い致します。
下記のようにpipコマンドを入力しrequestsパッケージをインストールしようとすると
$ pip install requests
下記のエラーが表示されます。
-bash: pip: command not found
以前にも質問があったのでそこから同じように試しているのですが、結果は変わりません。
MAC OS X EL Capitan
バージョン 10.11.6
を使用しております。
ご教授お願いいたします。
python3はどうやってインストールしましたか。また、正確なバージョンはいくつですか
返信ありがとうございます。pythonのホームページよりインストールしました。 バージョンはpython3.7.0でございます。
一応ダウンロードしたページヘのリンクを貼ってください。pythonコマンドやpython3コマンドでpython3.7.0自体は起動しますか?
https://www.python.org/downloads/ こちらがダウンロードリンクです。 ターミナルではちゃんと起動しております。python -vで内容を確認するとこのように表示されます。 Python 3.7.0 (v3.7.0:1bf9cc5093, 大変ぶしつけな質問で申し訳ございません。
こちらpython3コマンドのみで起動は致します。
pip3は動きます?pip3 -vでバージョン確認してみて下さい。
macだとシステムにプリインストールされているpythonもあるので、それが本当に新しく入れたpython3.7.0なのかは何らかの手段で確認しておいてください。大丈夫ならpython -m pip等でpipコマンドが使えると思います
hayataka2049 様 返信遅くなり申し訳ございません。 今仕事から帰宅いたしました。 今しがた入力し試してみました。 /usr/bin/python: No module named pip このように表記されています。 これはpipがないという解釈でよろしいでしょうか?
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このような感じで長文が表示されました。 自分は初心者でこれがどのようなものなのかわかっていないのですが、どこを確認すれば良いのでしょうか。。。
pip3 --version、でした。すみません。pip3は生きてそうなのでpip3 install requestsで行けるんじゃないかなぁ。
早急な返信ありがとうございます。今打ち込みました。教本とは異なる表示ですが、こちらで正解なのでしょうか? どうぞよろしくお願い致します。 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.
python3、とターミナルで実行して>>> import requestsが通ればokです。
>>> このように通りました! これでrequestsパッケージがインストールされたということでよろしいでしょか? 本当にありがとうございます!
回答1件
あなたの回答
tips
プレビュー