New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tests fail, seems like Cython is not configured to compile with numpy correctly #8432

Closed
wanglongqi opened this Issue Nov 12, 2014 · 21 comments

Comments

Projects
None yet
5 participants
@wanglongqi
Copy link
Contributor

wanglongqi commented Nov 12, 2014

Following are the standard output:

D:\sympytest>git clone git@github.com:sympy/sympy.git
Cloning into 'sympy'...
remote: Counting objects: 153742, done.
remote: Compressing objects: 100% (4/4), done.
Receiving objects: 100% (153742/153742), 62.98 MiB | 13.00 KiB/s, done.

Resolving deltas: 100% (122073/122073), done.
Checking connectivity... done

sh-3.1$ cd sympy

sh-3.1$ ./bin/test |tee test.log
======================================================= test process starts =======================================================
executable:         c:\Python\python.exe  (2.7.8-final-0) [CPython]
architecture:       32-bit
cache:              yes
ground types:       python
random seed:        68232668
hash randomization: on (PYTHONHASHSEED=2780600447)

sympy\assumptions\tests\test_assumptions_2.py[5] .....                                                                         [OK]
sympy\assumptions\tests\test_context.py[4] ....                                                                                [OK]
sympy\assumptions\tests\test_matrices.py[19] ..........ff.......                                                               [OK]



__________________________________________________________ xpassed tests __________________________________________________________
sympy\core\tests\test_wester.py: test_V12
sympy\core\tests\test_wester.py: test_T10
sympy\printing\tests\test_gtk.py: test_1
sympy\utilities\tests\test_module_imports.py: test_module_imports_are_direct

