highfestiva / finplot

Performant and effortless finance plotting for Python
MIT License
922 stars 187 forks source link

[BUG] 'NoneType' object has no attribute 'lower' after import statement #417

Closed vvvstudio closed 10 months ago

vvvstudio commented 1 year ago

Requirements (place an x in each of the [ ])**

Code to reproduce

import finplot as fplt
import yfinance as yf

Describe the bug

The error shown just after import statement.

Expected behavior

Expect to import sucessfully

Screenshots

Screen Shot 2566-04-14 at 19 02 11

Reproducible in:

OS: MacOS 12.6.3. Apple M1 Max finplot version: 1.9.0 pyqtgraph version:0.13.2 pyqt version:5.15.9

highfestiva commented 1 year ago

You are using an old version. Fix with pip install -U finplot.

vvvstudio commented 1 year ago

Hi @highfestiva , I have been using finplot v.1.9.0, and already did pip install -U finplot. and using libs as follows; 'numpy>=1.23.5', 'pandas>=1.5.2', 'PyQt6>=6.4.0', 'pyqtgraph>=0.13.1'

but the error still the same.

Here is the result after run command : pip show finplot.

Name: finplot Version: 1.9.0 Summary: Finance plotting Home-page: https://github.com/highfestiva/finplot Author: Jonas Byström Author-email: highfestiva@gmail.com License: UNKNOWN Location: /torch-gpu/lib/python3.8/site-packages Requires: numpy, pandas, PyQt6, pyqtgraph, python-dateutil Required-by:

highfestiva commented 1 year ago

Travelling, will check asap and get back to you.

vvvstudio commented 1 year ago

One thing I haven't mentioned, I am using Jupyter notebook, not sure finplot compatible?

highfestiva commented 1 year ago

It was not part of v1.9.0 unfortunately. Either you can patch it with this github code, or I'll try to get a fix in today before I'm off to again.

highfestiva commented 1 year ago

Try v1.9.1, hopefully that helps.

vvvstudio commented 1 year ago

Now I can import finplot, but I am figuring out how to make fplt.show() works

image
Trembles commented 1 year ago

From the README

What it is not finplot is not a web app. It does not help you create an homebrew exchange. It does not work with Jupyter Labs.

vvvstudio commented 1 year ago

Thanks

From the README

What it is not finplot is not a web app. It does not help you create an homebrew exchange. It does not work with Jupyter Labs.

highfestiva commented 1 year ago

In this case it might be the data you're using though. I'm guessing your time is a column, and not an index, and that's why df[['Open','Close','High','Low']] is causing a crash. If so, just prepend your time column before 'Open'.