sympy / scipy-2017-codegen-tutorial

SymPy code generation tutorial at SciPy 2017
http://www.sympy.org/scipy-2017-codegen-tutorial/
Other
61 stars 26 forks source link

Windows build is failing on theano call #11

Closed moorepants closed 7 years ago

moorepants commented 7 years ago
[NbConvertApp] ERROR | Error while converting 'code-printers.ipynb'
Traceback (most recent call last):
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\nbconvertapp.py", line 381, in export_single_notebook
    output, resources = self.exporter.from_filename(notebook_filename, resources=resources)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\exporters\exporter.py", line 172, in from_filename
    return self.from_file(f, resources=resources, **kw)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\exporters\exporter.py", line 190, in from_file
    return self.from_notebook_node(nbformat.read(file_stream, as_version=4), resources=resources, **kw)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\exporters\html.py", line 84, in from_notebook_node
    return super(HTMLExporter, self).from_notebook_node(nb, resources, **kw)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\exporters\templateexporter.py", line 268, in from_notebook_node
    nb_copy, resources = super(TemplateExporter, self).from_notebook_node(nb, resources, **kw)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\exporters\exporter.py", line 132, in from_notebook_node
    nb_copy, resources = self._preprocess(nb_copy, resources)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\exporters\exporter.py", line 309, in _preprocess
    nbc, resc = preprocessor(nbc, resc)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\preprocessors\base.py", line 47, in __call__
    return self.preprocess(nb,resources)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\preprocessors\execute.py", line 242, in preprocess
    nb, resources = super(ExecutePreprocessor, self).preprocess(nb, resources)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\preprocessors\base.py", line 70, in preprocess
    nb.cells[index], resources = self.preprocess_cell(cell, resources, index)
  File "C:\Miniconda35\envs\codegen17\lib\site-packages\nbconvert\preprocessors\execute.py", line 275, in preprocess_cell
    raise CellExecutionError(msg)
nbconvert.preprocessors.execute.CellExecutionError: An error occurred while executing the following cell:
------------------
from sympy.printing.theanocode import theano_code
theano_code(expr)
------------------
bjodah commented 7 years ago

I've noticed this too. I haven't got around running that notebook in my VM yet. (I will try to do so later tonight)

bjodah commented 7 years ago

I ran this in my VM, there the cell actually works (but it gives a warning):

WARNING (theano.configdefaults): g++ not available, if using conda: `conda install m2w64-toolchain`
WARNING (theano.configdefaults): g++ not detected ! Theano will be unable to execute optimized C-implementations (for both CPU and GPU) and will default to Python implementations. Performance will be severely degraded. To remove this warning, set Theano flags cxx to an empty string.

installing m2w64-toolchain and rerunning the notebook gives an error:

...
. collect2.exe: error: ld returned 1 exit status_Windows-10-10.0.14393-SP0-Intel64_Family_6_Model_58_Stepping_9_GenuineIntel-3.6.1-64/lazylinker_ext/mod.cpp:976: undefined reference to `__imp__Py_TrueStruct'Error'ndefined references to `__imp__Py_NoneStruct' followow
bjodah commented 7 years ago

I've removed the theano_code example.

isuruf commented 7 years ago

undefined reference to __imp__Py_TrueStruct usually happens when you try to compile with mingw with an unpatched libpython.

moorepants commented 7 years ago

That should probably be reported to anaconda. Their theano packages on windows should just work.

isuruf commented 7 years ago

There's a anaconda package here to fix that, https://anaconda.org/anaconda/libpython