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

Import error #1

Open
sergiomaciel opened this issue Jul 17, 2022 · 7 comments
Open

Import error #1

sergiomaciel opened this issue Jul 17, 2022 · 7 comments
Labels
installation Installation issue

Comments

@sergiomaciel
Copy link

Hello, I found this error when importing ikomia

  • Windows 11
  • Python 3.8.6

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
Copy link
Contributor

LudoBar commented Jul 18, 2022

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.

@LudoBar LudoBar added the installation Installation issue label Nov 25, 2022
@apollo000104
Copy link

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
Copy link
Contributor

LudoBar commented Oct 23, 2023

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
Copy link

apollo000104 commented Oct 23, 2023 via email

@tonnys
Copy link

tonnys commented Jan 17, 2024

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.

�[1;31m---------------------------------------------------------------------------�[0m
�[1;31mRuntimeError�[0m Traceback (most recent call last)
File �[1;32mD:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\registry.py:161�[0m, in �[0;36mIkomiaRegistry.create_algorithm�[1;34m(self, name, parameters, public_hub, private_hub)�[0m
�[0;32m 160�[0m algo_dir, language �[38;5;241m=�[39m �[38;5;28mself�[39m�[38;5;241m.�[39m_get_algorithm_directory(name)
�[1;32m--> 161�[0m �[38;5;28;43mself�[39;49m�[38;5;241;43m.�[39;49m�[43m_load_algorithm�[49m�[43m(�[49m�[43mname�[49m�[43m,�[49m�[43m �[49m�[43malgo_dir�[49m�[43m,�[49m�[43m �[49m�[43mlanguage�[49m�[43m)�[49m
�[0;32m 162�[0m algo �[38;5;241m=�[39m �[38;5;28mself�[39m�[38;5;241m.�[39mcreate_instance(name, parameters)

File �[1;32mD:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\registry.py:321�[0m, in �[0;36mIkomiaRegistry._load_algorithm�[1;34m(self, name, directory, language)�[0m
�[0;32m 320�[0m �[38;5;28;01mif�[39;00m language �[38;5;241m==�[39m utils�[38;5;241m.�[39mApiLanguage�[38;5;241m.�[39mPYTHON:
�[1;32m--> 321�[0m �[38;5;28;43mself�[39;49m�[38;5;241;43m.�[39;49m�[43mload_python_algorithm�[49m�[43m(�[49m�[43mdirectory�[49m�[43m)�[49m
�[0;32m 322�[0m �[38;5;28;01melif�[39;00m language �[38;5;241m==�[39m utils�[38;5;241m.�[39mApiLanguage�[38;5;241m.�[39mCPP:

�[1;31mRuntimeError�[0m: 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:

�[1;31mRuntimeError�[0m Traceback (most recent call last)
Cell �[1;32mIn[2], line 8�[0m
�[0;32m 5�[0m wf �[38;5;241m=�[39m Workflow()
�[0;32m 7�[0m �[38;5;66;03m# Add the YOLO v7 Object Detector�[39;00m
�[1;32m----> 8�[0m yolov7 �[38;5;241m=�[39m �[43mwf�[49m�[38;5;241;43m.�[39;49m�[43madd_task�[49m�[43m(�[49m�[43mname�[49m�[38;5;241;43m=�[39;49m�[38;5;124;43m"�[39;49m�[38;5;124;43minfer_yolo_v7�[39;49m�[38;5;124;43m"�[39;49m�[43m,�[49m�[43m �[49m�[43mauto_connect�[49m�[38;5;241;43m=�[39;49m�[38;5;28;43;01mTrue�[39;49;00m�[43m)�[49m
�[0;32m 10�[0m �[38;5;66;03m# Run on your image �[39;00m
�[0;32m 11�[0m �[38;5;66;03m# wf.run_on(path="path/to/your/image.png")�[39;00m
�[0;32m 12�[0m wf�[38;5;241m.�[39mrun_on(url�[38;5;241m=�[39m�[38;5;124m"�[39m�[38;5;124mhttps://raw.githubusercontent.com/Ikomia-dev/notebooks/main/examples/img/img_work.jpg�[39m�[38;5;124m"�[39m)

File �[1;32mD:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\workflow.py:277�[0m, in �[0;36mWorkflow.add_task�[1;34m(self, task, name, params, auto_connect, public_hub, private_hub)�[0m
�[0;32m 274�[0m �[38;5;28;01mraise�[39;00m �[38;5;167;01mRuntimeError�[39;00m(�[38;5;124m"�[39m�[38;5;124mUnable to add task to workflow: parameters must include either a valid name or task instance.�[39m�[38;5;124m"�[39m)
�[0;32m 276�[0m �[38;5;28;01mif�[39;00m task �[38;5;129;01mis�[39;00m �[38;5;28;01mNone�[39;00m:
�[1;32m--> 277�[0m task �[38;5;241m=�[39m �[38;5;28;43mself�[39;49m�[38;5;241;43m.�[39;49m�[43mregistry�[49m�[38;5;241;43m.�[39;49m�[43mcreate_algorithm�[49m�[43m(�[49m�[43mname�[49m�[38;5;241;43m=�[39;49m�[43mname�[49m�[43m,�[49m
�[0;32m 278�[0m �[43m �[49m�[43mparameters�[49m�[38;5;241;43m=�[39;49m�[38;5;28;43;01mNone�[39;49;00m�[43m,�[49m
�[0;32m 279�[0m �[43m �[49m�[43mpublic_hub�[49m�[38;5;241;43m=�[39;49m�[43mpublic_hub�[49m�[43m,�[49m
�[0;32m 280�[0m �[43m �[49m�[43mprivate_hub�[49m�[38;5;241;43m=�[39;49m�[43mprivate_hub�[49m�[43m)�[49m
�[0;32m 281�[0m �[38;5;28;01mif�[39;00m task �[38;5;129;01mis�[39;00m �[38;5;28;01mNone�[39;00m:
�[0;32m 282�[0m �[38;5;28;01mraise�[39;00m �[38;5;167;01mRuntimeError�[39;00m(�[38;5;124mf�[39m�[38;5;124m"�[39m�[38;5;124mAlgorithm �[39m�[38;5;132;01m{�[39;00mname�[38;5;132;01m}�[39;00m�[38;5;124m can�[39m�[38;5;124m'�[39m�[38;5;124mt be created.�[39m�[38;5;124m"�[39m)

File �[1;32mD:\Users\tonny\PycharmProjects\pythonProject\venv\lib\site-packages\ikomia\dataprocess\registry.py:174�[0m, in �[0;36mIkomiaRegistry.create_algorithm�[1;34m(self, name, parameters, public_hub, private_hub)�[0m
�[0;32m 170�[0m algo �[38;5;241m=�[39m �[38;5;28mself�[39m�[38;5;241m.�[39mcreate_instance(name, parameters)
�[0;32m 171�[0m �[38;5;28;01melse�[39;00m:
�[0;32m 172�[0m �[38;5;66;03m# If algorithm is installed locally but not functional (algo_dir is not empty), it may be a plugin�[39;00m
�[0;32m 173�[0m �[38;5;66;03m# in developpement and we should not overwrite it with the Ikomia Hub version�[39;00m
�[1;32m--> 174�[0m �[38;5;28;01mraise�[39;00m �[38;5;167;01mRuntimeError�[39;00m(�[38;5;124mf�[39m�[38;5;124m"�[39m�[38;5;124mAlgorithm �[39m�[38;5;132;01m{�[39;00mname�[38;5;132;01m}�[39;00m�[38;5;124m is installed locally but not functional. �[39m�[38;5;124m"�[39m
�[0;32m 175�[0m �[38;5;124mf�[39m�[38;5;124m"�[39m�[38;5;124mCheck your code or your Python environment please.�[39m�[38;5;124m"�[39m)
�[0;32m 177�[0m �[38;5;28;01mreturn�[39;00m algo

�[1;31mRuntimeError�[0m: 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
Copy link
Contributor

LudoBar commented Jan 19, 2024

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
Copy link

LyCrash commented Feb 23, 2024

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.

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

No branches or pull requests

5 participants