OpenSourceRisk / ORE-SWIG

Other
47 stars 44 forks source link

ORE-SWIG: post compile, cannot import Python module, cannot install via pip #12

Closed vannarho-fas closed 3 years ago

vannarho-fas commented 3 years ago

I built and tested ORE successfully then try to build ORE-SWIG.

The cmake process seems to complete with no material errors with the exception of `Performing Test supportsMaybeUninitialized - Failed' and the SWIG compile results in ~200 python deprecation and QL_DEPRECATED warnings / errors.

The outputs are oreanalyticsPYTHON_wrap.cxx.o (227mb) and _OREAnalytics.so (26.7mb).

When I run the OREAnalytics-SWIG examples it cannot find the module:

    from OREAnalytics import *
ModuleNotFoundError: No module named 'OREAnalytics'

And if I try to install via pip, I receive the error:

pip3 install QuantExt-Python
Collecting QuantExt-Python

    ERROR: Command errored out with exit status 1:
     command: /usr/local/opt/python@3.8/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/v3/b1m57r514jg5pc6clm_dfnlc0000gn/T/pip-install-2vbv3yke/quantext-python/setup.py'"'"'; __file__='"'"'/private/var/folders/v3/b1m57r514jg5pc6clm_dfnlc0000gn/T/pip-install-2vbv3yke/quantext-python/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/v3/b1m57r514jg5pc6clm_dfnlc0000gn/T/pip-pip-egg-info-jxg5goaa
         cwd: /private/var/folders/v3/b1m57r514jg5pc6clm_dfnlc0000gn/T/pip-install-2vbv3yke/quantext-python/
    Complete output (7 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/v3/b1m57r514jg5pc6clm_dfnlc0000gn/T/pip-install-2vbv3yke/quantext-python/setup.py", line 251, in <module>
        license          = codecs.open('../../LICENSE.TXT','r+',
      File "/usr/local/Cellar/python@3.8/3.8.5/Frameworks/Python.framework/Versions/3.8/lib/python3.8/codecs.py", line 905, in open
        file = builtins.open(filename, mode, buffering)
    FileNotFoundError: [Errno 2] No such file or directory: '../../LICENSE.TXT'

Using swig-4.0.2, python 3.8.5, cmake 3.18.2, ninja 1.10.1, macos 10.15.6, QuantLib-SWIG 1.18, Boost 1.73.0