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

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

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

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

Q&A

解決済

2回答

2944閲覧

%pip install sympyでのエラーコードを解決したいです。

jack_kanzaki

総合スコア106

Jupyter

Jupyter (旧IPython notebook)は、Notebook形式でドキュメント作成し、プログラムの記述・実行、その実行結果を記録するツールです。メモの作成や保存、共有、確認などもブラウザ上で行うことができます。

Python

Pythonは、コードの読みやすさが特徴的なプログラミング言語の1つです。 強い型付け、動的型付けに対応しており、後方互換性がないバージョン2系とバージョン3系が使用されています。 商用製品の開発にも無料で使用でき、OSだけでなく仮想環境にも対応。Unicodeによる文字列操作をサポートしているため、日本語処理も標準で可能です。

AWS(Amazon Web Services)

Amazon Web Services (AWS)は、仮想空間を機軸とした、クラスター状のコンピュータ・ネットワーク・データベース・ストーレッジ・サポートツールをAWSというインフラから提供する商用サービスです。

0グッド

0クリップ

投稿2019/08/19 10:03

Jupyterでセルに%pip install sympyと入力したところ、下記のようなエラーコードが出てしまいました。自分でもいろいろと解決を図ったのですが、解決出来ず、質問させていただきます。
尚、AWSにファイルを保存しています。

Jupyter

