AI4Finance-Foundation / FinRL

FinRL: Financial Reinforcement Learning. 🔥
https://ai4finance.org
MIT License
9.36k stars 2.27k forks source link

could not import finrl in google colab #1249

Open aleeOstovar opened 3 days ago

aleeOstovar commented 3 days ago

this problem happened recently and i'm sure that last week was working fine i'm developing my own strategies using finrl environment but tonight when i start to install and import dependencies i got "No module named 'finrl'". before i successfully installed these packages : !pip install stockstats

install finrl library

!pip install wrds !pip install swig !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 import them as template: import datetime

import gymnasium as gym import numpy as np import pandas as pd import yfinance as yf from stockstats import StockDataFrame as Sdf

import torch import torch.nn as nn from sklearn.preprocessing import MinMaxScaler

import itertools

from stable_baselines3 import PPO from stable_baselines3.common.vec_env import DummyVecEnv import matplotlib import matplotlib.pyplot as plt

from finrl.agents.stablebaselines3.models import DRLAgent,DRLEnsembleAgent

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

from pprint import pprint

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

import itertools

error:

ModuleNotFoundError Traceback (most recent call last) in <cell line: 21>() 19 20 #from finrl.agents.stablebaselines3.models import DRLAgent,DRLEnsembleAgent ---> 21 from finrl.plot import backtest_stats, backtest_plot, get_daily_return, get_baseline 22 23 from pprint import pprint

ModuleNotFoundError: No module named 'finrl'

BruceYanghy commented 2 days ago

Thank you for bringing up the issue. Currently, the FinRL library is extremely poorly maintained. Rest assured, I will reorganize a team to ensure its proper maintenance.

Best regards,

Bruce Yang

stellawang196 commented 9 hours ago

Please try:

!pip install swig
!pip install box2d
!pip install git+https://github.com/AI4Finance-Foundation/FinRL.git