Matplotlib created a temporary config/cache directory at C:\Users\Elegent\AppData\Local\Temp\matplotlib-b53sq7gb because the default path (C:\Users\Elegent\.matplotlib) is not a writable directory; it is highly recommended to set the MPLCONFIGDIR environment variable to a writable directory, in particular to speed up the import of Matplotlib and to better support multiprocessing. Traceback (most recent call last): File "D:\pythonProject\AppleStock\ananly2.py", line 24, in <module> candlestick_ochl(ax, df[["Open", "Close", "Volume", "High", "Low"]].values, width=0.5, colorup="green", colordown="red") File "D:\pythonProject\venv\lib\site-packages\mplfinance\original_flavor.py", line 195, in candlestick_ochl return _candlestick(ax, quotes, width=width, colorup=colorup, File "D:\pythonProject\venv\lib\site-packages\mplfinance\original_flavor.py", line 286, in _candlestick if close >= open: TypeError: '>=' not supported between instances of 'int' and 'str'
时间: 2023-07-03 08:28:49 浏览: 137
这个问题看起来是一个 Python 中的 TypeError,涉及到一个 int 类型和 str 类型之间的大于等于比较运算符。这个错误发生在一个名为 "candlestick_ochl" 的函数里,该函数可能是 mplfinance 库的一部分。这个函数似乎要求传入的数据中包含 Open、Close、High、Low 等列,但是其中某些列的数据类型可能不正确导致了这个错误。请检查你传入的数据是否包含正确的列,且这些列的数据类型是否正确。你也可以尝试给这些列进行类型转换,以确保它们的数据类型与函数的要求相符。另外,这个错误提示中也提到了 Matplotlib 的一个配置问题,你可以按照建议设置 MPLCONFIGDIR 环境变量来解决这个问题。
相关问题
/environment/miniconda3/lib/python3.7/site-packages/matplotlib/mpl-data/fonts/ttf/SimHei.ttf: No such file or directory
这个错误提示表明SimHei.ttf字体文件不存在于指定的目录中。可能是因为你没有正确地下载和安装该字体文件,或者是因为你的路径设置不正确。你可以按照以下步骤检查和解决该问题:
1. 确认你已经正确地下载了SimHei.ttf字体文件,并将其放置在指定的目录下。
2. 检查你的路径设置是否正确,特别是确认你的路径中是否包含了正确的用户名和文件夹名称。
3. 确认你已经正确地修改了matplotlibrc文件,并将SimHei字体添加到了font.sans-serif列表中。
4. 检查你的缓存文件是否已经被正确地删除。
5. 确认你已经正确地重新启动了jupyter,并且已经执行了_rebuild()函数来重新加载字体。
如果你仍然遇到问题,可以尝试重新安装matplotlib或者在matplotlib的官方文档中查找更多的解决方案。
Requirement already satisfied: matplotlib in c:\users\tangtang\appdata\local\programs\python\python35-32\lib\site-packages (3.0.3)
根据您提供的引用内容,您想知道关于"matplotlib"包的信息。根据和引用,通过使用命令"pip install --target=xxx matplotlib"或"pip install --target=I:\APP测试\frida\objection matplotlib"可以在指定的路径安装matplotlib包。根据引用,如果您已经安装了matplotlib包,则会显示"Requirement already satisfied"。根据引用中的路径,我们可以看到您安装的matplotlib版本为3.0.3,并且安装在"c:\users\tangtang\appdata\local\programs\python\python35-32\lib\site-packages"目录下。
相关推荐
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![zip](https://img-home.csdnimg.cn/images/20210720083736.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)
![](https://csdnimg.cn/download_wenku/file_type_ask_c1.png)