SymPy and IronPython

340 views
Skip to first unread message

Groover

unread,
Apr 6, 2014, 9:09:04 AM4/6/14
to sy...@googlegroups.com
OK, I really would like to get this working with the current release of IronPython (2.7.4). Any suggestions are appreciated. Using git master:

>>>import sympy

unicode_escape_decode
() takes no arguments (1 given)

I defined a replacement function for the codecs module:

import codecs
def my_unicode_escape_decode(x):
   
return x
codecs
.unicode_escape_decode = my_unicode_escape_decode

Now:

>>>import sympy
'module' object has no attribute 'mpmath'

>>>import sympy.mpmath
'module'object has no attribute 'mpmath'

Displaying sys.path shows "..\..\PythonLib".

PythonLib is where all the standard Python 2.7 libraries are. In there I have copied sympy into a sub-folder. So I have:

PythonLib\sympy\__init__.py
PythonLib\sympy\assumptions\__init__.py
etc, etc.

Any suggestions on what to try next? Thanks.

Andy


Aaron Meurer

unread,
Apr 6, 2014, 11:32:20 AM4/6/14
to sy...@googlegroups.com
Are there really no tracebacks for the errors?

Aaron Meurer
--
You received this message because you are subscribed to the Google Groups "sympy" group.
To unsubscribe from this group and stop receiving emails from it, send an email to sympy+un...@googlegroups.com.
To post to this group, send email to sy...@googlegroups.com.
Visit this group at http://groups.google.com/group/sympy.
To view this discussion on the web visit https://groups.google.com/d/msgid/sympy/10f03aa6-dfea-4454-bd00-6a860f4bf8a9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Groover

unread,
Apr 6, 2014, 4:15:31 PM4/6/14
to sy...@googlegroups.com
Sorry, here it is. I also tried importing xml.dom to see if any submodules were being found.

========================================================
>>>import sympy

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\__init__.py", line 32, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\__init__.py", line 8, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\expr.py", line 7, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\evalf.py", line 27, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\containers.py", line 14, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\utilities\__init__.py", line 17, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\utilities\timeutils.py", line 11, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\compatibility.py", line 110, in u
TypeError: unicode_escape_decode() takes no arguments (1 given)

>>>import codecs
>>>def my_unicode_escape_decode(x):
...    return x
...    
>>>codecs.unicode_escape_decode = my_unicode_escape_decode

>>>import sympy

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\__init__.py", line 32, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\__init__.py", line 8, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\expr.py", line 7, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\evalf.py", line 9, in <module>
AttributeError: 'module' object has no attribute 'mpmath'

>>>import sympy.mpmath.libmp as libmp

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\__init__.py", line 34, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\assumptions\__init__.py", line 2, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\assumptions\ask.py", line 323, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\cache.py", line 93, in wrapper
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\function.py", line 185, in __new__
ImportError: No module named fancysets

>>>from sympy.sets.fancysets import Naturals0

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\__init__.py", line 32, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\__init__.py", line 8, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\expr.py", line 7, in <module>
  File "C:\Users\Andy\Documents\ADScript\PythonLib\sympy\core\evalf.py", line 9, in <module>
AttributeError: 'module' object has no attribute 'mpmath'

>>>import xml.dom


>>>
========================================================

Groover

unread,
Apr 6, 2014, 4:18:03 PM4/6/14
to sy...@googlegroups.com
>>>sys.path


['.', 'C:\\Users\\Andy\\Documents\\ADScript\\bin\\Debug\\Lib', 'C:\\Users\\Andy\\Documents\\ADScript\\bin\\Debug\\DLLs', 'C:\\Users\\Andy\\Documents\\ADScript\\bin\\Debug\\PythonLib', '../../PythonLib']

Groover

unread,
Apr 9, 2014, 5:48:12 AM4/9/14
to sy...@googlegroups.com
https://mail.python.org/pipermail/ironpython-users/2014-April/016918.html

Still not quite solved, but almost there. I can at least perform some calculus after using the workarounds.

Aaron Meurer

unread,
Apr 9, 2014, 11:50:21 AM4/9/14
to sy...@googlegroups.com
Maybe IronPython handles importing differently?

Aaron Meurer


Иван Петухов

unread,
Oct 12, 2014, 6:06:09 PM10/12/14
to sy...@googlegroups.com
It problem solving ?

воскресенье, 6 апреля 2014 г., 17:09:04 UTC+4 пользователь Groover написал:
Reply all
Reply to author
Forward
0 new messages