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

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

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

MatplotlibはPythonのおよび、NumPy用のグラフ描画ライブラリです。多くの場合、IPythonと連携して使われます。

Python

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

Q&A

解決済

1回答

1281閲覧

pythonのライブラリを編集するための環境構築でエラーが発生する

DaiFukunaga

総合スコア3

Matplotlib

MatplotlibはPythonのおよび、NumPy用のグラフ描画ライブラリです。多くの場合、IPythonと連携して使われます。

Python

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

0グッド

0クリップ

投稿2022/11/11 00:27

前提

matplotlibの開発をしたいと思い、サイトhttps://matplotlib.org/stable/devel/development_setup.html#id3
に従い環境構築していたのですが、エラーが発生し、構築できませんでした。

実現したいこと

開発環境を作りたい。

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

以下がエラーになります。一部個人情報が含まれていたため、パスを変更しています。また、文字オーバーしたため、メッセージの関係なさそうな上部を削除しました。もし上部も必要なようでしたら、教えてください。

(mpl_dev) PS C:\Users\daipo\Documents\matplotlib> python -m pip install -ve . Using pip 22.3.1 from C:\Users\daipo\Documents\mpl_dev\lib\site-packages\pip (python 3.10) ~省略~ The above exception was the direct cause of the following exception: Traceback (most recent call last): File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 140, in run self._create_wheel_file(bdist_wheel) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 330, in _create_wheel_file files, mapping = self._run_build_commands(dist_name, unpacked, lib, tmp) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 261, in _run_build_commands self._run_build_subcommands() File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\command\editable_wheel.py", line 288, in _run_build_subcommands self.run_command(name) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\_distutils\cmd.py", line 319, in run_command self.distribution.run_command(command) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\dist.py", line 1217, in run_command super().run_command(command) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\_distutils\dist.py", line 987, in run_command cmd_obj.run() File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\command\build_ext.py", line 84, in run _build_ext.run(self) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\_distutils\command\build_ext.py", line 346, in run self.build_extensions() File "<string>", line 183, in build_extensions File "C:\Users\daipo\Documents\matplotlib\setupext.py", line 699, in do_custom_build cc.initialize() File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\_distutils\_msvccompiler.py", line 253, in initialize vc_env = _get_vc_env(plat_spec) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\msvc.py", line 214, in msvc14_get_vc_env return _msvc14_get_vc_env(plat_spec) File "C:\Users\daipo\AppData\Local\Temp\pip-build-env-r0w4vvwk\overlay\Lib\site-packages\setuptools\msvc.py", line 178, in _msvc14_get_vc_env raise distutils.errors.DistutilsPlatformError( distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ Building freetype in build\freetype-2.6.1 error: Support for editable installs via PEP 660 was recently introduced in `setuptools`. If you are seeing this error, please report to: https://github.com/pypa/setuptools/issues Meanwhile you can try the legacy behavior by setting an environment variable and trying to install again: SETUPTOOLS_ENABLE_FEATURES="legacy-editable" error: subprocess-exited-with-error × Building editable for matplotlib (pyproject.toml) did not run successfully. │ exit code: 1 ╰─> See above for output. note: This error originates from a subprocess, and is likely not a problem with pip. full command: 'C:\Users\daipo\Documents\mpl_dev\Scripts\python.exe' 'C:\Users\daipo\Documents\mpl_dev\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' build_editable 'C:\Users\daipo\AppData\Local\Temp\tmpyef3sv9m' cwd: C:\Users\daipo\Documents\matplotlib Building editable for matplotlib (pyproject.toml) ... error ERROR: Failed building editable for matplotlib Failed to build matplotlib ERROR: Could not build wheels for matplotlib, which is required to install pyproject.toml-based projects

試したこと

こちらのサイトに載っている方法は試したのですが、うまくいきませんでした。
https://stackoverflow.com/questions/71009659/note-this-error-originates-from-a-subprocess-and-is-likely-not-a-problem-with

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

こちらが私のパソコンの情報になります。
Windows 11 Home
Python 3.10.8
Power Shell
VSCode

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

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

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

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

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

jbpb0

2022/11/11 01:45 編集

> matplotlibの開発をしたい https://matplotlib.org/stable/devel/development_setup.html#install-matplotlib-in-editable-mode の「Install Matplotlib in editable mode」に 「The 'editable/develop mode', builds everything and places links in your Python environment so that Python will be able to import Matplotlib from your development source directory.」 と書かれてるようにソースファイルからビルドするので、それができる環境が要ると思います https://matplotlib.org/stable/users/installing/index.html#installing-from-source の「Installing from source」を見てください
DaiFukunaga

2022/11/11 02:46

ありがとうございました。 おっしゃる通りにしたところ、環境を作ることが出来ました。
guest

回答1

0

ベストアンサー

distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ Building freetype in build\freetype-2.6.1

C++のインストール忘れ、もしくはバージョン違いが考えられます。
他の対応策としては、Anaconda(conda-forge)を使う、matplotlibのバージョンを落としてインストールする、などの方法でも解決するかもしれません

投稿2022/11/11 00:41

pig_vba

総合スコア807

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

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

DaiFukunaga

2022/11/11 01:38

返信ありがとうございます。 C++に関しては、すでに「Microsoft Visual C++ 2015-2022 Redistributable(x64)」というものがインストールされているのですが、これではだめなのでしょうか? conda環境については、これから試してみようと思います。
pig_vba

2022/11/11 01:56

パッケージを確認した所ver14.32.31332だったので問題なさそうですね。ということは互換性の問題か、そもそもインストールする方法を間違えていたか…これ以上は詳しい方の解説を待った方がいいかもです
DaiFukunaga

2022/11/11 02:47

解決しました。おそらくSDKが入っていないためでした。 ありがとうございました。
pig_vba

2022/11/11 04:29

無事に解決できたようなので何よりです
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問