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

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

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

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

Q&A

解決済

2回答

524閲覧

wxPythonがインストールできない

naninuneno1234

総合スコア9

Python

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

0グッド

0クリップ

投稿2024/06/12 07:28

実現したいこと

wxPythonのインストール

発生している問題・分からないこと

wxPythonをインストールしようとするとエラーが出ます。

エラーメッセージ

error

1Collecting wxPython 2 Using cached wxPython-4.2.1.tar.gz (73.7 MB) 3Requirement already satisfied: pillow in /usr/local/lib/python3.8/dist-packages (from wxPython) (10.3.0) 4Requirement already satisfied: six in /usr/local/lib/python3.8/dist-packages (from wxPython) (1.16.0) 5Requirement already satisfied: numpy in /usr/local/lib/python3.8/dist-packages (from wxPython) (1.24.4) 6Building wheels for collected packages: wxPython 7 Building wheel for wxPython (setup.py) ... error 8 ERROR: Command errored out with exit status 1: 9 command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vvj3lozy/wxPython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vvj3lozy/wxPython/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d /tmp/pip-wheel-xvlska1_ 10 cwd: /tmp/pip-install-vvj3lozy/wxPython/ 11 Complete output (42 lines): 12 running bdist_wheel 13 running build 14 WARNING: Building this way assumes that all generated files have been 15 generated already. If that is not the case then use build.py directly 16 to generate the source and perform the build stage. You can use 17 --skip-build with the bdist_* or install commands to avoid this 18 message and the wxWidgets and Phoenix build steps in the future. 19 20 "/usr/bin/python3" -u build.py build 21 Will build using: "/usr/bin/python3" 22 3.8.10 (default, Nov 22 2023, 10:22:35) 23 [GCC 9.4.0] 24 Python's architecture is 64bit 25 cfg.VERSION: 4.2.1 26 27 Running command: build 28 Running command: build_wx 29 wxWidgets build options: ['--wxpython', '--unicode', '--gtk3'] 30 Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl'] 31 /tmp/pip-install-vvj3lozy/wxPython/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl 32 checking build system type... x86_64-pc-linux-gnu 33 checking host system type... x86_64-pc-linux-gnu 34 checking for toolkit... gtk 35 checking for gcc... no 36 checking for cc... no 37 checking for cl.exe... no 38 configure: error: in `/tmp/pip-install-vvj3lozy/wxPython/build/wxbld/gtk3': 39 configure: error: no acceptable C compiler found in $PATH 40 See `config.log' for more details 41 Error running configure 42 ERROR: failed building wxWidgets 43 Traceback (most recent call last): 44 File "build.py", line 1563, in cmd_build_wx 45 wxbuild.main(wxDir(), build_options) 46 File "/tmp/pip-install-vvj3lozy/wxPython/buildtools/build_wxwidgets.py", line 379, in main 47 exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts), 48 File "/tmp/pip-install-vvj3lozy/wxPython/buildtools/build_wxwidgets.py", line 72, in exitIfError 49 raise builder.BuildError(msg) 50 buildtools.builder.BuildError: Error running configure 51 Finished command: build_wx (0.465s) 52 Finished command: build (0.465s) 53 Command '"/usr/bin/python3" -u build.py build' failed with exit code 1. 54 ---------------------------------------- 55 ERROR: Failed building wheel for wxPython 56 Running setup.py clean for wxPython 57Failed to build wxPython 58Installing collected packages: wxPython 59 Running setup.py install for wxPython ... error 60 ERROR: Command errored out with exit status 1: 61 command: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vvj3lozy/wxPython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vvj3lozy/wxPython/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-record-ftcu3o1m/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/jovyan/.local/include/python3.8/wxPython 62 cwd: /tmp/pip-install-vvj3lozy/wxPython/ 63 Complete output (42 lines): 64 running install 65 running build 66 WARNING: Building this way assumes that all generated files have been 67 generated already. If that is not the case then use build.py directly 68 to generate the source and perform the build stage. You can use 69 --skip-build with the bdist_* or install commands to avoid this 70 message and the wxWidgets and Phoenix build steps in the future. 71 72 "/usr/bin/python3" -u build.py build 73 Will build using: "/usr/bin/python3" 74 3.8.10 (default, Nov 22 2023, 10:22:35) 75 [GCC 9.4.0] 76 Python's architecture is 64bit 77 cfg.VERSION: 4.2.1 78 79 Running command: build 80 Running command: build_wx 81 wxWidgets build options: ['--wxpython', '--unicode', '--gtk3'] 82 Configure options: ['--enable-unicode', '--with-gtk=3', '--enable-sound', '--enable-graphics_ctx', '--enable-display', '--enable-geometry', '--enable-debug_flag', '--enable-optimise', '--disable-debugreport', '--enable-uiactionsim', '--enable-autoidman', '--with-sdl'] 83 /tmp/pip-install-vvj3lozy/wxPython/ext/wxWidgets/configure --enable-unicode --with-gtk=3 --enable-sound --enable-graphics_ctx --enable-display --enable-geometry --enable-debug_flag --enable-optimise --disable-debugreport --enable-uiactionsim --enable-autoidman --with-sdl 84 checking build system type... x86_64-pc-linux-gnu 85 checking host system type... x86_64-pc-linux-gnu 86 checking for toolkit... gtk 87 checking for gcc... no 88 checking for cc... no 89 checking for cl.exe... no 90 configure: error: in `/tmp/pip-install-vvj3lozy/wxPython/build/wxbld/gtk3': 91 configure: error: no acceptable C compiler found in $PATH 92 See `config.log' for more details 93 Error running configure 94 ERROR: failed building wxWidgets 95 Traceback (most recent call last): 96 File "build.py", line 1563, in cmd_build_wx 97 wxbuild.main(wxDir(), build_options) 98 File "/tmp/pip-install-vvj3lozy/wxPython/buildtools/build_wxwidgets.py", line 379, in main 99 exitIfError(wxBuilder.configure(dir=wxRootDir, options=configure_opts), 100 File "/tmp/pip-install-vvj3lozy/wxPython/buildtools/build_wxwidgets.py", line 72, in exitIfError 101 raise builder.BuildError(msg) 102 buildtools.builder.BuildError: Error running configure 103 Finished command: build_wx (0.435s) 104 Finished command: build (0.435s) 105 Command '"/usr/bin/python3" -u build.py build' failed with exit code 1. 106 ---------------------------------------- 107ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-vvj3lozy/wxPython/setup.py'"'"'; __file__='"'"'/tmp/pip-install-vvj3lozy/wxPython/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-record-ftcu3o1m/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/jovyan/.local/include/python3.8/wxPython Check the logs for full command output.

