我正在try 在同一虚拟环境中使用包scrapy和great_expectations.这两个包之间的兼容性似乎有问题,这取决于我导入它们的顺序.
示例:
- 我创建了一个虚拟环境,pip安装了每个软件包的最新版本.
有效:
import great_expectations
import scrapy
print("done")
Does not work:
import scrapy
import great_expectations
print("done")
Error:
Traceback (most recent call last):
File
"/Users/grant/vs_code_projects/grants_projects/test_environment.py", line 2, in <module>
import great_expectations
File "/Users/grant/Envs/test_env/lib/python3.8/site-packages/great_expectations/__init__.py", line 32, in <module>
register_core_expectations()
File "/Users/grant/Envs/test_env/lib/python3.8/site-packages/great_expectations/expectations/registry.py", line 187, in register_core_expectations
from great_expectations.expectations import core # noqa: F401
File "/Users/grant/Envs/test_env/lib/python3.8/site-packages/great_expectations/expectations/core/__init__.py", line 1, in <module>
from .expect_column_distinct_values_to_be_in_set import (
File "/Users/grant/Envs/test_env/lib/python3.8/site-packages/great_expectations/expectations/core/expect_column_distinct_values_to_be_in_set.py", line 12, in <module>
from great_expectations.expectations.expectation import (
File "/Users/grant/Envs/test_env/lib/python3.8/site-packages/great_expectations/expectations/expectation.py", line 2350, in <module>
class BatchExpectation(Expectation, ABC):
File "/Users/grant/Envs/test_env/lib/python3.8/site-packages/great_expectations/expectations/expectation.py", line 287, in __new__
newclass._register_renderer_functions()
File "/Users/grant/Envs/test_env/lib/python3.8/site-packages/great_expectations/expectations/expectation.py", line 369, in _register_renderer_functions
attr_obj: Callable = getattr(cls, candidate_renderer_fn_name)
AttributeError: __provides__
编辑:
- 我试过Scrapy的所有主要版本(当前版本,2.0.0,1.0.0)与Great Expectations的所有主要版本,结果是一样的.