在我的 MacBook 上的 Jupyter 笔记本上运行它会出现以下错误:
import mplfinance
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
<ipython-input-3-5bae819ae7bb> in <module>
----> 1 import mplfinance as mpl
ModuleNotFoundError: No module named 'mplfinance'
但我也安装了 mplfinance 并对其进行了升级。我在终端上完成了以下操作:
~ pip3 install mplfinance
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: mplfinance in /usr/local/lib/python3.9/site-packages (0.12.7a17)
Requirement already satisfied: pandas in /usr/local/lib/python3.9/site-packages (from mplfinance) (1.3.1)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.9/site-packages (from mplfinance) (3.4.3)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (1.3.1)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (2.8.2)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (8.3.1)
Requirement already satisfied: numpy>=1.16 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (1.21.1)
Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (2.4.7)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (0.10.0)
Requirement already satisfied: six in /usr/local/lib/python3.9/site-packages (from cycler>=0.10->matplotlib->mplfinance) (1.16.0)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.9/site-packages (from pandas->mplfinance) (2021.1)
➜ ~ pip install mplfinance
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: mplfinance in /usr/local/lib/python3.9/site-packages (0.12.7a17)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.9/site-packages (from mplfinance) (3.4.3)
Requirement already satisfied: pandas in /usr/local/lib/python3.9/site-packages (from mplfinance) (1.3.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (1.3.1)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (8.3.1)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (2.8.2)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (0.10.0)
Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (2.4.7)
Requirement already satisfied: numpy>=1.16 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (1.21.1)
Requirement already satisfied: six in /usr/local/lib/python3.9/site-packages (from cycler>=0.10->matplotlib->mplfinance) (1.16.0)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.9/site-packages (from pandas->mplfinance) (2021.1)
➜ ~ pip install --upgrade mplfinance
DEPRECATION: Configuring installation scheme with distutils config files is deprecated and will no longer work in the near future. If you are using a Homebrew or Linuxbrew Python, please see discussion at https://github.com/Homebrew/homebrew-core/issues/76621
Requirement already satisfied: mplfinance in /usr/local/lib/python3.9/site-packages (0.12.7a17)
Requirement already satisfied: matplotlib in /usr/local/lib/python3.9/site-packages (from mplfinance) (3.4.3)
Requirement already satisfied: pandas in /usr/local/lib/python3.9/site-packages (from mplfinance) (1.3.1)
Requirement already satisfied: numpy>=1.16 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (1.21.1)
Requirement already satisfied: python-dateutil>=2.7 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (2.8.2)
Requirement already satisfied: pillow>=6.2.0 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (8.3.1)
Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (1.3.1)
Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (0.10.0)
Requirement already satisfied: pyparsing>=2.2.1 in /usr/local/lib/python3.9/site-packages (from matplotlib->mplfinance) (2.4.7)
Requirement already satisfied: six in /usr/local/lib/python3.9/site-packages (from cycler>=0.10->matplotlib->mplfinance) (1.16.0)
Requirement already satisfied: pytz>=2017.3 in /usr/local/lib/python3.9/site-packages (from pandas->mplfinance) (2021.1)
➜ ~
重新启动内核,甚至重新启动我的笔记本电脑,但我一直看到这个错误。尽管安装了 ModuleNotFoundError 错误,这里有人知道为什么我会看到它吗?
非常感谢