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

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

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

Raspbianは、DebianベースのRaspberry Pi用ディストリビューション。ハードウェア浮動小数点演算を有効にすることが可能で、Webブラウズなどの速度を向上できます。

NumPy

NumPyはPythonのプログラミング言語の科学的と数学的なコンピューティングに関する拡張モジュールです。

OpenCV

OpenCV(オープンソースコンピュータービジョン)は、1999年にインテルが開発・公開したオープンソースのコンピュータビジョン向けのクロスプラットフォームライブラリです。

Raspberry Pi

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

Python

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

Q&A

1回答

907閲覧

ラズベリーパイを用いて画像処理を行いたいです。

退会済みユーザー

退会済みユーザー

総合スコア0

Raspbian

Raspbianは、DebianベースのRaspberry Pi用ディストリビューション。ハードウェア浮動小数点演算を有効にすることが可能で、Webブラウズなどの速度を向上できます。

NumPy

NumPyはPythonのプログラミング言語の科学的と数学的なコンピューティングに関する拡張モジュールです。

OpenCV

OpenCV(オープンソースコンピュータービジョン)は、1999年にインテルが開発・公開したオープンソースのコンピュータビジョン向けのクロスプラットフォームライブラリです。

Raspberry Pi

Raspberry Piは、ラズベリーパイ財団が開発した、名刺サイズのLinuxコンピュータです。 学校で基本的なコンピュータ科学の教育を促進することを意図しています。

Python

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

0グッド

0クリップ

投稿2020/02/16 07:33

前提・実現したい

ラズパイを用いて画像処理100本ノックを行おうとしており、berryconda3を用いてチュートリアルの通りに環境構築していきました。Pythonです。

pip install numpy matplotlib opencv-python

実行中に以下のエラーメッセージが発生しました。
どうすればうまくインストールできるでしょうか。

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

Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-3i1xza0_/matplotlib/

該当のソースコード

(gasyori100) pi@raspberrypi:~/Gasyori100knock $ pip install numpy matplotlib opencv-python --user Looking in indexes: https://pypi.org/simple, https://www.piwheels.org/simple Collecting numpy Using cached https://files.pythonhosted.org/packages/40/de/0ea5092b8bfd2e3aa6fdbb2e499a9f9adf810992884d414defc1573dca3f/numpy-1.18.1.zip Installing build dependencies ... done Collecting matplotlib Using cached https://files.pythonhosted.org/packages/be/74/24d058c17b155d131359f1cd01e120b3954686bf8b7853172b279237e1dc/matplotlib-3.1.3.tar.gz Complete output from command python setup.py egg_info: Processing numpy/random/_bounded_integers.pxd.in Processing numpy/random/_sfc64.pyx Traceback (most recent call last): File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/tools/cythonize.py", line 61, in process_pyx from Cython.Compiler.Version import version as cython_version ModuleNotFoundError: No module named 'Cython' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/tools/cythonize.py", line 238, in <module> main() File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/tools/cythonize.py", line 234, in main find_process_files(root_dir) File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/tools/cythonize.py", line 225, in find_process_files process(root_dir, fromfile, tofile, function, hash_db) File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/tools/cythonize.py", line 191, in process processor_function(fromfile, tofile) File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/tools/cythonize.py", line 66, in process_pyx raise OSError('Cython needs to be installed in Python as a module') OSError: Cython needs to be installed in Python as a module Running from numpy source directory. /tmp/easy_install-jtt3ee4f/numpy-1.18.1/setup.py:461: UserWarning: Unrecognized setuptools command, proceeding with generating Cython sources and expanding templates run_build = parse_setuppy_commands() Traceback (most recent call last): File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile exec(code, globals, locals) File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/setup.py", line 488, in <module> File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/setup.py", line 469, in setup_package File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/setup.py", line 275, in generate_cython version=__version__, RuntimeError: Running cythonize failed! During handling of the above exception, another exception occurred: Traceback (most recent call last): File "<string>", line 1, in <module> File "/tmp/pip-install-3i1xza0_/matplotlib/setup.py", line 311, in <module> cmdclass=cmdclass, File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/__init__.py", line 139, in setup _install_setup_requires(attrs) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/__init__.py", line 134, in _install_setup_requires dist.fetch_build_eggs(dist.setup_requires) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/dist.py", line 514, in fetch_build_eggs replace_conflicting=True, File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/pkg_resources/__init__.py", line 777, in resolve replace_conflicting=replace_conflicting File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1060, in best_match return self.obtain(req, installer) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/pkg_resources/__init__.py", line 1072, in obtain return installer(requirement) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/dist.py", line 581, in fetch_build_egg return cmd.easy_install(req) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 676, in easy_install return self.install_item(spec, dist.location, tmpdir, deps) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 702, in install_item dists = self.install_eggs(spec, download, tmpdir) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 887, in install_eggs return self.build_and_install(setup_script, setup_base) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1155, in build_and_install self.run_setup(setup_script, setup_base, args) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/command/easy_install.py", line 1141, in run_setup run_setup(setup_script, args) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 253, in run_setup raise File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/contextlib.py", line 99, in __exit__ self.gen.throw(type, value, traceback) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/contextlib.py", line 99, in __exit__ self.gen.throw(type, value, traceback) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 166, in save_modules saved_exc.resume() File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 141, in resume six.reraise(type, exc, self._tb) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/_vendor/six.py", line 685, in reraise raise value.with_traceback(tb) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 154, in save_modules yield saved File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 195, in setup_context yield File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 250, in run_setup _execfile(setup_script, ns) File "/home/pi/berryconda3/envs/gasyori100/lib/python3.6/site-packages/setuptools/sandbox.py", line 45, in _execfile exec(code, globals, locals) File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/setup.py", line 488, in <module> File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/setup.py", line 469, in setup_package File "/tmp/easy_install-jtt3ee4f/numpy-1.18.1/setup.py", line 275, in generate_cython version=__version__, RuntimeError: Running cythonize failed! ================================================================================ Edit setup.cfg to change the build options BUILDING MATPLOTLIB matplotlib: yes [3.1.3] python: yes [3.6.6 | packaged by rpi | (default, Sep 6 2018, 10:56:14) [GCC 6.3.0 20170516]] platform: yes [linux] OPTIONAL SUBPACKAGES sample_data: yes [installing] tests: no [skipping due to configuration] OPTIONAL BACKEND EXTENSIONS agg: yes [installing] tkagg: yes [installing; run-time loading from Python Tcl/Tk] macosx: no [Mac OS-X only] OPTIONAL PACKAGE DATA dlls: no [skipping due to configuration] Cythonizing sources ---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-install-3i1xza0_/matplotlib/

