Discussion:
[Quantlib-users] QuantLib on Python in PyCharm on Mac
Luigi Ballabio
2017-05-25 15:46:36 UTC
Permalink
Where does /Users/jeffcalhou/PycharmProjects/QuantLib/QuantLib.py come
from? It is the one distributed in QuantLib-SWIG-1.10.tar.gz?

Luigi
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.
import QuantLib as ql
date = ql.Date(7, 3, 2015)
print(date)
/anaconda/bin/python3.6
/Users/jeffcalhou/PycharmProjects/QuantLib/QuantLib.py
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
--
http://quantlib.10058.n7.nabble.com/QuantLib-on-Python-in-PyCharm-on-Mac-tp18304p18306.html
Sent from the quantlib-users mailing list archive at Nabble.com.
------------------------------------------------------------------------------
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
https://lists.sourceforge.net/lists/listinfo/quantlib-users
Jeff C
2017-05-25 16:02:24 UTC
Permalink
I deleted the file and ran the code again and everything works. It must have
been a PyCharm issue. Thanks for the help.



--
View this message in context: http://quantlib.10058.n7.nabble.com/QuantLib-on-Python-in-PyCharm-on-Mac-tp18304p18308.html
Sent from the quantlib-users mailing list archive at Nabble.com.

Loading...