___________________________________________________________________________________________________________________________________
_________________________________ sympy\external\tests\test_autowrap.py:test_wrap_twice_c_cython __________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 138, in test_wrap_twice_c_cython
    runtest_autowrap_twice('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 51, in runtest_autowrap_twice
    f = autowrap((((a + b)/c)**5).expand(), language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 151, in wrap_code
    shutil.rmtree(workdir)
  File "c:\Python\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\Python\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'c:\\users\\pecker\\appdata\\local\\temp\\tmpgz2ecp_sympy_compile\\wrapper_module_1.pyd'
___________________________________________________________________________________________________________________________________
_______________________________ sympy\external\tests\test_autowrap.py:test_autowrap_trace_C_Cython ________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 143, in test_autowrap_trace_C_Cython
    runtest_autowrap_trace('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 61, in runtest_autowrap_trace
    trace = autowrap(A[i, i], language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext
cythoning wrapper_module_2.pyx to wrapper_module_2.c
building 'wrapper_module_2' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_2.c -o build\temp.win-amd64-2.7\Release\wrapper_module_2.o -std=c99
wrapper_module_2.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1

___________________________________________________________________________________________________________________________________
___________________________ sympy\external\tests\test_autowrap.py:test_autowrap_matrix_vector_C_cython ____________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 148, in test_autowrap_matrix_vector_C_cython
    runtest_autowrap_matrix_vector('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 69, in runtest_autowrap_matrix_vector
    mv = autowrap(expr, language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext
cythoning wrapper_module_3.pyx to wrapper_module_3.c
building 'wrapper_module_3' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_3.c -o build\temp.win-amd64-2.7\Release\wrapper_module_3.o -std=c99
wrapper_module_3.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1

___________________________________________________________________________________________________________________________________
___________________________ sympy\external\tests\test_autowrap.py:test_autowrap_matrix_matrix_C_cython ____________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 153, in test_autowrap_matrix_matrix_C_cython
    runtest_autowrap_matrix_matrix('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 81, in runtest_autowrap_matrix_matrix
    matmat = autowrap(expr, language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext
cythoning wrapper_module_4.pyx to wrapper_module_4.c
building 'wrapper_module_4' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_4.c -o build\temp.win-amd64-2.7\Release\wrapper_module_4.o -std=c99
wrapper_module_4.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1

___________________________________________________________________________________________________________________________________
__________________________________ sympy\external\tests\test_autowrap.py:test_ufuncify_C_Cython ___________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 158, in test_ufuncify_C_Cython
    runtest_ufuncify('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 93, in runtest_ufuncify
    fabc = ufuncify([a, b, c], a*b + c, backend=backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 857, in wrapper
    return user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 878, in ufuncify
    tempdir, args, flags, verbose, helpers)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 857, in wrapper
    return user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext
cythoning wrapper_module_5.pyx to wrapper_module_5.c
building 'wrapper_module_5' extension
creating build
creating build\temp.win-amd64-2.7
creating build\temp.win-amd64-2.7\Release
c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_5.c -o build\temp.win-amd64-2.7\Release\wrapper_module_5.o -std=c99
wrapper_module_5.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory
compilation terminated.
error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1

___________________________________________________________________________________________________________________________________
____________________________________ sympy\external\tests\test_autowrap.py:test_ufuncify_numpy ____________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 167, in test_ufuncify_numpy
    runtest_ufuncify('C', 'numpy')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 93, in runtest_ufuncify
    fabc = ufuncify([a, b, c], a*b + c, backend=backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 857, in wrapper
    return user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 864, in ufuncify
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 151, in wrap_code
    shutil.rmtree(workdir)
  File "c:\Python\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\Python\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'c:\\users\\pecker\\appdata\\local\\temp\\tmpqfz1mc_sympy_compile\\wrapper_module_6.pyd'

___________________________________________________________________________________________________________________________________
____________________________ sympy\interactive\tests\test_ipythonprinting.py:test_print_builtin_option ____________________________
  File "d:\sympytest\sympy\sympy\interactive\tests\test_ipythonprinting.py", line 70, in test_print_builtin_option
    assert text in ("{pi: 3.14, n_i: 3}", u('{n\u1d62: 3, \u03c0: 3.14}'))
AssertionError
___________________________________________________________________________________________________________________________________
______________________________ sympy\physics\vector\tests\test_printing.py:test_vector_pretty_print _______________________________
  File "d:\sympytest\sympy\sympy\physics\vector\tests\test_printing.py", line 45, in test_vector_pretty_print
    assert expected == pp.doprint(v)
AssertionError
___________________________________________________________________________________________________________________________________
______________________________ sympy\physics\vector\tests\test_printing.py:test_dyadic_pretty_print _______________________________
  File "d:\sympytest\sympy\sympy\physics\vector\tests\test_printing.py", line 138, in test_dyadic_pretty_print
    assert expected == result
AssertionError
___________________________________________________________________________________________________________________________________
___________________________________ sympy\plotting\tests\test_plot_implicit.py:test_matplotlib ____________________________________
  File "d:\sympytest\sympy\sympy\plotting\tests\test_plot_implicit.py", line 63, in test_matplotlib
    plot_and_save('test')
  File "d:\sympytest\sympy\sympy\plotting\tests\test_plot_implicit.py", line 58, in plot_and_save
    assert 'No labeled objects found' in str(w[0].message)
AssertionError
___________________________________________________________________________________________________________________________________
____________________________________ sympy\vector\tests\test_printing.py:test_pretty_printing _____________________________________
  File "d:\sympytest\sympy\sympy\vector\tests\test_printing.py", line 78, in test_pretty_printing
    assert pretty(v[8]) == pretty_v_8
AssertionError

 tests finished: 5678 passed, 5 failed, 138 skipped, 321 expected to fail, 4 expected to fail but passed, 6 exceptions, 
in 3051.11 seconds 
DO *NOT* COMMIT!

@wanglongqi wanglongqi changed the title Test fail, seems like Cython is not configured to compile with numpy correctly Tests fail, seems like Cython is not configured to compile with numpy correctly Nov 12, 2014

@skirpichev skirpichev added the Windows label Nov 12, 2014

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Nov 12, 2014

I'm not sure there has ever been much testing of the autowrap framework on Windows.

I recommend doing a simple autowrap example and setting the tmpdir flag so all the generated files are retained. cd into that directory after you run autowrap (and it fails), then try to build the module manually with:

python setup.py build_ext --inplace

You should get some useful tracebacks.

Also you need to have numpy installed (along with it's headers) in order for autowrap to work.

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Nov 12, 2014

The shutil.remove() error must have to do with permissions. I'm not sure how they work on Windows.

There are also the printing and ipython errors. These need to be fixed for Windows also. Maybe you can make separate issues for those.

@skirpichev

This comment has been minimized.

Copy link
Contributor

skirpichev commented Nov 12, 2014

There are also the printing and ipython errors. These need to be fixed for Windows also.

I have seen ipython error on *nix too. btw, we have #7679.

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Nov 12, 2014

#8364 should have fixed the pretty issues.

@asmeurer

This comment has been minimized.

Copy link
Member

asmeurer commented Nov 12, 2014

That branch is only in the release branch, not master yet, so you'll need to test there. If you can test the release candidate that would be great.

@asmeurer

This comment has been minimized.

@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Nov 13, 2014

@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Nov 13, 2014

@asmeurer I believe release candidate would not be better, since this is a bug of Cython for Windows. I will paste the tests log later.

@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Nov 13, 2014

The pretty test is passed in rc:

bash-3.1$ ./bin/test pretty
======================================================= test process starts =======================================================
executable:         c:\Python\python.exe  (2.7.8-final-0) [CPython]
architecture:       32-bit
cache:              yes
ground types:       python
random seed:        72783178
hash randomization: on (PYTHONHASHSEED=3962765161)

sympy\printing\pretty\tests\test_pretty.py[69] .....................................................................           [OK]

=========================================== tests finished: 69 passed, in 1.56 seconds ============================================
@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Nov 13, 2014

Tests results for release candidate, seems only Cython tests and test_plot_implicit.py are failed.

__________________________________________________________ xpassed tests __________________________________________________________
sympy\core\tests\test_wester.py: test_T10
sympy\core\tests\test_wester.py: test_V12
sympy\printing\tests\test_gtk.py: test_1
sympy\utilities\tests\test_module_imports.py: test_module_imports_are_direct

___________________________________________________________________________________________________________________________________
_________________________________ sympy\external\tests\test_autowrap.py:test_wrap_twice_c_cython __________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 138, in test_wrap_twice_c_cython
    runtest_autowrap_twice('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 51, in runtest_autowrap_twice
    f = autowrap((((a + b)/c)**5).expand(), language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 151, in wrap_code
    shutil.rmtree(workdir)
  File "c:\Python\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\Python\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'c:\\users\\pecker\\appdata\\local\\temp\\tmpw6jrfh_sympy_compile\\wrapper_module_1.pyd'
___________________________________________________________________________________________________________________________________
_______________________________ sympy\external\tests\test_autowrap.py:test_autowrap_trace_C_Cython ________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 143, in test_autowrap_trace_C_Cython
    runtest_autowrap_trace('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 61, in runtest_autowrap_trace
    trace = autowrap(A[i, i], language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext

cythoning wrapper_module_2.pyx to wrapper_module_2.c

building 'wrapper_module_2' extension

creating build

creating build\temp.win-amd64-2.7

creating build\temp.win-amd64-2.7\Release

c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_2.c -o build\temp.win-amd64-2.7\Release\wrapper_module_2.o -std=c99

wrapper_module_2.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory

compilation terminated.

error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1


___________________________________________________________________________________________________________________________________
___________________________ sympy\external\tests\test_autowrap.py:test_autowrap_matrix_vector_C_cython ____________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 148, in test_autowrap_matrix_vector_C_cython
    runtest_autowrap_matrix_vector('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 69, in runtest_autowrap_matrix_vector
    mv = autowrap(expr, language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext

cythoning wrapper_module_3.pyx to wrapper_module_3.c

building 'wrapper_module_3' extension

creating build

creating build\temp.win-amd64-2.7

creating build\temp.win-amd64-2.7\Release

c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_3.c -o build\temp.win-amd64-2.7\Release\wrapper_module_3.o -std=c99

wrapper_module_3.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory

compilation terminated.

error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1


___________________________________________________________________________________________________________________________________
___________________________ sympy\external\tests\test_autowrap.py:test_autowrap_matrix_matrix_C_cython ____________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 153, in test_autowrap_matrix_matrix_C_cython
    runtest_autowrap_matrix_matrix('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 81, in runtest_autowrap_matrix_matrix
    matmat = autowrap(expr, language, backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 872, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext

cythoning wrapper_module_4.pyx to wrapper_module_4.c

building 'wrapper_module_4' extension

creating build

creating build\temp.win-amd64-2.7

creating build\temp.win-amd64-2.7\Release

c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_4.c -o build\temp.win-amd64-2.7\Release\wrapper_module_4.o -std=c99

wrapper_module_4.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory

compilation terminated.

error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1


___________________________________________________________________________________________________________________________________
__________________________________ sympy\external\tests\test_autowrap.py:test_ufuncify_C_Cython ___________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 158, in test_ufuncify_C_Cython
    runtest_ufuncify('C', 'cython')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 93, in runtest_ufuncify
    fabc = ufuncify([a, b, c], a*b + c, backend=backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 857, in wrapper
    return user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 878, in ufuncify
    tempdir, args, flags, verbose, helpers)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 857, in wrapper
    return user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 508, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 144, in wrap_code
    self._process_files(routine)
  File "sympy\utilities\autowrap.py", line 163, in _process_files
    " ".join(command), e.output.decode()))
CodeWrapError: Error while executing command: c:\Python\python.exe setup.py build_ext --inplace. Command output is:
running build_ext

cythoning wrapper_module_5.pyx to wrapper_module_5.c

building 'wrapper_module_5' extension

creating build

creating build\temp.win-amd64-2.7

creating build\temp.win-amd64-2.7\Release

c:\Python\MinGW\bin\gcc.exe -DMS_WIN64 -mdll -O -Wall -Ic:\Python\include -Ic:\Python\PC -c wrapper_module_5.c -o build\temp.win-amd64-2.7\Release\wrapper_module_5.o -std=c99

wrapper_module_5.c:232:31: fatal error: numpy/arrayobject.h: No such file or directory

compilation terminated.

error: command 'c:\\Python\\MinGW\\bin\\gcc.exe' failed with exit status 1


___________________________________________________________________________________________________________________________________
____________________________________ sympy\external\tests\test_autowrap.py:test_ufuncify_numpy ____________________________________
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 167, in test_ufuncify_numpy
    runtest_ufuncify('C', 'numpy')
  File "d:\sympytest\sympy\sympy\external\tests\test_autowrap.py", line 93, in runtest_ufuncify
    fabc = ufuncify([a, b, c], a*b + c, backend=backend)
  File "sympy\core\cache.py", line 91, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 857, in wrapper
    return user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 864, in ufuncify
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 151, in wrap_code
    shutil.rmtree(workdir)
  File "c:\Python\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\Python\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'c:\\users\\pecker\\appdata\\local\\temp\\tmpzthevf_sympy_compile\\wrapper_module_6.pyd'

___________________________________________________________________________________________________________________________________
___________________________________ sympy\plotting\tests\test_plot_implicit.py:test_matplotlib ____________________________________
  File "d:\sympytest\sympy\sympy\plotting\tests\test_plot_implicit.py", line 63, in test_matplotlib
    plot_and_save('test')
  File "d:\sympytest\sympy\sympy\plotting\tests\test_plot_implicit.py", line 58, in plot_and_save
    assert 'No labeled objects found' in str(w[0].message)
AssertionError

 tests finished: 5670 passed, 1 failed, 138 skipped, 325 expected to fail, 4 expected to fail but passed, 6 exceptions, 
in 2857.98 seconds 
DO *NOT* COMMIT!
@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 1, 2015

Maybe this #8848 fixes this issue?

We need someone to test master in Windows.

@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Jul 1, 2015

I will check master in Windows under python2

@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Jul 1, 2015

Test on following commit:

commit c4ad62846323824feef6726cdb655c4a69c516bf
Merge: 36f2be8 018a66b
Author: Sudhanshu Mishra <mrsud94@gmail.com>
Date:   Wed Jul 1 03:08:09 2015 +0530

    Merge pull request #9526 from siefkenj/master

    Geometry `equal` -> `equals`

Output:

$ bin/test autowrap
============================= test process starts =============================
executable:         c:\Python\python.exe  (2.7.8-final-0) [CPython]
architecture:       32-bit
cache:              yes
ground types:       python
random seed:        98404930
hash randomization: on (PYTHONHASHSEED=3653343158)

sympy\external\tests\test_autowrap.py[11] sssssEEEEEE                    [FAIL]
sympy\utilities\tests\test_autowrap.py[8] ........                         [OK]

_______________________________________________________________________________
_______ sympy\external\tests\test_autowrap.py:test_wrap_twice_c_cython ________
  File "d:\svns\sympy\sympy\external\tests\test_autowrap.py", line 138, in test_
wrap_twice_c_cython
    runtest_autowrap_twice('C', 'cython')
  File "d:\svns\sympy\sympy\external\tests\test_autowrap.py", line 51, in runtes
t_autowrap_twice
    f = autowrap((((a + b)/c)**5).expand(), language, backend)
  File "sympy\core\cache.py", line 93, in wrapper
    retval = cfunc(*args, **kwargs)
  File "sympy\core\compatibility.py", line 880, in wrapper
    result = user_function(*args, **kwds)
  File "sympy\utilities\autowrap.py", line 521, in autowrap
    return code_wrapper.wrap_code(routine, helpers=helps)
  File "sympy\utilities\autowrap.py", line 151, in wrap_code
    shutil.rmtree(workdir)
  File "c:\Python\lib\shutil.py", line 252, in rmtree
    onerror(os.remove, fullname, sys.exc_info())
  File "c:\Python\lib\shutil.py", line 250, in rmtree
    os.remove(fullname)
WindowsError: [Error 5] Access is denied: 'c:\\users\\username\\appdata\\local\\te
mp\\tmplzt7wy_sympy_compile\\wrapper_module_1.pyd'
_______________________________________________________________________________

Another possible issue, the test returns wrong python version:

> C:\Python\python.exe -V
Python 2.7.8 :: Anaconda 2.1.0 (64-bit)
@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 1, 2015

Ok, thanks. Our code generates the Cython files in a temporary directory and then it deletes the directory. autowrap has an option that allows you to skip the directory deletion. I'd be curious if autowrap would work if you set the option to keep the directory. I'm not sure why this is created such that there are permissions issues. Is that directory, c:\\users\\username\\appdata\\local\\te mp\\tmplzt7wy_sympy_compile\\ in a known place that the user doesn't have permissions?

Another possible issue, the test returns wrong python version:

Why do you say it is wrong? Seems like you have Anaconda installed and have put it first in your PATH.

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 1, 2015

Maybe we need to do this:

http://stackoverflow.com/questions/1213706/what-user-do-python-scripts-run-as-in-windows

in "sympy\utilities\autowrap.py", line 151

@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Jul 1, 2015

Check the output from test script:

executable:         c:\Python\python.exe  (2.7.8-final-0) [CPython]
architecture:       32-bit

but actually, I am using 64-bit

> C:\Python\python.exe -V
Python 2.7.8 :: Anaconda 2.1.0 (64-bit)

moorepants added a commit to moorepants/sympy that referenced this issue Jul 1, 2015

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 1, 2015

Can you try this fix: #9597 ?

I'm not sure what the 32/64 bit thing is all about.

@wanglongqi

This comment has been minimized.

Copy link
Contributor

wanglongqi commented Jul 1, 2015

Still not working, I do not find the option you mentioned. But the code generation and compilation is OK. The temporary files are not deleted, I can import them into python and the result is correct.

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 1, 2015

I'll try this some more later when I have a Windows machine available. There must be some workaround with the permissions to delete the temporary directory. One option would be to not delete it on windows.

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 1, 2015

Thanks for coming back to this.

@moorepants

This comment has been minimized.

Copy link
Member

moorepants commented Jul 1, 2015

Oh, the optional kwarg is filepath. If you give a directory name (string) to that arg, then it will bypass the tempdir creation and create all the files in the directory you specify.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment