Login  Register

Re: QuantLib on Python in PyCharm on Mac

Posted by Jeff C on May 25, 2017; 3:13pm
URL: http://quantlib.414.s1.nabble.com/QuantLib-on-Python-in-PyCharm-on-Mac-tp18304p18306.html

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