简体   繁体   English

从 numba 导入 jit 会引发错误

[英]importing jit from numba raise an error

So I'm trying to import jit from the numba library but the import produces an OSError and says that a specific module couldn't be found.所以我试图从numba库中导入jit但导入产生了一个 OSError 并说找不到特定的模块。 I tried to uninstall and reinstall numba, but it didn't change anything and I have no other idea to solve the issue.我试图卸载并重新安装 numba,但它没有改变任何东西,我也没有其他想法可以解决这个问题。

Here is the full error:这是完整的错误:

Traceback (most recent call last):
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\site-packages\llvmlite\binding\ffi.py", line 42, in <module>
    lib = ctypes.CDLL(os.path.join(_lib_dir, _lib_name))
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\ctypes\__init__.py", line 350, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Le module spécifié est introuvable

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:/Users/user65/HypotheseDecoupageReseau/CalculInfluence.py", line 6, in <module>
    from numba import jit
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\site-packages\numba\__init__.py", line 11, in <module>
    from . import config, errors, runtests, types
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\site-packages\numba\config.py", line 11, in <module>
    import llvmlite.binding as ll
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\site-packages\llvmlite\binding\__init__.py", line 6, in <module>
    from .dylib import *
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\site-packages\llvmlite\binding\dylib.py", line 4, in <module>
    from . import ffi
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\site-packages\llvmlite\binding\ffi.py", line 47, in <module>
    lib = ctypes.CDLL(_lib_name)
  File "D:\Users\user65\Logiciels\WinPython-64bit-3.4.4.6Qt5\python-3.4.4.amd64\lib\ctypes\__init__.py", line 350, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] Le module spécifié est introuvable

Process finished with exit code 1

Thank you for your help :)感谢您的帮助 :)

As said in this page you are not alone.正如本页所说,您并不孤单。 This is the problem of the version 3.4.4这是3.4.4版本的问题

You have some options:你有一些选择:

  1. Try upgrading and see that the problem solves.尝试升级并查看问题是否解决。

  2. Aside from that people saying It's due to script\\python.bat and python.exe interfering.除了人们说这是由于script\\python.batpython.exe干扰。
    python.bat is currently calling ptpython when it sees it, which has not the same syntax. python.bat当前正在调用ptpython时,它没有相同的语法。
    You may try pip uninstall ptpython and see if it helps.您可以尝试pip uninstall ptpython看看它是否有帮助。

  3. You may also copy the current python.bat as winpython.bat , and keep python.bat calling only python:您也可以将当前的python.bat复制为winpython.bat ,并保持python.bat只调用 python:

@echo off
call "%~dp0env_for_icons.bat"
cd/D "%WINPYWORKDIR%"
rem backward compatibility for python.exe
"%WINPYDIR%\python.exe"  %*
  1. After following the above solutions, llvmlite error part should be solved by now.在按照上述解决方案之后,现在应该解决llvmlite错误部分。 You should have Visual Studio 2015 installed for other error parts to go away.您应该安装Visual Studio 2015以消除其他错误部分。
    Although you can instead install vc_redist.x86.exe alone from this link and dont install the whole VS2015.虽然您可以从这个链接单独安装vc_redist.x86.exe而不要安装整个 VS2015。 Follow here for more information.关注这里了解更多信息。

Check if you are using a compatible version of Python.检查您是否使用兼容版本的 Python。

In my case I had to remove Python and downgrade to a previous version就我而言,我必须删除 Python 并降级到以前的版本

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM