Hi,
When I initially "import QuantLib as ql" I don't get an error and PyCharm even gives me the short cut to type QuantLib. But after a second PyCharm gives me this error: Unused import statement. This inspection detects names that should resolve but don't. Due to dynamic dispatch and duck typing, this is possible in a limited but useful number of cases. Top-level and class-level items are supported better than instance items. The download and installation guide mentions something about "disabling shared" if you only want to use Python, but I want to also have access to QuantLib in C++. Does anyone know what this means and how to fix it? Thanks! |
PyCharm is telling you that you imported the module but didn't use it anywhere. It's just a warning, and it should disappear as soon as you use anything from ql. Luigi On Wed, May 24, 2017 at 3:27 AM Jeff C <[hidden email]> wrote: Hi, ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
I wrote a simple piece of code, but I am still getting the same error as before if my mouse hovers over the import QuantLib as ql.
Input: import QuantLib as ql date = ql.Date(7, 3, 2015) print(date) Output: /anaconda/bin/python3.6 /Users/jeffcalhou/PycharmProjects/QuantLib/QuantLib.py Traceback (most recent call last): File "/Users/jeffcalhou/PycharmProjects/QuantLib/QuantLib.py", line 1, in <module> import QuantLib as ql File "/Users/jeffcalhou/PycharmProjects/QuantLib/QuantLib.py", line 3, in <module> date = ql.Date(7, 3, 2015) AttributeError: module 'QuantLib' has no attribute 'Date' Process finished with exit code 1 Instead of printing March 3rd, 2015 |
Where does /Users/jeffcalhou/PycharmProjects/QuantLib/QuantLib.py come from? It is the one distributed in QuantLib-SWIG-1.10.tar.gz? Luigi On Thu, May 25, 2017 at 5:17 PM Jeff C <[hidden email]> wrote: I wrote a simple piece of code, but I am still getting the same error as ------------------------------------------------------------------------------ Check out the vibrant tech community on one of the world's most engaging tech sites, Slashdot.org! http://sdm.link/slashdot _______________________________________________ QuantLib-users mailing list [hidden email] https://lists.sourceforge.net/lists/listinfo/quantlib-users |
Free forum by Nabble | Edit this page |