Skip to content
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: No module named spmatfuncs #891

Closed
yurivict opened this issue Jul 10, 2018 · 7 comments
Closed

Tests fail: No module named spmatfuncs #891

yurivict opened this issue Jul 10, 2018 · 7 comments

Comments

@yurivict
Copy link
Contributor

Running this code

import qutip.testing as qt
qt.run()

produces an error:

Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "qutip/__init__.py", line 171, in <module>
    from qutip.qobj import *
  File "qutip/qobj.py", line 60, in <module>
    from qutip.fastsparse import fast_csr_matrix, fast_identity
  File "qutip/fastsparse.py", line 406, in <module>
    from qutip.cy.spmath import (zcsr_transpose, zcsr_adjoint, zcsr_mult)
  File "qutip/cy/__init__.py", line 1, in <module>
    from qutip.cy.spmatfuncs import *
ImportError: No module named spmatfuncs
@quantshah
Copy link
Member

How did you install QuTiP? I installed a fresh copy with conda and I do have spmatfuncs.
Are you building from source?

shahnawaz@torch:~/dev$ conda install qutip
Solving environment: done

## Package Plan ##

  environment location: /home/shahnawaz/miniconda3

  added / updated specs:
    - qutip


The following NEW packages will be INSTALLED:

    qutip: 4.2.0-np113py36_2 conda-forge

Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done
shahnawaz@torch:~/dev$ python
Python 3.6.3 |Anaconda, Inc.| (default, Nov  9 2017, 00:19:18)
[GCC 7.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from qutip.cy.spmatfuncs import *
>>>

@yurivict
Copy link
Contributor Author

How did you install QuTiP?

In the FreeBSD, after QuTiP has been built, I run python -c "import qutip.testing as qt; qt.run();", and it fails.

@yurivict
Copy link
Contributor Author

Once installed, running

import qutip.testing as qt
qt.run()

fails:

Python Version:     2.7.15
Traceback (most recent call last):
  File "t.py", line 2, in <module>
    qt.run()
  File "/usr/local/lib/python2.7/site-packages/qutip/testing.py", line 40, in run
    about()
  File "/usr/local/lib/python2.7/site-packages/qutip/about.py", line 77, in about
    print("Number of CPUs:     %s" % hardware_info()['cpus'])
KeyError: 'cpus'

@yurivict
Copy link
Contributor Author

The last error is fixed by this PR: #895

The first error (missing spmatfuncs) is still there.

@ajgpitch
Copy link
Member

The first error generally occurs if you are running qutip from within the directory where you installed it

@yurivict
Copy link
Contributor Author

Ok, thanks, I made it to run in the port by supplying PYTHONPATH to the build directory.

@nathanshammah
Copy link
Member

This issue could be closed if all is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants