(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents$ python3Python 3.8.16 (default, Oct 29 2024, 09:03:22)[GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license"for more information.>>> import aidge_core>>> import aidge_backend_cpuTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/d/farges/Documents/aidge/env_aidge/lib/python3.8/site-packages/aidge_backend_cpu/__init__.py", line 2, in <module> from aidge_backend_cpu.aidge_backend_cpu import *# import so generated by PyBindImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory
It looks like you have two versions of Aidge, one with python 3.8 and 3.10.
I think you should try to remove the file /mnt/d/farges/Documents/aidge/env_aidge/lib/python3.8/site-packages/aidge_backend_cpu/aidge_backend_cpu.cpython-310-x86_64-linux-gnu.so which I suspect generate the error.
farges@WDTIS181H:/mnt/d/farges/Documents/aidge/env_aidge/lib/python3.8/site-packages/aidge_backend_cpu$ ls__init__.py _version.py aidge_backend_cpu.cpython-38-x86_64-linux-gnu.so__pycache__ aidge_backend_cpu.cpython-310-x86_64-linux-gnu.so version.txtfarges@WDTIS181H:/mnt/d/farges/Documents/aidge/env_aidge/lib/python3.8/site-packages/aidge_backend_cpu$ rm aidge_backend_cpu.cpython-310-x86_64-linux-gnu.sofarges@WDTIS181H:/mnt/d/farges/Documents/aidge/env_aidge/lib/python3.8/site-packages/aidge_backend_cpu$ cd ../../..farges@WDTIS181H:/mnt/d/farges/Documents/aidge/env_aidge/lib$ cd ../..farges@WDTIS181H:/mnt/d/farges/Documents/aidge$ source env_aidge/bin/activate(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents/aidge$ python3Python 3.8.16 (default, Oct 29 2024, 09:03:22)[GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license"for more information.>>> import aidge_core>>> import aidge_backend_cpuTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/d/farges/Documents/aidge/env_aidge/lib/python3.8/site-packages/aidge_backend_cpu/__init__.py", line 2, in <module> from aidge_backend_cpu.aidge_backend_cpu import *# import so generated by PyBindImportError: libpython3.8.so.1.0: cannot open shared object file: No such file or directory>>>
And the RECORD of the dist-info indicates this file:
(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents/aidge/env_aidge/lib/python3.8/site-packages/aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info$ more RECORDaidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/LICENSE,sha256=C-zxZWe-t3-iUrdmRjHdF3yPmhiJ5ImVtFN5xxMOUwM,14198aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/METADATA,sha256=H0hxA2gY7z3osZ1D6Fa0xwTbijGW4QmlQTDltINt1xY,19392aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/RECORD,,aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/REQUESTED,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/WHEEL,sha256=QjksN8yqvEZiPRpkysvFl_zIoTPrHYtCPi208j7yd3I,102aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/direct_url.json,sha256=tBESLrF8Li2VT7skYfaSeNlpDn4JfYx0T_udm2RZ6Xw,93aidge_backend_cpu-0.3.2.dev17+g2a745b7.dist-info/top_level.txt,sha256=o6c5mPJ_13HQADHgebfqo8J99lMxpyhlmO5A91B9Lxo,18aidge_backend_cpu/__init__.py,sha256=qz9W5q4jScnRNIeazIhtk_5o3WcCTA50riKX5pJcmXU,124aidge_backend_cpu/__pycache__/__init__.cpython-38.pyc,,aidge_backend_cpu/__pycache__/_version.cpython-38.pyc,,aidge_backend_cpu/_version.py,sha256=iHeP0RBW-cpONsdL0gNdLOIrzv--yVKnlTFXlYH5Lx4,196aidge_backend_cpu/aidge_backend_cpu.cpython-310-x86_64-linux-gnu.so,sha256=WEh3W9isioJA9vYsA8csVntlAKp95-dojHV2F1bCdk4,4974920aidge_backend_cpu/aidge_backend_cpu.cpython-38-x86_64-linux-gnu.so,sha256=SxNaHVLYGZI58u9YutA_XLQufq2Zg9y99ESJoLxgB28,83826864aidge_backend_cpu/version.txt,sha256=OrlMBNJJhvOvKIuhzaLAu928Wonf8JcYKAX1RXjh6nU,6
I found one way to bypass the problem: I added a line "from aidge_backend_cpu import *" before "import aidge_backend_cpu". If this is the new way to import the module, the issue can be closed. Otherwise I guess that adding this line in the init().py may solve the issue.
(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents/aidge/aidge/aidge/aidge_core/aidge_core$ python3Python 3.8.16 (default, Oct 29 2024, 09:03:22)[GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license"for more information.>>> import aidge_core>>> from aidge_backend_cpu import *>>> import aidge_backend_cpu>>> ab = aidge_core.Tensor.get_available_backends()>>> print(ab){'cpu', 'export_serialize'}
I understood the problem. The mistake is mine: import should not be done from inside the package folder. See:
(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents/aidge/aidge/aidge/aidge_backend_cpu$ Python3Python 3.8.16 (default, Oct 29 2024, 09:03:22)[GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import aidge_core>>> import aidge_backend_cpuTraceback (most recent call last): File "<stdin>", line 1, in <module> File "/mnt/d/farges/Documents/aidge/aidge/aidge/aidge_backend_cpu/aidge_backend_cpu/__init__.py", line 2, in <module> from aidge_backend_cpu.aidge_backend_cpu import * # import so generated by PyBindModuleNotFoundError: No module named 'aidge_backend_cpu.aidge_backend_cpu'>>> quit()(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents/aidge/aidge/aidge/aidge_backend_cpu$ cd ..(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents/aidge/aidge/aidge$ Python3Python 3.8.16 (default, Oct 29 2024, 09:03:22)[GCC 11.4.0] on linuxType "help", "copyright", "credits" or "license" for more information.>>> import aidge_core>>> import aidge_backend_cpu>>> quit()(env_aidge) farges@WDTIS181H:/mnt/d/farges/Documents/aidge/aidge/aidge$