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

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

新規登録して質問してみよう
ただいま回答率
86.02%
Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

Python

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

Q&A

解決済

wxpythonのインストールエラーが解決できません

Seiichi
Seiichi

総合スコア3

Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

Python

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。

1回答

0グッド

0クリップ

2821閲覧

投稿2022/07/18 12:45

編集2022/07/18 12:49

前提

プログラミング初心者です。
Python 3.10.5 に wxPython をインストールしたいのですが、エラーで出て困っています。

実現したいこと

Pythonのバージョンはこだわっていないので、wxPythonを動くようにしたいです。

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

>py -m pip install wxpython Collecting wxpython Using cached wxPython-4.1.1.tar.gz (66.0 MB) Preparing metadata (setup.py) ... done Collecting pillow Using cached Pillow-9.2.0-cp310-cp310-win_amd64.whl (3.3 MB) Requirement already satisfied: six in c:\users\ka\appdata\local\programs\python\python310\lib\site-packages (from wxpython) (1.16.0) Requirement already satisfied: numpy in c:\users\ka\appdata\local\programs\python\python310\lib\site-packages (from wxpython) (1.23.1) Using legacy 'setup.py install' for wxpython, since package 'wheel' is not installed. Installing collected packages: pillow, wxpython Running setup.py install for wxpython ... error error: subprocess-exited-with-error × Running setup.py install for wxpython did not run successfully. │ exit code: 1 ╰─> [51 lines of output] C:\Users\ka\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py:717: UserWarning: Usage of dash-separated 'license-file' will not be supported in future versions. Please use the underscore name 'license_file' instead warnings.warn( C:\Users\ka\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\dist.py:294: DistDeprecationWarning: use_2to3 is ignored. warnings.warn(f"{attr} is ignored.", DistDeprecationWarning) running install running build C:\Users\ka\AppData\Local\Temp\pip-install-t4fgrz5j\wxpython_6d964dd3320f4efd883f15b257718131\build.py:41: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives from distutils.dep_util import newer, newer_group Will build using: "C:\Users\ka\AppData\Local\Programs\Python\Python310\python.exe" 3.10.5 (tags/v3.10.5:f377153, Jun 6 2022, 16:14:13) [MSC v.1929 64 bit (AMD64)] Python's architecture is 64bit cfg.VERSION: 4.1.1 Running command: build Running command: build_wx Command '"C:\Users\ka\AppData\Local\Programs\Python\Python310\python.exe" -c "import setuptools, distutils.msvc9compiler as msvc; mc = msvc.MSVCCompiler(); mc.initialize(); print(mc.cc)"' failed with exit code 1. Traceback (most recent call last): File "<string>", line 1, in <module> File "C:\Users\ka\AppData\Local\Programs\Python\Python310\lib\distutils\msvc9compiler.py", line 371, in initialize vc_env = query_vcvarsall(VERSION, plat_spec) File "C:\Users\ka\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 140, in msvc9_query_vcvarsall return EnvironmentInfo(arch, ver).return_env() File "C:\Users\ka\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 1740, in return_env [self.VCIncludes, File "C:\Users\ka\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 1282, in VCIncludes return [join(self.si.VCInstallDir, 'Include'), File "C:\Users\ka\AppData\Local\Programs\Python\Python310\lib\site-packages\setuptools\msvc.py", line 840, in VCInstallDir raise distutils.errors.DistutilsPlatformError(msg) distutils.errors.DistutilsPlatformError: Microsoft Visual C++ 14.2 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/ Finished command: build_wx (0.401s) Finished command: build (0.401s) WARNING: Building this way assumes that all generated files have been generated already. If that is not the case then use build.py directly to generate the source and perform the build stage. You can use --skip-build with the bdist_* or install commands to avoid this message and the wxWidgets and Phoenix build steps in the future. "C:\Users\ka\AppData\Local\Programs\Python\Python310\python.exe" -u build.py build Command '"C:\Users\ka\AppData\Local\Programs\Python\Python310\python.exe" -u build.py build' failed with exit code 1. [end of output] note: This error originates from a subprocess, and is likely not a problem with pip. error: legacy-install-failure × Encountered error while trying to install package. ╰─> wxpython note: This is an issue with the package mentioned above, not pip. hint: See above for output from the failure.

該当のソースコード

python

1>py -m pip install wxpython

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

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

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

下記のような質問は推奨されていません。

  • 質問になっていない投稿
  • スパムや攻撃的な表現を用いた投稿

適切な質問に修正を依頼しましょう。

回答1

1

ベストアンサー

wxPython のwheelがpython3.10では用意されていないので、python3.9以下にバージョンを落としてインストールした方が楽だと思います。

投稿2022/07/18 12:56

East_san

総合スコア407

Seiichi👍を押しています

下記のような回答は推奨されていません。

  • 質問の回答になっていない投稿
  • スパムや攻撃的な表現を用いた投稿

このような回答には修正を依頼しましょう。

回答へのコメント

Seiichi

2022/07/18 13:06

解決できました。ありがとうございます!

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

ただいまの回答率
86.02%

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

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

質問する

関連した質問

同じタグがついた質問を見る

Windows 10

Windows 10は、マイクロソフト社がリリースしたOSです。Modern UIを標準画面にした8.1から、10では再びデスクトップ主体に戻され、UIも変更されています。PCやスマホ、タブレットなど様々なデバイスに幅広く対応していることが特徴です。

Python

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

pip

pipとは、Pythonを用いて書かれているパッケージソフトのインストールや管理を行うためのパッケージマネジメントシステムです。pipを使う主なメリットは、コマンドラインインターフェースにて容易にPythonパッケージソフトをインストール可能だという点です。