Skip to main content
本文から 41 文字削除
ソース リンク
pekochun
  • 417
  • 1
  • 5
  • 20
$ pip install numpy opencv-python
Requirement already satisfied: numpy in /home/vagrant/.local/lib/python3.4/site-packages (1.15.2)
Requirement already satisfied: opencv-python in /home/vagrant/.local/lib/python3.4/site-packages (3.4.3.18)
vagrant@vagrant-ubuntu-trusty-64:~/workspace/pythonCapture 

$ python testcap.py
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    import numpy as np
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/core/__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name multiarray
$ pip install numpy opencv-python
Requirement already satisfied: numpy in /home/vagrant/.local/lib/python3.4/site-packages (1.15.2)
Requirement already satisfied: opencv-python in /home/vagrant/.local/lib/python3.4/site-packages (3.4.3.18)
vagrant@vagrant-ubuntu-trusty-64:~/workspace/pythonCapture$ python test.py
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    import numpy as np
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/core/__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name multiarray
$ pip install numpy opencv-python
Requirement already satisfied: numpy in /home/vagrant/.local/lib/python3.4/site-packages (1.15.2)
Requirement already satisfied: opencv-python in /home/vagrant/.local/lib/python3.4/site-packages (3.4.3.18)
 

$ python cap.py
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    import numpy as np
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/core/__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name multiarray
本文に 2543 文字追加
ソース リンク
pekochun
  • 417
  • 1
  • 5
  • 20

[追記]

sudo apt-get install libblas3 liblapack3 libc6

上記のコマンドを実行しても同様のエラーが出ました。
回答して頂いた下記のコマンドも実行してみました。
実行コマンドとエラー文を下記に記載します。


$ sudo apt-get install python3-venv
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
E: パッケージ python3-venv が見つかりません

$ python3 -m venv env
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

vagrant@vagrant-ubuntu-trusty-64:~/workspace/pythonCapture$ souece env/bin/activate
souece: command not found

$ source env/bin/activate
-bash: env/bin/activate: No such file or directory

$ pip install numpy opencv-python
Requirement already satisfied: numpy in /home/vagrant/.local/lib/python3.4/site-packages (1.15.2)
Requirement already satisfied: opencv-python in /home/vagrant/.local/lib/python3.4/site-packages (3.4.3.18)
vagrant@vagrant-ubuntu-trusty-64:~/workspace/pythonCapture$ python test.py
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    import numpy as np
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/core/__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name multiarray

[追記]

sudo apt-get install libblas3 liblapack3 libc6

上記のコマンドを実行しても同様のエラーが出ました。
回答して頂いた下記のコマンドも実行してみました。
実行コマンドとエラー文を下記に記載します。


$ sudo apt-get install python3-venv
パッケージリストを読み込んでいます... 完了
依存関係ツリーを作成しています                
状態情報を読み取っています... 完了
E: パッケージ python3-venv が見つかりません

$ python3 -m venv env
The virtual environment was not created successfully because ensurepip is not
available.  On Debian/Ubuntu systems, you need to install the python3-venv
package using the following command.

    apt-get install python3-venv

You may need to use sudo with that command.  After installing the python3-venv
package, recreate your virtual environment.

vagrant@vagrant-ubuntu-trusty-64:~/workspace/pythonCapture$ souece env/bin/activate
souece: command not found

$ source env/bin/activate
-bash: env/bin/activate: No such file or directory

$ pip install numpy opencv-python
Requirement already satisfied: numpy in /home/vagrant/.local/lib/python3.4/site-packages (1.15.2)
Requirement already satisfied: opencv-python in /home/vagrant/.local/lib/python3.4/site-packages (3.4.3.18)
vagrant@vagrant-ubuntu-trusty-64:~/workspace/pythonCapture$ python test.py
Traceback (most recent call last):
  File "test.py", line 3, in <module>
    import numpy as np
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/__init__.py", line 142, in <module>
    from . import add_newdocs
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/add_newdocs.py", line 13, in <module>
    from numpy.lib import add_newdoc
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/__init__.py", line 8, in <module>
    from .type_check import *
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/lib/type_check.py", line 11, in <module>
    import numpy.core.numeric as _nx
  File "/home/vagrant/.local/lib/python3.4/site-packages/numpy/core/__init__.py", line 26, in <module>
    raise ImportError(msg)
ImportError: 
Importing the multiarray numpy extension module failed.  Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control).  Otherwise reinstall numpy.

Original error was: cannot import name multiarray
ツイート済み twitter.com/jaStackOverflow/status/1044466606095634434
本文に 95 文字追加
ソース リンク
pekochun
  • 417
  • 1
  • 5
  • 20

cap.pyから

import numpy as np
import cv2

の部分の記述を消して実行すると、問題なくtestとprintされます。

numpyを再インストールしてくださいとメッセージが出ていたので、$ pip uninstall numpy$ pip uninstallinstall numpyをした後、$ python cap.pyを再度実行してみましたが同様のエラーが出ました。

numpyとopencv、共にsys.path.appendで指定した'/home/vagrant/.local/lib/python3.4/site-packages'のフォルダ内にあるようです。

numpyとopencv、共にsys.path.appendで指定した'/home/vagrant/.local/lib/python3.4/site-packages'のフォルダ内にあるようです。


numpyを再インストールしてくださいとメッセージが出ていたので、$ pip uninstall numpy$ pip uninstall numpyをした後、$ python cap.pyを再度実行してみましたが同様のエラーが出ました。

numpyとopencv、共にsys.path.appendで指定した'/home/vagrant/.local/lib/python3.4/site-packages'のフォルダ内にあるようです。

cap.pyから

import numpy as np
import cv2

の部分の記述を消して実行すると、問題なくtestとprintされます。

numpyを再インストールしてくださいとメッセージが出ていたので、$ pip uninstall numpy$ pip install numpyをした後、$ python cap.pyを再度実行してみましたが同様のエラーが出ました。

numpyとopencv、共にsys.path.appendで指定した'/home/vagrant/.local/lib/python3.4/site-packages'のフォルダ内にあるようです。


ソース リンク
pekochun
  • 417
  • 1
  • 5
  • 20
読み込んでいます