試したこと

pip install -r requirements.txt

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

https://github.com/yoyoyo-yo/Gasyori100knock/tree/master/Tutorial

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

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

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

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

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

guest

回答1

0

ModuleNotFoundError: No module named 'Cython'

Cython入ってないよってエラー出てるので、先にpip install cythonを実行してみてはいかがでしょうか。

投稿2020/02/16 07:59

yukkeorg

総合スコア985

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

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

退会済みユーザー

退会済みユーザー

2020/02/16 18:08

返信ありがとうございます。 https://qiita.com/rsm223_rip/items/c6105d22ba360623530a こちらのサイトを参考にしてopencvを入れてみました。 (gasyori100) pi@raspberrypi:~/Gasyori100knock $ conda install -c conda-forge opencv Fetching package metadata ....... Solving package specifications: . # All requested packages already installed. # packages in environment at /home/pi/berryconda3/envs/gasyori100: # opencv 3.3.0 py36hb02bd27_0 (gasyori100) pi@raspberrypi:~/Gasyori100knock $ python sample.py OpenCV Error: Unspecified error (The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script) in cvShowImage, file /home/jhelmus/conda/conda-bld/opencv_1512148862464/work/modules/highgui/src/window.cpp, line 605 Traceback (most recent call last): File "sample.py", line 4, in <module> cv2.imshow("imori", img) cv2.error: /home/jhelmus/conda/conda-bld/opencv_1512148862464/work/modules/highgui/src/window.cpp:605: error: (-2) The function is not implemented. Rebuild the library with Windows, GTK+ 2.x or Carbon support. If you are on Ubuntu or Debian, install libgtk2.0-dev and pkg-config, then re-run cmake or configure script in function cvShowImage とまたエラーがでてしまい、先に進めない状況です。差し支えなければ助言をいただきたいのですが、よろしくお願いします。
退会済みユーザー

退会済みユーザー

2020/02/16 19:07

一応opencvは使えるようになったのですが、画像の表示のみができない、と言う症状です。
yukkeorg

2020/02/17 11:44

どの様に画像が表示されないのか教えていただけますか? 例)X Window上で作ったプログラムを実行したが、ウインドウが表示されるものの画像が表示されない
guest

あなたの回答

tips

太字

斜体

打ち消し線

見出し

引用テキストの挿入

コードの挿入

リンクの挿入

リストの挿入

番号リストの挿入

表の挿入

水平線の挿入

プレビュー

まだベストアンサーが選ばれていません

会員登録して回答してみよう

アカウントをお持ちの方は

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

ただいまの回答率
85.48%

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

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

質問する

関連した質問