neurophysik / jitcdde

Just-in-time compilation for delay differential equations
Other
56 stars 14 forks source link

AttributeError: 'RealDouble' object has no attribute 'real_part' #20

Closed drsaroj closed 5 years ago

drsaroj commented 5 years ago

When I am running the example mackey_glass.py, I am getting the error

Traceback (most recent call last):
  File "mackey_glass.py", line 73, in <module>
    DDE.step_on_discontinuities()
  File "/Users/sarojkumar/Library/Python/3.7/lib/python/site-packages/jitcdde/_jitcdde.py", line 904, in step_on_discontinuities
    for delay in self.delays
  File "/Users/sarojkumar/Library/Python/3.7/lib/python/site-packages/jitcdde/_jitcdde.py", line 904, in <listcomp>
    for delay in self.delays
AttributeError: 'RealDouble' object has no attribute 'real_part'

I have gone through a similar problem where you have listed a solution to use

pip3 install symengine==0.3.1.dev1 --force-reinstall

which again shows the following error

Found existing installation: symengine 0.4.0
    Uninstalling symengine-0.4.0:
      Successfully uninstalled symengine-0.4.0
  Running setup.py install for symengine ... error
    ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/py/fk3c24856kn0b81dvlf3mwl80000gn/T/pip-install-azaxqukr/symengine/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/py/fk3c24856kn0b81dvlf3mwl80000gn/T/pip-record-g6dym_ro/install-record.txt --single-version-externally-managed --compile:
    ERROR: running install
    running build
    running build_ext
    error: [Errno 2] No such file or directory: 'cmake': 'cmake'
    ----------------------------------------
  Rolling back uninstall of symengine
  Moving to /Users/sarojkumar/Library/Python/3.7/lib/python/site-packages/symengine-0.4.0.dist-info/
   from /Users/sarojkumar/Library/Python/3.7/lib/python/site-packages/~ymengine-0.4.0.dist-info
  Moving to /Users/sarojkumar/Library/Python/3.7/lib/python/site-packages/symengine/
   from /Users/sarojkumar/Library/Python/3.7/lib/python/site-packages/~ymengine
ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 -u -c 'import setuptools, tokenize;__file__='"'"'/private/var/folders/py/fk3c24856kn0b81dvlf3mwl80000gn/T/pip-install-azaxqukr/symengine/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /private/var/folders/py/fk3c24856kn0b81dvlf3mwl80000gn/T/pip-record-g6dym_ro/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/py/fk3c24856kn0b81dvlf3mwl80000gn/T/pip-install-azaxqukr/symengine/

I am using Python 3.7.3 in Mac OSX 10.13.6 with Clang 6.0 (clang-600.0.57.

Wrzlprmft commented 5 years ago

Your problem is that you lack CMake, which is required to build the old version of SymEngine. You can probably solve this by installing CMake. Alternatively, you can install JiTC*DE fresh from the Git repository, where this was already fixed:

pip3 install \
        git+git://github.com/neurophysik/jitcxde_common \
        git+git://github.com/neurophysik/jitcode \
        git+git://github.com/neurophysik/jitcdde \
        git+git://github.com/neurophysik/jitcsde \
        --no-dependencies --user

It appears that I have to make a new release to deal with this issue.

drsaroj commented 5 years ago

Thank you for your support, Now it is working fine. The only warning that appears is from running the file two_Roesslers.py which is following


two_Roesslers.py:27: FutureWarning: arrays to stack must be passed as a "sequence" type such as list or tuple. Support for non-sequence iterables such as generators is deprecated as of NumPy 1.16 and will raise an error in the future. data = np.vstack(DDE.integrate(T) for T in times)


Thank you once again.