0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

bash: pip: コマンドが見つかりませんでした...(JupyterNotebookのインストール)

Last updated at Posted at 2022-12-03

pipが実行できない

概要

新規でVirtualboxをインストールし、CentOS7にJuptyer Notebookをインストールしようとしたらpipエラー

・コンソール画面
image.png

できるように調べてみる

その辺の記事に書いてあったコマンドを実行。

curl -kL https://bootstrap.pypa.io/get-pip.py | python

・コンソール画面
エラーメッセージが出力された。
image.png

This script does not work on Python 2.7 The minimum supported Python version is 3.7 please use https://bootstrap.pypa.io/pip/2.7/get-pip.py insteas.
(このスクリプトは Python 2.7 では動作しません。サポートされている Python の最小バージョンは 3.7 です。https://bootstrap.pypa.io/pip/2.7/get-pip.py を使用してください。)

どうやらインストールするアレは環境によって違うようだぜ。
エラーの内容に従って、再度実行。

curl -kL https://bootstrap.pypa.io/pip/2.7/get-pip.py | python

image.png

インストールできた気がしますなぁ!Successfullyっていってるし!

JuptyerNotebookをインストール

pip install jupyter

実行!!
image.png
・・・
image.png
ERROR
なんで?

Juptyerインストール時のエラーを解決する

上記のエラーを翻訳で直してみる

エラー: コマンドが終了ステータス 1 でエラーになりました:
コマンド: /bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-t2zUFu/send2trash/setup.py'"'"'; __file__='"'"'/tmp/pip-install-t2zUFu/send2trash/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__) ;code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(コンパイル( code, __file__, '"'"'exec'"'"'))' Egg_info --egg-base /tmp/pip-pip-egg-info-jP6ad_
cwd: /tmp/pip-install-t2zUFu/send2trash/
完全な出力 (5 行):
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: 不明な配布オプション: 'long_description_content_type'
warnings.warn(メッセージ)
/usr/lib64/python2.7/distutils/dist.py:267: UserWarning: 不明な配布オプション: 'project_urls'
warnings.warn(メッセージ)
Send2Trash セットアップ コマンドのエラー: 'extras_require' は、値が有効なプロジェクト/バージョン要件指定子を含む文字列または文字列のリストである辞書である必要があります。
--------------------------------------------
エラー: コマンドが終了ステータス 1 でエラーになりました: python setup.py egg_info ログで完全なコマンド出力を確認してください。

とりあえずpython setup.py egg_info ログを見ればええんか…?
しかし、めんどそうなので"python setup.py egg_info ログ"でググって検索でヒットしたやつで試してみる。

pip install --upgrade pip setuptools
image.png
ERROR: pip's legach dependency sesolver does not consider dependency conflicts when selecting packages.
This behaviour is the source og the following dependency conflicts.
ipapython 4.6.8 requres dnspython>=1.15, but you'll have dnspython 1.12.0 which is incompatible.
ipapython 4.6.8 requres python-ldap>=3.0.0b1, but you'll have python-ldap 2.4.15 which is incompatible.
エラー: pip のレガシー依存関係セソルバーは、パッケージを選択するときに依存関係の競合を考慮しません。
この動作は、次の依存関係の競合の原因です。
ipapython 4.6.8 には dnspython>=1.15 が必要ですが、互換性のない dnspython 1.12.0 が必要です。
ipapython 4.6.8 には python-ldap>=3.0.0b1 が必要ですが、互換性のない python-ldap 2.4.15 が必要です。

依存系のうんちゃらっぽいのでスルー
再度実行!

pip install jupyter
image.png
エラー発生
うぜぇなぁ!!!

ERROR: Cannot uninstall 'pyparsing'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
エラー: 'pyparsing' をアンインストールできません。これは distutils がインストールされたプロジェクトであるため、どのファイルがそれに属しているかを正確に判断できず、部分的なアンインストールのみが発生します。

ググった結果、pyparsingを更新すればいいということらしい。

pip install -I pyparsing==2.4.7
image.png

再度実行

pip install jupyter
image.png
エラーなし!

こっちもインストール

pip install notebook
image.png

こっちもエラーなし!

Jupyter Notebook実行

コンソールより、以下を入力

jupyter notebook
image.png

起動できたぜ。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?