Ikomia-dev / IkomiaApi

Deploy Computer Vision solutions with a few lines of code.
https://ikomia-dev.github.io/python-api-documentation/
Apache License 2.0
226 stars 13 forks source link

Import error #1

Open sergiomaciel opened 2 years ago

sergiomaciel commented 2 years ago

Hello, I found this error when importing ikomia

import ikomia File "xxx\Python\lib\site-packages\ikomia__init.py", line 21, in from ikomia.dataprocess import registry File "xxx\Python\lib\site-packages\ikomia\dataprocess\init__.py", line 22, in from ikomia.lib.pydataprocess import * ImportError: DLL load failed while importing pydataprocess: The specified process was not found.

regards!

LudoBar commented 2 years ago

Hi @sergiomaciel and thank you for your interest in Ikomia. As of today, we only made some tests on Windows 10 platform. It seems to be a dependency issue with a missing shared library. Can you tell us the exact version of the wheel you try to install (what pip command did you use) ? Thank you.

apollo000104 commented 1 year ago

Hi, @sergiomaciel , Hi @LudoBar . I also meet some error when I try to install ikomia on my PC.

I use "pip install ikomia" on python 3.11, Win 10.

ERROR: Could not find a version that satisfies the requirement ikomia (from versions: none) ERROR: No matching distribution found for ikomia

why??? help me plz 😥😥😥

LudoBar commented 1 year ago

Hi @apollo000104. The short story is there is no Python 3.11 wheel of Ikomia for the moment. So you should create a Python environment with compatible version (from 3.7 to 3.10).

The long story is that before releasing new Python version, we make some tests to detect and fix compatibility issues for algorithms from Ikomia HUB. One of the main dependency is pytorch and the move to Python 3.11 leads to the major update to pytorch 2.0. The process is in progress and we hope to publish Python 3.11 wheel soon.

So keep in touch, and try to use Python 3.10 wheel in the mean time.

apollo000104 commented 1 year ago

Thanks for the tip!

On Mon, Oct 23, 2023 at 4:20 AM Ludovic Barusseau @.***> wrote:

Hi @apollo000104 https://github.com/apollo000104. The short story is there is no Python 3.11 wheel of Ikomia for the moment. So you should create a Python environment with compatible version (from 3.7 to 3.10).

The long story is that before releasing new Python version, we make some tests to detect and fix compatibility issues for algorithms from Ikomia HUB. One of the main dependency is pytorch and the move to Python 3.11 leads to the major update to pytorch 2.0. The process is in progress and we hope to publish Python 3.11 wheel soon.

So keep in touch, and try to use Python 3.10 wheel in the mean time.

— Reply to this email directly, view it on GitHub https://github.com/Ikomia-dev/IkomiaApi/issues/1#issuecomment-1774575076, or unsubscribe https://github.com/notifications/unsubscribe-auth/A73T322LNQU2AAQCF5PG7ZDYAYLFXAVCNFSM532G6V52U5DIOJSWCZC7NNSXTN2JONZXKZKDN5WW2ZLOOQ5TCNZXGQ2TONJQG43A . You are receiving this because you were mentioned.Message ID: @.***>

tonnys commented 9 months ago

i run win10 pycharm2023. in a venv with python 3.10. get the followin error

Loading failed: Algorithm infer_yolo_v7 could not be loaded:<class 'ModuleNotFoundError'>: No module named 'torch': File "C:\Users\tonny\Ikomia/Plugins/Python\infer_yolo_v7\infer_yolo_v7_process.py", line 23, in import torch (Code 9)

Ikomia auto-completion updated for installed plugins. Ikomia auto-completion updated for Ikomia HUB algorithms.

--------------------------------------------------------------------------- RuntimeError Traceback (most recent call last) File D:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\registry.py:161, in IkomiaRegistry.create_algorithm(self, name, parameters, public_hub, private_hub)  160 algo_dir, language = self._get_algorithm_directory(name) --> 161 self._load_algorithm(name, algo_dir, language)  162 algo = self.create_instance(name, parameters)

File D:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\registry.py:321, in IkomiaRegistry._load_algorithm(self, name, directory, language)  320 if language == utils.ApiLanguage.PYTHON: --> 321 self.load_python_algorithm(directory)  322 elif language == utils.ApiLanguage.CPP:

RuntimeError: Algorithm infer_yolo_v7 could not be loaded:<class 'ModuleNotFoundError'>: No module named 'torch': File "C:\Users\tonny\Ikomia/Plugins/Python\infer_yolo_v7\infer_yolo_v7_process.py", line 23, in import torch (Code 9)

During handling of the above exception, another exception occurred:

RuntimeError Traceback (most recent call last) Cell In[2], line 8  5 wf = Workflow()
 7 # Add the YOLO v7 Object Detector ----> 8 yolov7 = wf.add_task(name="infer_yolo_v7", auto_connect=True)  10 # Run on your image   11 # wf.run_on(path="path/to/your/image.png")  12 wf.run_on(url="https://raw.githubusercontent.com/Ikomia-dev/notebooks/main/examples/img/img_work.jpg")

