Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug when importing #1231

Open
SralSnirp opened this issue May 19, 2024 · 1 comment
Open

Bug when importing #1231

SralSnirp opened this issue May 19, 2024 · 1 comment

Comments

@SralSnirp
Copy link

First I install the packages like stated in the examples:

install required packages

!pip install swig
!pip install wrds
!pip install pyportfolioopt

install finrl library

!pip install -q condacolab
import condacolab
condacolab.install()
!apt-get update -y -qq && apt-get install -y -qq cmake libopenmpi-dev python3-dev zlib1g-dev libgl1-mesa-glx swig
!pip install git+https://github.com/AI4Finance-Foundation/FinRL.git

Then I import the packages:
import pandas as pd
import numpy as np
import matplotlib
import matplotlib.pyplot as plt

matplotlib.use('Agg')

import datetime

%matplotlib inline
from finrl.meta.preprocessor.yahoodownloader import YahooDownloader
from finrl.meta.preprocessor.preprocessors import FeatureEngineer, data_split
from finrl.meta.env_stock_trading.env_stocktrading import StockTradingEnv
from finrl.agents.stablebaselines3.models import DRLAgent
from stable_baselines3.common.logger import configure
from finrl.meta.data_processor import DataProcessor

from finrl.plot import backtest_stats, backtest_plot, get_daily_return, get_baseline
from pprint import pprint

import sys
sys.path.append("../FinRL")

import itertools

However, since today I get the following error:
Traceback (most recent call last):

File "/usr/local/lib/python3.10/dist-packages/IPython/core/interactiveshell.py", line 3553, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)

File "", line 9, in <cell line: 9>
from finrl.plot import backtest_stats, backtest_plot, get_daily_return, get_baseline

File "/usr/local/lib/python3.10/site-packages/finrl/init.py", line 5, in
from finrl.train import train

File "/usr/local/lib/python3.10/site-packages/finrl/train.py", line 10, in
from finrl.meta.data_processor import DataProcessor

File "/usr/local/lib/python3.10/site-packages/finrl/meta/data_processor.py", line 8, in
from finrl.meta.data_processors.processor_yahoofinance import (

File "/usr/local/lib/python3.10/site-packages/finrl/meta/data_processors/processor_yahoofinance.py", line 21, in
import yfinance as yf

File "/usr/local/lib/python3.10/site-packages/yfinance/init.py", line 23, in
from .ticker import Ticker

File "/usr/local/lib/python3.10/site-packages/yfinance/ticker.py", line 28, in
from .base import TickerBase

File "/usr/local/lib/python3.10/site-packages/yfinance/base.py", line 40, in
from .scrapers.history import PriceHistory

File "/usr/local/lib/python3.10/site-packages/yfinance/scrapers/history.py", line 1207
logger.debug(f'price-repair-split: Splits: {str(df['Stock Splits'][split_f].to_dict())}')
^
SyntaxError: f-string: unmatched '['

You get this error for almost all packages I import from the finrl library. Has there been an update?

@WELZAY
Copy link

WELZAY commented May 19, 2024

I have the same issue ..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants