简体   繁体   English

import toolz 在 dask 导入期间导致 AttributeError

[英]import toolz results in an AttributeError during dask import

The python command蟒蛇命令

import dask

Results in a long error chain to one of its dependencies.导致其依赖项之一的长错误链。

I can replicate deeper parts of this error chain by importing tlz.我可以通过导入 tlz 来复制这个错误链的更深层部分。

import tlz
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\dask\__init__.py", line 1, in <module>
    from dask import config, datasets
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\dask\datasets.py", line 3, in <module>
    from dask.utils import import_required
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\dask\utils.py", line 25, in <module>
    import tlz as toolz
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\tlz\__init__.py", line 9, in <module>
    from . import _build_tlz
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\tlz\_build_tlz.py", line 3, in <module>
    import toolz
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\toolz\__init__.py", line 20, in <module>
    from . import curried, sandbox
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\toolz\curried\__init__.py", line 27, in <module>
    from . import operator
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\toolz\curried\operator.py", line 14, in <module>
    {name: curry(f) if should_curry(f) else f
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\toolz\curried\operator.py", line 14, in <dictcomp>
    {name: curry(f) if should_curry(f) else f
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\toolz\curried\operator.py", line 9, in should_curry
    num = num_required_args(f)
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\toolz\functoolz.py", line 866, in num_required_args
    sigspec, rv = _check_sigspec(sigspec, func, _sigs._num_required_args,
File "C:\Users\username\AppData\Local\Programs\Python\Python310\lib\site-packages\toolz\functoolz.py", line 827, in _check_sigspec
    sigspec = inspect.signature(func)
AttributeError: module 'inspect' has no attribute 'signature'

Any ideas on how to fix this issue?有关如何解决此问题的任何想法?

Fixed issue by removing an extra set of python installations on my computer.通过在我的计算机上删除一组额外的 python 安装来解决问题。

Details here: Create venv without admin access python此处的详细信息:在没有管理员访问权限的情况下创建 venv python

The following command works as expected以下命令按预期工作

import dask
help(dask)

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

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