1Collecting sympy 2 Using cached https://files.pythonhosted.org/packages/21/21/f4105795ca7f35c541d82c5b06be684dd2f5cb4f508fb487cd7aea4de776/sympy-1.4-py2.py3-none-any.whl 3Collecting mpmath>=0.19 (from sympy) 4 Using cached https://files.pythonhosted.org/packages/ca/63/3384ebb3b51af9610086b23ea976e6d27d6d97bf140a76a365bd77a3eb32/mpmath-1.1.0.tar.gz 5Installing collected packages: mpmath, sympy 6 Running setup.py install for mpmath ... error 7 Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1uh0srde/mpmath/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bgnm5odt-record/install-record.txt --single-version-externally-managed --compile: 8 running install 9 running build 10 running build_py 11 creating build 12 creating build/lib 13 creating build/lib/mpmath 14 copying mpmath/function_docs.py -> build/lib/mpmath 15 copying mpmath/ctx_fp.py -> build/lib/mpmath 16 copying mpmath/visualization.py -> build/lib/mpmath 17 copying mpmath/__init__.py -> build/lib/mpmath 18 copying mpmath/ctx_iv.py -> build/lib/mpmath 19 copying mpmath/ctx_mp_python.py -> build/lib/mpmath 20 copying mpmath/identification.py -> build/lib/mpmath 21 copying mpmath/rational.py -> build/lib/mpmath 22 copying mpmath/ctx_mp.py -> build/lib/mpmath 23 copying mpmath/math2.py -> build/lib/mpmath 24 copying mpmath/usertools.py -> build/lib/mpmath 25 copying mpmath/ctx_base.py -> build/lib/mpmath 26 creating build/lib/mpmath/libmp 27 copying mpmath/libmp/libelefun.py -> build/lib/mpmath/libmp 28 copying mpmath/libmp/libmpc.py -> build/lib/mpmath/libmp 29 copying mpmath/libmp/__init__.py -> build/lib/mpmath/libmp 30 copying mpmath/libmp/libmpf.py -> build/lib/mpmath/libmp 31 copying mpmath/libmp/libintmath.py -> build/lib/mpmath/libmp 32 copying mpmath/libmp/backend.py -> build/lib/mpmath/libmp 33 copying mpmath/libmp/libhyper.py -> build/lib/mpmath/libmp 34 copying mpmath/libmp/libmpi.py -> build/lib/mpmath/libmp 35 copying mpmath/libmp/gammazeta.py -> build/lib/mpmath/libmp 36 copying mpmath/libmp/six.py -> build/lib/mpmath/libmp 37 creating build/lib/mpmath/calculus 38 copying mpmath/calculus/calculus.py -> build/lib/mpmath/calculus 39 copying mpmath/calculus/__init__.py -> build/lib/mpmath/calculus 40 copying mpmath/calculus/optimization.py -> build/lib/mpmath/calculus 41 copying mpmath/calculus/quadrature.py -> build/lib/mpmath/calculus 42 copying mpmath/calculus/differentiation.py -> build/lib/mpmath/calculus 43 copying mpmath/calculus/inverselaplace.py -> build/lib/mpmath/calculus 44 copying mpmath/calculus/approximation.py -> build/lib/mpmath/calculus 45 copying mpmath/calculus/odes.py -> build/lib/mpmath/calculus 46 copying mpmath/calculus/extrapolation.py -> build/lib/mpmath/calculus 47 copying mpmath/calculus/polynomials.py -> build/lib/mpmath/calculus 48 creating build/lib/mpmath/functions 49 copying mpmath/functions/zeta.py -> build/lib/mpmath/functions 50 copying mpmath/functions/expintegrals.py -> build/lib/mpmath/functions 51 copying mpmath/functions/__init__.py -> build/lib/mpmath/functions 52 copying mpmath/functions/rszeta.py -> build/lib/mpmath/functions 53 copying mpmath/functions/qfunctions.py -> build/lib/mpmath/functions 54 copying mpmath/functions/functions.py -> build/lib/mpmath/functions 55 copying mpmath/functions/bessel.py -> build/lib/mpmath/functions 56 copying mpmath/functions/zetazeros.py -> build/lib/mpmath/functions 57 copying mpmath/functions/factorials.py -> build/lib/mpmath/functions 58 copying mpmath/functions/hypergeometric.py -> build/lib/mpmath/functions 59 copying mpmath/functions/theta.py -> build/lib/mpmath/functions 60 copying mpmath/functions/orthogonal.py -> build/lib/mpmath/functions 61 copying mpmath/functions/elliptic.py -> build/lib/mpmath/functions 62 creating build/lib/mpmath/matrices 63 copying mpmath/matrices/calculus.py -> build/lib/mpmath/matrices 64 copying mpmath/matrices/eigen.py -> build/lib/mpmath/matrices 65 copying mpmath/matrices/eigen_symmetric.py -> build/lib/mpmath/matrices 66 copying mpmath/matrices/__init__.py -> build/lib/mpmath/matrices 67 copying mpmath/matrices/linalg.py -> build/lib/mpmath/matrices 68 copying mpmath/matrices/matrices.py -> build/lib/mpmath/matrices 69 creating build/lib/mpmath/tests 70 copying mpmath/tests/test_eigen.py -> build/lib/mpmath/tests 71 copying mpmath/tests/test_visualization.py -> build/lib/mpmath/tests 72 copying mpmath/tests/test_special.py -> build/lib/mpmath/tests 73 copying mpmath/tests/torture.py -> build/lib/mpmath/tests 74 copying mpmath/tests/test_summation.py -> build/lib/mpmath/tests 75 copying mpmath/tests/test_eigen_symmetric.py -> build/lib/mpmath/tests 76 copying mpmath/tests/test_functions.py -> build/lib/mpmath/tests 77 copying mpmath/tests/extratest_zeta.py -> build/lib/mpmath/tests 78 copying mpmath/tests/test_matrices.py -> build/lib/mpmath/tests 79 copying mpmath/tests/test_rootfinding.py -> build/lib/mpmath/tests 80 copying mpmath/tests/test_mpmath.py -> build/lib/mpmath/tests 81 copying mpmath/tests/test_identify.py -> build/lib/mpmath/tests 82 copying mpmath/tests/test_quad.py -> build/lib/mpmath/tests 83 copying mpmath/tests/__init__.py -> build/lib/mpmath/tests 84 copying mpmath/tests/test_calculus.py -> build/lib/mpmath/tests 85 copying mpmath/tests/test_basic_ops.py -> build/lib/mpmath/tests 86 copying mpmath/tests/test_bitwise.py -> build/lib/mpmath/tests 87 copying mpmath/tests/test_str.py -> build/lib/mpmath/tests 88 copying mpmath/tests/test_functions2.py -> build/lib/mpmath/tests 89 copying mpmath/tests/test_convert.py -> build/lib/mpmath/tests 90 copying mpmath/tests/test_power.py -> build/lib/mpmath/tests 91 copying mpmath/tests/test_hp.py -> build/lib/mpmath/tests 92 copying mpmath/tests/extratest_gamma.py -> build/lib/mpmath/tests 93 copying mpmath/tests/test_elliptic.py -> build/lib/mpmath/tests 94 copying mpmath/tests/test_division.py -> build/lib/mpmath/tests 95 copying mpmath/tests/test_ode.py -> build/lib/mpmath/tests 96 copying mpmath/tests/test_fp.py -> build/lib/mpmath/tests 97 copying mpmath/tests/runtests.py -> build/lib/mpmath/tests 98 copying mpmath/tests/test_linalg.py -> build/lib/mpmath/tests 99 copying mpmath/tests/test_gammazeta.py -> build/lib/mpmath/tests 100 copying mpmath/tests/test_trig.py -> build/lib/mpmath/tests 101 copying mpmath/tests/test_pickle.py -> build/lib/mpmath/tests 102 copying mpmath/tests/test_compatibility.py -> build/lib/mpmath/tests 103 copying mpmath/tests/test_levin.py -> build/lib/mpmath/tests 104 copying mpmath/tests/test_interval.py -> build/lib/mpmath/tests 105 copying mpmath/tests/test_diff.py -> build/lib/mpmath/tests 106 running install_lib 107 creating /usr/lib/python3.6/dist-packages/mpmath 108 error: could not create '/usr/lib/python3.6/dist-packages/mpmath': Permission denied 109 110 ---------------------------------------- 111Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-1uh0srde/mpmath/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-bgnm5odt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-1uh0srde/mpmath/ 112You are using pip version 9.0.3, however version 19.2.2 is available. 113You should consider upgrading via the 'pip install --upgrade pip' command. 114Note: you may need to restart the kernel to use updated packages.

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

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

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

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

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

