lilohuang/PyTurboJPEG

Unable to Identify TurboJPEG Class

asergb-churon opened this issue · 5 comments

Hi @lilohuang, I've pip-installed TurboJPEG, numpy and PyTurboJPEG, and yet when I ran the sample code provided in the readme file, python keeps returning error message saying that TurboJPEG() can't be found. I'm not sure if it's due to my lack of knowledge of python or maybe because of certain environment variables, but i do have turbojpeg64/bin/ (where turbojpeg.dll is) path stored in the path environment variable in my Windows machine. Am I missing something? I'm running Windows 11 with Python 3.11, MS VC++ 2015-2022 Redist and VS Code

I've done research and somehow couldn't find anything that helps with resolving this issue. I've also attempted to use turbojpeg-gcc64 and replaced the previous turbojpeg64\bin path environment to gcc64\bin one. Yet, issue persists.

I've also tried to implement and use my own custom class, or used a different module's class. I don't have any problem with this one. I'm thinking maybe because I'm using Python 3.11? I have yet to test this out though.

Here's the error message I get:

Traceback (most recent call last):
  File "d:\ron\proj\c.py", line 4, in <module>
    from turbojpeg import TurboJPEG, TJPF_GRAY, TJSAMP_GRAY, TJFLAG_PROGRESSIVE, \
ImportError: cannot import name 'TurboJPEG' from 'turbojpeg' (C:\Python311\Lib\site-packages\turbojpeg.cp311-win_amd64.pyd)

resolved by rebooting after installation and manually setting the PATH variable. sorry for the trouble.

additionally, code only works with python3 if python3 installed.

通过在安装后重新启动并手动设置 PATH 变量来解决。很抱歉给您带来麻烦。

Can you elaborate on how to solve it? I also encountered the same problem as you

from turbojpeg import TurboJPEG

ImportError: cannot import name 'TurboJPEG' from 'turbojpeg' (D:\Anaconda\anaconda3\envs\lnet\lib\site-packages\turbojpeg.cp310-win_amd64.pyd)