fintechexplained / PortfolioOptimisation

33 stars 23 forks source link

local variable 'companies' referenced before assignment #1

Open prebengn opened 4 years ago

prebengn commented 4 years ago

First, thank you for sharing the script - really interesting! @fintechexplained

Second, when running main.py I get an UnboundLocalError saying:

local variable 'companies' referenced before assignment

This is referencing to line14 in main.py: price_extractor = obj_factory.get_price_extractor(companies)

Do you know why this happens, and a possible solution to this?

Best, Preben

ZAtakan commented 4 years ago

no actually stuck at some point but the original owner of the code told me to use python 3.5 or 3.6 instead of 3.71

you should also mind the version of the libraries that code uses, if you need the exact reply of the publisher, I could try to find it

Best, Zafer

On Tue, Jan 21, 2020 at 12:24 AM prebengn notifications@github.com wrote:

First, thank you for sharing the script - really interesting!

Second, when running main.py I get an UnboundLocalError saying:

local variable 'companies' referenced before assignment

This is referencing to line14 in main.py: price_extractor = obj_factory.get_price_extractor(companies)

Do you know why this happens, and a possible solution to this?

Best, Preben

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/fintechexplained/PortfolioOptimisation/issues/1?email_source=notifications&email_token=AK76L2UWQVWMKXITE3BV62LQ6YI73A5CNFSM4KJKCZN2YY3PNVWWK3TUL52HS4DFUVEXG43VMWVGG33NNVSW45C7NFSM4IHOWT4Q, or unsubscribe https://github.com/notifications/unsubscribe-auth/AK76L2XR3NYETMWFEY5PELDQ6YI73ANCNFSM4KJKCZNQ .

-- Zafer Can Atakan

Business Development ExecutiveEUROPLAST ESTETIK

www.zaferatakan.com.tr www.europlastestetik.com http://www.europlastestetik.com

thakkar11 commented 4 years ago

First, thank you for sharing the script - really interesting! @fintechexplained

Second, when running main.py I get an UnboundLocalError saying:

local variable 'companies' referenced before assignment

This is referencing to line14 in main.py: price_extractor = obj_factory.get_price_extractor(companies)

Do you know why this happens, and a possible solution to this?

Best, Preben

I moved the price_extractor statement after below statement and that works... companies = ce.get_companies_list()