luphord / nelson_siegel_svensson

Implementation of the Nelson-Siegel-Svensson interest rate curve model.
MIT License
111 stars 41 forks source link

can't import nelson_siegel_svensson #2

Closed boazdori closed 5 years ago

boazdori commented 5 years ago

Description

I am having a problem importing nelson_siegel_svensson. I am getting the following error: ImportError: cannot import name 'NelsonSiegelSvenssonCurve' from 'nelson_siegel_svensson' (C:\Users\user\Documents\Visual Studio 2017\Projects\corp_bond_yield_compare\nelson_siegel_svensson.py)

What I Did

I installed the module using pip as suggested tried to run the demo code you gave and the result was as the above

boazdori commented 5 years ago

for some reason, it worked in vs code python but not in spyder ide

boazdori commented 5 years ago

funny enough in pycharm i am getting the same error as spyder ide

boazdori commented 5 years ago

problem sorted called the file nelson_siegel_svensson.py when I changed the name it worked fine -- circular ref

luphord commented 5 years ago

Interesting! I can reproduce your issue. Neither does Python give any warning nor does the linter hint anything. Apparently one should be really careful naming modules like libraries used.

Anyway, as it is not related to nelson_siegel_svensson I am going to close the issue.