pyanime4k icon indicating copy to clipboard operation
pyanime4k copied to clipboard

install by pip in anaconda's virtual env (windows), raise this error when importing

Open L1Uc opened this issue 4 years ago • 20 comments

import pyanime4k Traceback (most recent call last): File "", line 1, in File "C:\Users*\Anaconda3\envs\mpegtorch\lib\site-packages\pyanime4k_init_.py", line 9, in import pyanime4k.error File "C:\Users*\Anaconda3\envs\mpegtorch\lib\site-packages\pyanime4k\error.py", line 9, in from pyanime4k.wrapper import * File "C:\Users*\Anaconda3\envs\mpegtorch\lib\site-packages\pyanime4k\wrapper_init_.py", line 9, in from pyanime4k.wrapper.acwrapper import * File "C:\Users*\Anaconda3\envs\mpegtorch\lib\site-packages\pyanime4k\wrapper\acwrapper.py", line 22, in os.path.join(curr_path, ac_lib[platform.system()])) File "C:\Users*\Anaconda3\envs\mpegtorch\lib\ctypes_init_.py", line 434, in LoadLibrary return self._dlltype(name) File "C:\Users*\Anaconda3\envs\mpegtorch\lib\ctypes_init_.py", line 356, in init self._handle = _dlopen(self._name, mode) OSError: [WinError 126] 找不到指定的模块。

python 3.7.2

L1Uc avatar Jul 10 '20 09:07 L1Uc

In old version of python(<3.8), you need add dll libs (C:\Users*\Anaconda3\envs\mpegtorch\lib\site-packages\pyanime4k\wrapper\) to PATH environment variables.

TianZerL avatar Jul 10 '20 11:07 TianZerL

I have fixed it, please upgrade pyanime4k by pip.

TianZerL avatar Jul 10 '20 11:07 TianZerL

I have upgraded pyanime4k but the problem still appears

L1Uc avatar Jul 10 '20 11:07 L1Uc

v2.2.7?

TianZerL avatar Jul 10 '20 11:07 TianZerL

image

L1Uc avatar Jul 10 '20 11:07 L1Uc

Please install vc runtime 2015-2019

TianZerL avatar Jul 10 '20 11:07 TianZerL

Are you running in a local environment or on a server?

TianZerL avatar Jul 10 '20 12:07 TianZerL

local environment and i'm trying to install vc runtime

L1Uc avatar Jul 10 '20 12:07 L1Uc

image is this right?

L1Uc avatar Jul 10 '20 12:07 L1Uc

yes, it is. x64 is needed

TianZerL avatar Jul 10 '20 12:07 TianZerL

I have installed it, but the problem still appears...

L1Uc avatar Jul 10 '20 12:07 L1Uc

This problems is beacuse of missing dlls, I don't think there are something still missing. Try to use Python3.8. And what's your video card, some old card doesn't support OpenCL will get this problem too.

TianZerL avatar Jul 10 '20 12:07 TianZerL

My video card is Nvidia 1070. Seems using python 3.8 is the only way

L1Uc avatar Jul 10 '20 12:07 L1Uc

I tested v2.2.6 in python3.7.7, got same problem and fixed it, now everything worked fine, so I'm not sure what's going on now. I use python venv to create a virtual env, how about anaconda?

TianZerL avatar Jul 10 '20 12:07 TianZerL

conda create -n your_env_name python=X.X

L1Uc avatar Jul 10 '20 13:07 L1Uc

Maybe it's because I installed vs2017 and vs2015? How did you fix it? Installing vc runtime?

L1Uc avatar Jul 10 '20 13:07 L1Uc

No, I added the dll folder to os.environ['PATH'], same as adding system environment variables. I have already included vc dlls in the dll folder, I told you to install it is because I'm afraid I forget something. Maybe you can try to run it by python venv or without a virtual env. I will test it in anaconda too.

TianZerL avatar Jul 10 '20 13:07 TianZerL

I just tested it in anaconda with python3.7.7 with pyanime4k v2.2.7, everything worked fine.

TianZerL avatar Jul 10 '20 13:07 TianZerL

Fine, maybe my system has some unknown problems.

L1Uc avatar Jul 10 '20 13:07 L1Uc

I successfully run it in Ubuntu.

L1Uc avatar Jul 10 '20 15:07 L1Uc