Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

第三方库不能使用的问题 #1562

Open
sun1284065663 opened this issue Jun 7, 2022 · 5 comments
Open

第三方库不能使用的问题 #1562

sun1284065663 opened this issue Jun 7, 2022 · 5 comments

Comments

@sun1284065663
Copy link

python环境是 3.7.3
我将安装好的第三方库文件在Python37\Lib\site-packages下 复制到 kbengine-2.5.11\kbe\res\scripts\common\Lib\site-packages文件夹下

然后在脚本中导入该库启动keb时报错
在我本地这个库是能正常使用的,所以排除是版本不对的原因
kbe使用第三方库是这么操作的吗 希望好心人帮帮忙
1654580367441
1654580840628

@Wandar
Copy link

Wandar commented Jun 13, 2022

应该只支持纯python的库

@ve-i-uj
Copy link

ve-i-uj commented Sep 2, 2022

应该只支持纯python的库

You can use any python library in assets, but you must build or install the library with an external python (not kbe python). The external python must have the same version like the kbe python (Python 3.7.3 for KBEngine v2.5.12). Then copy the installed library to the kbengine python import directory (site-packages).

@ve-i-uj
Copy link

ve-i-uj commented Sep 2, 2022

第三方库不能使用的问题 #1562

python环境是 3.7.3 我将安装好的第三方库文件在Python37\Lib\site-packages下 复制到 kbengine-2.5.11\kbe\res\scripts\common\Lib\site-packages文件夹下

然后在脚本中导入该库启动keb时报错 在我本地这个库是能正常使用的,所以排除是版本不对的原因 kbe使用第三方库是这么操作的吗 希望好心人帮帮忙 1654580367441 1654580840628

I added numpy and lxml to my kbengine project and they worked fine. But my project was hosted on Linux, so the Python libraries were also built on it. I also added the libraries path to sys.path in the kbengine.py on startup. Maybe that matters too.

leto@leto:~/pioner-assets$ ls -la scripts/site-packages/
итого 88
drwxr-xr-x  6 leto leto  4096 авг 20  2019 .
drwxr-xr-x 15 leto leto  4096 авг  9 08:58 ..
-rw-r--r--  1 leto leto  4277 июл 30  2019 cached_property.py
drwxr-xr-x  2 leto leto  4096 июл 30  2019 frozendict
drwxr-xr-x  5 leto leto  4096 июл 30  2019 lxml
drwxr-xr-x 18 leto leto  4096 авг  9 09:11 numpy
-rw-r--r--  1 leto leto 54063 июл 30  2019 pydot.py
drwxr-xr-x  4 leto leto  4096 июл 30  2019 py_trees

@sun1284065663
Copy link
Author

可能是因为我使用了fcl库 这个库不是纯Python的 fcl是C++写的 Python封装了一层

@Wandar
Copy link

Wandar commented Sep 5, 2022

应该只支持纯python的库

You can use any python library in assets, but you must build or install the library with an external python (not kbe python). The external python must have the same version like the kbe python (Python 3.7.3 for KBEngine v2.5.12). Then copy the installed library to the kbengine python import directory (site-packages).

Thank you for sharing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants