1

I just finished compiling QuantLib in Visual Studio and by installing module via SWIG. Testing and everything worked fine.
Now in Spyder, when I want to import QuantLib, I get the following error:

AttributeError: module 'QuantLib._QuantLib' has no attribute 'delete_SwigPyIterator'

Is this something I need to download/install?
Thx

Zephyr
  • 11,891
  • 53
  • 45
  • 80
Lorcan
  • 11
  • 1
  • for more precision, within the QuantLib import, the _QuantLib import works without issues, and the error message above arises for the line: __swig_destroy__ = _QuantLib.delete_SwigPyIterator – Lorcan Jul 20 '20 at 02:39
  • Not sure what went wrong with your installation. Is that the first installation on your machine, or do you have an old one already? In any case, if you don't need to modify the code, I suggest that you avoid compiling and install a precompiled wheel with `pip install QuantLib` instead. (You might need to remove the module you installed to make sure they don't interfere.) – Luigi Ballabio Jul 20 '20 at 07:54
  • Thanks so much Luigi. However, I did try that at first, which is why I tried compiling. If I remove my installation and run pip install QuantLib, when I import QuantLib, I get this error: ImportError: cannot import name '_QuantLib' from 'QuantLib' – Lorcan Jul 20 '20 at 18:40
  • Hmm. That's the first I hear of it. What Python version are you using, and is it 32-bit or 64-bit? – Luigi Ballabio Jul 21 '20 at 07:06
  • Also, you mentioned Spyder. Do you get the same error when running Python from the command line? – Luigi Ballabio Jul 21 '20 at 07:07
  • Yes there was a version mismatch between my pip install (32) and my spyder installation (64); your tip about running in cmd line worked - that's how i noticed. Thanks! Separately, I'm not tied to spyder - what would be your favorite IDE for QuantLib work ? – Lorcan Jul 21 '20 at 14:07
  • I'm the wrong person to ask. I'm still using Emacs for everything. – Luigi Ballabio Jul 21 '20 at 14:42
  • ok :) thanks for everything - very keen to delve into the QuantLib world! – Lorcan Jul 21 '20 at 16:55

0 Answers0