我正在尝试在 jupyter 中导入 pandas。 我在 Windows 上使用 Anaconda。 我以前在同一台机器上从未遇到过问题,但突然我收到一个错误:
----> 3 import pandas as pd
4 import numpy as np
5 import matplotlib.pyplot as plt
File C:\ProgramData\Anaconda3\lib\site-packages\pandas\__init__.py:22, in <module>
19 del hard_dependencies, dependency, missing_dependencies
21 # numpy compat
---> 22 from pandas.compat import is_numpy_dev as _is_numpy_dev
24 try:
25 from pandas._libs import hashtable as _hashtable, lib as _lib, tslib as _tslib
File C:\ProgramData\Anaconda3\lib\site-packages\pandas\compat\__init__.py:20, in <module>
14 from pandas._typing import F
15 from pandas.compat.numpy import (
16 is_numpy_dev,
17 np_version_under1p19,
18 np_version_under1p20,
19 )
---> 20 from pandas.compat.pyarrow import (
21 pa_version_under1p01,
22 pa_version_under2p0,
23 pa_version_under3p0,
24 pa_version_under4p0,
25 )
27 PY39 = sys.version_info >= (3, 9)
28 PY310 = sys.version_info >= (3, 10)
File C:\ProgramData\Anaconda3\lib\site-packages\pandas\compat\pyarrow.py:8, in <module>
5 try:
6 import pyarrow as pa
----> 8 _pa_version = pa.__version__
9 _palv = Version(_pa_version)
10 pa_version_under1p01 = _palv < Version("1.0.1")`
AttributeError: module 'pyarrow' has no attribute '__version__
可能是什么问题?
我试图导入 pandas 包并期望正常导入而没有任何错误
The error message indicates that there is an issue with accessing the __version__ attribute of the PyArrow module.
Either perform `pip install --upgrade pyarrow` or Reinstall PyArrow if upgrading doesn't resolve the issue.