AI4Finance-Foundation / FinRL-Meta

FinRL­-Meta: Dynamic datasets and market environments for FinRL.
https://ai4finance.org
MIT License
1.26k stars 585 forks source link

ModuleNotFoundError not found in FinRL_PortfolioAllocation_NeurIPS_2020.ipynb #211

Closed kabua closed 2 years ago

kabua commented 2 years ago

While running 2.3. Import Packages got this error

ModuleNotFoundError                       Traceback (most recent call last)
[<ipython-input-2-65f21698d972>](https://localhost:8080/#) in <module>()
      9 from finrl import config
     10 from finrl import config_tickers
---> 11 from finrl.finrl_meta.preprocessor.yahoodownloader import YahooDownloader
     12 from finrl.finrl_meta.preprocessor.preprocessors import FeatureEngineer, data_split
     13 from finrl.finrl_meta.env_portfolio_allocation.env_portfolio import StockPortfolioEnv

ModuleNotFoundError: No module named 'finrl.finrl_meta'

Actually, it appears that all of these statements are failing.

from finrl.finrl_meta.preprocessor.yahoodownloader import YahooDownloader
from finrl.finrl_meta.preprocessor.preprocessors import FeatureEngineer, data_split
from finrl.finrl_meta.env_portfolio_allocation.env_portfolio import StockPortfolioEnv
from finrl.finrl_meta.data_processor import DataProcessor
from finrl.finrl_meta.data_processors.processor_yahoofinance import YahooFinanceProcessor

I've tried running this

image

and changing the from statement to

from finrl_meta.preprocessor.yahoodownloader import YahooDownloader

and

from finrl-meta.preprocessor.yahoodownloader import YahooDownloader

still no luck. 😞

Finally tried

from finrl.meta.preprocessor.yahoodownloader import YahooDownloader

That seemed to have done the trick. 😄

zhumingpassional commented 2 years ago

pls change finrl_meta to meta. we revised the folder name.

ZiyiXia commented 2 years ago

Import lines were updated, please check it out.

zhumingpassional commented 2 years ago

if you use finrl-meta library, pls try from meta.data_processor import DataProcessor dp = DataProcessor('yahoofinance', start_date, end_date, time_interval)

kabua commented 2 years ago

Thanks, however, the open in Colab link is still broken. Once fixed, then I can verify the code changes for you.

kabua commented 2 years ago

@zhumingpassional I would, along with everyone else who is trying to use this site, would prefer to have the code fixed verse telling me how to fix it myself (i.e. as a work-a-round).

@ZiyiXia thanks for actually fixing the code, now everyone wins. 👍

To All Contributes - From my experience, new visitors to a repository expect that the getting started documentation is accurate, that all the links actually work, and that all tutorials function correctly - otherwise, they feel the repo/product is not worth anything regardless of how well it might actually work - first impressions are everything. And if the simple things don't work then how can we trust the complicated things to work? We can't, thus most of your visitors will just move on to the next thing.

YangletLiu commented 2 years ago

@kabua Thanks very much for your detailed suggestions! They are great!