我正在用choregraphe编写一个块的代码,我需要一些numpy和pillow库中的函数。我使用pip在行为的同一文件夹中安装了pillow和numpy。在我尝试过的块代码内的Choregraphe中:
from sys import path
path.append(ALFrameManager.getBehaviorPath(self.behaviorId))
from PIL import Image
from scipy import array, inf
from scipy.sparse.csgraph import shortest_path, csgraph_from_dense我得到了这个错误:
ImportError: cannot import name _imaging如果我注释这行
from PIL import Image我得到了这个错误:
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我尝试重新安装这两个库,但没有任何变化。我哪里错了?在同一个文件夹中也有一个我编写的类,但在导入时没有问题,我不明白为什么
发布于 2018-03-19 00:55:06
你是在机器人上运行这个吗(哪一个?哪个操作系统版本?),还是本地安装在您的计算机上?
如果它位于机器人上,则包中包含的库的.so文件(和其他二进制文件)很可能没有针对正确的体系结构进行编译。
一些可能性:
pip安装--用户--升级pip
然后
/home/nao/.local/bin/pip install --user scipy (或您需要的任何其他包)
这样你就不需要把这些文件打包到你的choregraphe包中(但是你必须在你想要安装的所有机器人上执行相同的过程,这可能适合你的用例,也可能不适合你的用例。
https://stackoverflow.com/questions/49339754
复制相似问题