目前為止我所遵循的步驟基本上是:安裝pipenv,在所需目錄中創建新環境pipenv install jupyterlabpipenv install pandas但是,當打開我的第一個筆記本并運行 時import pandas,我收到一個錯誤,該錯誤似乎來自作為numpy的依賴項導入pandas。import pandas---------------------------------------------------------------------------RuntimeError? ? ? ? ? ? ? ? ? ? ? ? ? ? ? Traceback (most recent call last)<ipython-input-1-38d4b0363d82> in <module>----> 1 import pandas~/.local/share/virtualenvs/test-notebook-again-duPr9W-R/lib/python3.9/site-packages/pandas/__init__.py in <module>? ? ? 9 for dependency in hard_dependencies:? ? ?10? ? ?try:---> 11? ? ? ? ?__import__(dependency)? ? ?12? ? ?except ImportError as e:? ? ?13? ? ? ? ?missing_dependencies.append(f"{dependency}: {e}")~/.local/share/virtualenvs/test-notebook-again-duPr9W-R/lib/python3.9/site-packages/numpy/__init__.py in <module>? ? 284? ? ? ? ? ? ? ? ? ? ?"that provided NumPy.\n{}\n".format(? ? 285? ? ? ? ? ? ? ? ? ? ? ? ?error_message))--> 286? ? ? ? ? ? ? ? ?raise RuntimeError(msg)? ? 287? ? ?del _mac_os_check? ? 288?RuntimeError: Polyfit sanity test emitted a warning, most likely due to using a buggy Accelerate backend. If you compiled yourself, see site.cfg.example for information. Otherwise report this to the vendor that provided NumPy.RankWarning: Polyfit may be poorly conditioned我相信,在安裝 pandas 時,Numpy 默認安裝在環境中,但這個安裝似乎出了問題?我不知道“Accelerate”或“Polyfit”是什么,說實話,嘗試閱讀它們的內容感覺就像我無法理解。這里一定有一個比作為一個完全初學者嘗試理解這些事情更簡單的解決方案,對吧?有人知道為什么會發生這種情況嗎?
3 回答

蕪湖不蕪
TA貢獻1796條經驗 獲得超7個贊
在我的 Mac 上運行得非常順利。
https://gist.github.com/yatsu/47bdde35e8abbe7d14bbe730342aa9e0
Numpy 1.19.2 與 Python 3.9.0

慕工程0101907
TA貢獻1887條經驗 獲得超5個贊
將 Python 回滾到較早的版本,即 2020 年 7 月 20 日的 Python 3.8.5,并且我能夠使用然后最后安裝pip3 install pandas
到pip3 install notebook
Jupyterimport pandas, numpy
中。
添加回答
舉報
0/150
提交
取消