該当のソースコード

pip install wxPython

試したこと・調べたこと

  • teratailやGoogle等で検索した
  • ソースコードを自分なりに変更した
  • 知人に聞いた
  • その他
上記の詳細・結果

https://asdm.hatenablog.com/entry/2015/08/28/230147
上記サイトより、

pip install http://www.wxpython.org/Phoenix/snapshot-builds/wxPython-4.2.1-cp38-cp38-win_amd64.whl

pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/wxPython-4.2.1-cp38-cp38-win_amd64.whl

とやってみましたがうまくいきませんでした。

補足

特になし

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

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

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

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

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

melian

2024/06/12 08:17

configure スクリプトの出力メッセージでは以下の様に表示されていますので、C コンパイラがインストールされていないのだろうと思います。(PATH 以外のディレクトリにインストールされているのかもしれませんけれども) checking for gcc... no checking for cc... no checking for cl.exe... no configure: error: in `/tmp/pip-install-vvj3lozy/wxPython/build/wxbld/gtk3': configure: error: no acceptable C compiler found in $PATH また、以下のメッセージから、そちらで使用している PC は 64ビット Intel CPU で、OS は Linux なのでしょう。 checking build system type... x86_64-pc-linux-gnu checking host system type... x86_64-pc-linux-gnu wxPython-4.2.1-cp38-cp38-win_amd64.whl は Windows OS 向けのパッケージ(wheel 形式)なので、Linux システムにはインストールすることができません。 (現時点で Linux システム向けの wheel パッケージは提供されていない模様です) > 上記サイトより、 > > pip install http://www.wxpython.org/Phoenix/snapshot-builds/wxPython-4.2.1-cp38-cp38-win_amd64.whl > pip install -U --pre -f https://wxpython.org/Phoenix/snapshot-builds/wxPython-4.2.1-cp38-cp38-win_amd64.whl > > とやってみましたがうまくいきませんでした。
guest

回答2

0

自己解決

https://qiita.com/hotstaff/items/b3f8bb4c3c098d95925c
上記サイトより
パッケージの場所が変わっていたためインストールできなかったようです。
http://www.wxpython.org/Phoenix/snapshot-builds
ではなく
https://extras.wxpython.org/wxPython4/extras/linux/gtk3/ubuntu-20.04/
にしたところインストールできました。
回答していただいた方々、ありがとうございました。
また、なぜかテラテイルのページが開けず返答が遅れてしまいました。
すみませんでした。

投稿2024/06/18 23:43

naninuneno1234

総合スコア9

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

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

0

https://github.com/wxWidgets/Phoenix/blob/wxPython-4.2.1/README.rst#user-content-prerequisites
に、Ubuntuの場合の"wxPythonをビルドするのに必要なパッケージ"が書いてあります。
apt installでこれらをインストールしてください。
他のLinuxディストリビューションに関しては各自がんばれ、という感じですね。

(ログの感じから明らかにUnix系のOSです。これ以上の手助けが必要なら、環境を正しく伝えてもらう必要があります)

投稿2024/06/12 08:13

編集2024/06/13 01:15
quickquip

総合スコア11303

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

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

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

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

ただいまの回答率
85.31%

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

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

質問する

関連した質問