File D:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\workflow.py:277, in Workflow.add_task(self, task, name, params, auto_connect, public_hub, private_hub)  274 raise RuntimeError("Unable to add task to workflow: parameters must include either a valid name or task instance.")  276 if task is None: --> 277 task = self.registry.create_algorithm(name=name,  278  parameters=None,  279  public_hub=public_hub,  280  private_hub=private_hub)  281 if task is None:  282 raise RuntimeError(f"Algorithm {name} can't be created.")

File D:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\registry.py:174, in IkomiaRegistry.create_algorithm(self, name, parameters, public_hub, private_hub)  170 algo = self.create_instance(name, parameters)  171 else:  172 # If algorithm is installed locally but not functional (algo_dir is not empty), it may be a plugin  173 # in developpement and we should not overwrite it with the Ikomia Hub version --> 174 raise RuntimeError(f"Algorithm {name} is installed locally but not functional. "  175 f"Check your code or your Python environment please.")  177 return algo

RuntimeError: Algorithm infer_yolo_v7 is installed locally but not functional. Check your code or your Python environment please.

adiitionally Installing pytorch via pip with cuda 11.8 doesnt solve the problem. should i not use cuda?. or any tricks I should try. This prevent me of using ikomia for my next project

The idea to have one simple install is great, so keep working at it

LudoBar commented 9 months ago

Hi @tonnys, The Python Ikomia API includes an automatic system to install dependencies. But you can always install them manually if needed.

One way could be to reinstall infer_yolo_v7 requirements from your venv: pip install -r C:\Users\tonny\Ikomia\Plugins\Python\infer_yolo_v7\requirements.txt

In addition, what is the result of pip list?

LyCrash commented 8 months ago

I've got the same problem as @tonnys due to infer_yolo_v7 and bypassed the error as @LudoBar mentioned, then as I am using deepsort algorithm too so I tried to solve the same problem of:

Algorithm infer_deepsort is installed locally but not functional.

by manually install all requirements file, so I run: pip install -r C:\Users\HP-PC\Ikomia\Plugins\Python\infer_deepsort\requirements1.txt

and it works fine, but with the 2nd file (requirements2.txt), I get this error:

Collecting git+https://github.com/KaiyangZhou/deep-person-reid.git@6987d99074fcc63146660b83b38218c37b4412b3 (from -r C:\Users\HP-PC\Ikomia\Plugins\Python\infer_deepsort\requirements2.txt (line 2)) Cloning https://github.com/KaiyangZhou/deep-person-reid.git (to revision 6987d99074fcc63146660b83b38218c37b4412b3) to c:\users\hp-pc\appdata\local\temp\pip-req-build-dqemcbzw Running command git clone --filter=blob:none --quiet https://github.com/KaiyangZhou/deep-person-reid.git 'C:\Users\HP-PC\AppData\Local\Temp\pip-req-build-dqemcbzw' Running command git rev-parse -q --verify 'sha^6987d99074fcc63146660b83b38218c37b4412b3' Running command git fetch -q https://github.com/KaiyangZhou/deep-person-reid.git 6987d99074fcc63146660b83b38218c37b4412b3 Running command git checkout -q 6987d99074fcc63146660b83b38218c37b4412b3 Resolved https://github.com/KaiyangZhou/deep-person-reid.git to commit 6987d99074fcc63146660b83b38218c37b4412b3 Installing build dependencies ... done Getting requirements to build wheel ... error error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> [17 lines of output] Traceback (most recent call last): File "D:\2CS_esi\S1\SCI\iot_project\Project\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 353, in main() File "D:\2CS_esi\S1\SCI\iot_project\Project\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 335, in main json_out['return_val'] = hook(**hook_input['kwargs']) File "D:\2CS_esi\S1\SCI\iot_project\Project\venv\lib\site-packages\pip_vendor\pyproject_hooks_in_process_in_process.py", line 118, in get_requires_for_build_wheel return hook(config_settings) File "C:\Users\HP-PC\AppData\Local\Temp\pip-build-env-ea5z1c88\overlay\Lib\site-packages\setuptools\build_meta.py", line 325, in get_requires_for_build_wheel return self._get_build_requires(config_settings, requirements=['wheel']) File "C:\Users\HP-PC\AppData\Local\Temp\pip-build-env-ea5z1c88\overlay\Lib\site-packages\setuptools\build_meta.py", line 295, in _get_build_requires self.run_setup() File "C:\Users\HP-PC\AppData\Local\Temp\pip-build-env-ea5z1c88\overlay\Lib\site-packages\setuptools\build_meta.py", line 487, in run_setup super().run_setup(setup_script=setup_script) File "C:\Users\HP-PC\AppData\Local\Temp\pip-build-env-ea5z1c88\overlay\Lib\site-packages\setuptools\build_meta.py", line 311, in run_setup exec(code, locals()) File "", line 1, in ModuleNotFoundError: No module named 'numpy' [end of output]

note: This error originates from a subprocess, and is likely not a problem with pip. error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully. │ exit code: 1 ╰─> See above for output.