guest

回答2

0

ベストアンサー

yuokadaさんのコメントに付けようかと思ったのですが、リンクが面倒なので、、

error: could not create '/usr/lib/python3.6/dist-packages/mpmath': Permission denied

アクセス権が無いってことですね。

一つは、sudo で /usr/lib/python3.6 以下のアクセス権を 書き込み可とするのか? と思いつつ、調べると結構、同じ問題は多いようです。

他には、、と思ったら、「sudo: pip: コマンドが見つかりません」というエラー に巧妙な方法がありました。 sudoでエラーになるのは、sudo のパスに pipが無いから、だったら、フルパスで示せば、良いとの事。

最初に which pip で、pipのパスを確認して、そのパスを使って、sudo [pip のパス] install sympy を実行すれば、良いのではないかと。
(shell コマンドの指定次第では、一行で済みそうですが、ちょっと思い出せない)

あとは、sudoでpip installする てのもありました。
こちらは、pythonを呼んで、そこで pip sudo python3.6 -m pip install モジュール名

なお、yuokadaさんの --user オプションは、上記のディレクトリで無く、ユーザーディレクトリにinstallするようなので、install先が分散するみたいです。

すぐに試せる環境が無いので、情報のみ。

投稿2019/08/20 15:02

pepperleaf

総合スコア6383

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

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

jack_kanzaki

2019/08/22 08:37

既にsympyがインストールされており、改めてインストールし直す必要はありませんでした。 ご回答いただき、本当にありがとうございます。
guest

0

Permission denied が出ているのでsudoをつけて実行すればインストール出来ると思います。

pipもアップデートした方が良いですね。

% sudo pip install -U pip % sudo pip install sympy

投稿2019/08/19 10:33

yuokada

総合スコア550

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

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

jack_kanzaki

2019/08/19 11:29

Jupyter notebook上でセルに% sudo pip install sympyと入力したところ UsageError: Line magic function `%` not found. と表示されました。 また、AWSのターミナルでec2-user:~/environment $ sudo pip install sympyと入力したところ、 sudo: pip: command not foundとなり、 インストールできない状況となってしまいました。 引き続きよろしくお願いいたします。
jack_kanzaki

2019/08/19 15:02

破線の手前、error: could not create '/usr/lib/python3.6/dist-packages/mpmath': Permission denied という箇所が原因かなと考えています。 もし解決できる方がいらっしゃいましたら、よろしくお願いします。
yuokada

2019/08/20 11:43 編集

jupyter上で pip install --user sympy を試してみてください。
jack_kanzaki

2019/08/22 08:35

AWS上でsympyが既にインストールされていることに気づき、pipを用いずに今回はimportできました。 今後ともよろしくお願いします!!
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.50%

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

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

質問する

関連した質問