QuTip succesfully installed, but, error when running unit tests (on Mac OSX).

460 views
Skip to first unread message

Ryan Sweke

unread,
Jun 5, 2015, 6:41:32 AM6/5/15
to qu...@googlegroups.com
Hi,

I would like to use QuTip on Mac OSX. I installed QuTip using the Python 2.7 installation script (via Homebrew) and everything ran fine until the unit tests. The output I get is pasted below - if any one could offer any advice that would be greatly appreciated.

Thanks,
Ryan

-------------

Successfully installed qutip-3.1.0
Running QuTiP unit tests
/Users/ryan/.pyxbld/temp.macosx-10.10-x86_64-2.7/pyrex/qutip/cy/spmatfuncs.c:250:10: fatal error:
      'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
         ^
1 error generated.
/Users/ryan/.pyxbld/temp.macosx-10.10-x86_64-2.7/pyrex/qutip/cy/spmatfuncs.c:250:10: fatal error:
      'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
         ^
1 error generated.
/Users/ryan/.pyxbld/temp.macosx-10.10-x86_64-2.7/pyrex/qutip/cy/spmatfuncs.c:250:10: fatal error:
      'numpy/arrayobject.h' file not found
#include "numpy/arrayobject.h"
         ^
1 error generated.
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/local/lib/python2.7/site-packages/qutip/__init__.py", line 213, in <module>
    from qutip.qobj import *
  File "/usr/local/lib/python2.7/site-packages/qutip/qobj.py", line 60, in <module>
    from qutip.ptrace import _ptrace
  File "/usr/local/lib/python2.7/site-packages/qutip/ptrace.py", line 38, in <module>
    from qutip.sparse import sp_reshape
  File "/usr/local/lib/python2.7/site-packages/qutip/sparse.py", line 49, in <module>
    from qutip.cy.sparse_utils import (_sparse_profile, _sparse_permute,
  File "/usr/local/lib/python2.7/site-packages/qutip/cy/__init__.py", line 1, in <module>
    from qutip.cy.spmatfuncs import *
  File "/usr/local/lib/python2.7/site-packages/pyximport/pyximport.py", line 431, in load_module
    language_level=self.language_level)
  File "/usr/local/lib/python2.7/site-packages/pyximport/pyximport.py", line 209, in load_module
    inplace=build_inplace, language_level=language_level)
  File "/usr/local/lib/python2.7/site-packages/pyximport/pyximport.py", line 186, in build_module
    reload_support=pyxargs.reload_support)
  File "/usr/local/lib/python2.7/site-packages/pyximport/pyxbuild.py", line 100, in pyx_to_dll
    dist.run_commands()
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python2.7/site-packages/Cython/Distutils/build_ext.py", line 163, in run
    _build_ext.build_ext.run(self)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 337, in run
    self.build_extensions()
  File "/usr/local/lib/python2.7/site-packages/Cython/Distutils/build_ext.py", line 171, in build_extensions
    self.build_extension(ext)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/command/build_ext.py", line 496, in build_extension
    depends=ext.depends)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/ccompiler.py", line 574, in compile
    self._compile(obj, src, ext, cc_args, extra_postargs, pp_opts)
  File "/usr/local/Cellar/python/2.7.10/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/unixccompiler.py", line 122, in _compile
    raise CompileError, msg
ImportError: Building module qutip.cy.spmatfuncs failed: ["CompileError: command 'clang' failed with exit status 1\n"]
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry and just ignore them. Thanks!

Warning: Some directories in /usr/local/share/man aren't writable.
This can happen if you "sudo make install" software that isn't managed
by Homebrew. If a brew tries to add locale information to one of these
directories, then the install will fail during the link step.
You should probably `chown` them:

    /usr/local/share/man/de
    /usr/local/share/man/de/man1

Warning: A newer Command Line Tools release is available.
Update them from Software Update in the App Store.

Warning: You have unlinked kegs in your Cellar
Leaving kegs unlinked can lead to build-trouble and cause brews that depend on
those kegs to fail to run properly once built. Run `brew link` on these:

    ghostscript

Warning: Your Xcode (6.1.1) is outdated
Please update to Xcode 6.3.2.
Xcode can be updated from the App Store.


----------------------

Paul Nation

unread,
Jun 6, 2015, 7:02:03 PM6/6/15
to qu...@googlegroups.com
I see the same thing. The runtime cython generator can not find the numpy header file.   It worked in the past so it may be something to do with changes in a newer version of cython. I will look into it. 

Paul
--
You received this message because you are subscribed to the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this group and stop receiving emails from it, send an email to qutip+un...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Ryan Sweke

unread,
Jun 7, 2015, 2:15:52 AM6/7/15
to qu...@googlegroups.com
Thanks very much.

Ryan

--
You received this message because you are subscribed to a topic in the Google Groups "QuTiP: Quantum Toolbox in Python" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/qutip/ApQfgHbLRSw/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.

aktasd...@gmail.com

unread,
Aug 21, 2015, 6:38:53 PM8/21/15
to QuTiP: Quantum Toolbox in Python
Hello,

I had the same pb today when I tried to use the homebew install instead of the Macport way (which worked fine with my other laptop) and I didn't want to re-install Qutip...
So if you are still in the same situation, here is a quick fix:
Run this so the compiler is able to find the numpy's library in the "usual" path, there for sure a better and more elegant way to tell the compiler to look in the proper folder for the headers but I'm too lazy ^^

sudo cp -R /usr/local/lib/python2.7/site-packages/numpy/core/include/numpy /usr/include


Cheers,

Djeylan

Reply all
Reply to author
Forward
0 new messages