qutip import error

458 views
Skip to first unread message

Leong Sen Siang

unread,
Feb 28, 2020, 11:16:15 PM2/28/20
to QuTiP: Quantum Toolbox in Python
I had suffered some qutip import error which have some differences compared to previous post.

In [1]: import qutip

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

ImportError Traceback (most recent call last)

<ipython-input-1-e01d5608f34f> in <module>

----> 1 import qutip


C:\Anoconda\lib\site-packages\qutip\__init__.py in <module>

169

170 # core

--> 171 from qutip.qobj import *

172 from qutip.states import *

173 from qutip.operators import *


C:\Anoconda\lib\site-packages\qutip\qobj.py in <module>

58 import qutip.settings as settings

59 from qutip import __version__

---> 60 from qutip.fastsparse import fast_csr_matrix, fast_identity

61 from qutip.cy.ptrace import _ptrace

62 from qutip.permute import _permute


C:\Anoconda\lib\site-packages\qutip\fastsparse.py in <module>

35 from scipy.sparse import (_sparsetools, isspmatrix, isspmatrix_csr,

36 csr_matrix, coo_matrix, csc_matrix, dia_matrix)

---> 37 from scipy.sparse.sputils import (upcast, upcast_char, to_native, isdense, isshape,

38 getdtype, isscalarlike, IndexMixin, get_index_dtype)

39 from scipy.sparse.base import spmatrix, isspmatrix, SparseEfficiencyWarning


ImportError: cannot import name 'IndexMixin' from 'scipy.sparse.sputils' (C:\Anoconda\lib\site-packages\scipy\sparse\sputils.py)


I knew that some code may be incomplete. But should I do in order to get the correct ones and how should I import the correct ones into C:/anaconda?


Thanks in advance!


Regards,

Sen Siang

Nathan Shammah

unread,
Feb 28, 2020, 11:22:13 PM2/28/20
to qu...@googlegroups.com
Hi Sen,

It should be the same issue addressed here:
You either need to upgrade QuTiP to >4.3.1 or downgrade Scipy to <=1.2.1. You can check the versions with 

from qutip import about
about()


Bests,

Nathan


--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/364dbbc9-9924-47bc-bb3a-32ad1465d1e6%40googlegroups.com.
--
Dr. Nathan Shammah
Postdoctoral Research Scientist
Theoretical Quantum Physics Laboratory
RIKEN, Wako, Saitama, Japan
www.nathanshammah.com

Leong Sen Siang

unread,
Feb 29, 2020, 12:51:13 AM2/29/20
to qu...@googlegroups.com
Thank you. Unfortunately, I had search about command syntax but I am unsure what to write to upgrade qutip or downgrade scipy. I know only something about conda update qutip.

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/wIxHtgEFNxM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/CAKcZDfS4bH5HHhpfhWtjeut0NQz-iRN51P39HyV--1R-R114%2BA%40mail.gmail.com.

Leong Sen Siang

unread,
Feb 29, 2020, 10:10:23 AM2/29/20
to qu...@googlegroups.com

Leong Sen Siang

unread,
Feb 29, 2020, 10:11:23 AM2/29/20
to qu...@googlegroups.com
Dear Sir,

Unfortunately, when I type conda install scipy=1.2.1, conflicts occur, prompting me to press Ctrl+C to abort.

Sidhant Saraogi

unread,
Mar 1, 2020, 8:55:18 PM3/1/20
to QuTiP: Quantum Toolbox in Python
I think it might be better to keep your scipy to the version you had before, you can find the version and do 
conda install scipy=(version number) 

and upgrade qutip to the current or any version after (>4.3.1) as mentioned by Nathan, 

You can do that by 
conda install qutip=4.4.1 (latest release) or any version of your liking. That works with the latest scipy release 1.4.1 


On Saturday, 29 February 2020 10:11:23 UTC-5, Leong Sen Siang wrote:
Dear Sir,

Unfortunately, when I type conda install scipy=1.2.1, conflicts occur, prompting me to press Ctrl+C to abort.

On Sat, Feb 29, 2020 at 11:10 PM Leong Sen Siang <leongse...@gmail.com> wrote:
On Sat, Feb 29, 2020 at 1:51 PM Leong Sen Siang <leongse...@gmail.com> wrote:
Thank you. Unfortunately, I had search about command syntax but I am unsure what to write to upgrade qutip or downgrade scipy. I know only something about conda update qutip.

To unsubscribe from this group and stop receiving emails from it, send an email to qu...@googlegroups.com.
--
Dr. Nathan Shammah
Postdoctoral Research Scientist
Theoretical Quantum Physics Laboratory
RIKEN, Wako, Saitama, Japan
www.nathanshammah.com

--
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/wIxHtgEFNxM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qu...@googlegroups.com.

Leong Sen Siang

unread,
Mar 27, 2020, 12:15:28 AM3/27/20
to qu...@googlegroups.com
>>> from qutip import *
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Leong Sen Siang\AppData\Python 36\Lib\site-packages\qutip\__init__.py", line 112, in <module>
    from ._globals import ModuleDeprecationWarning, VisibleDeprecationWarning
ModuleNotFoundError: No module named 'qutip._globals'
>>> import qutip
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Users\Leong Sen Siang\AppData\Python 36\Lib\site-packages\qutip\__init__.py", line 112, in <module>
    from ._globals import ModuleDeprecationWarning, VisibleDeprecationWarning
ModuleNotFoundError: No module named 'qutip._globals'

May I ask how to solve the problem? Did versions involved matters?

Thank you so much in advance.

To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/a05932a4-68f0-42ce-b8e6-500c90345877%40googlegroups.com.

Leong Sen Siang

unread,
Mar 27, 2020, 2:30:45 AM3/27/20
to qu...@googlegroups.com
For your information, my Python version is 3.6.4. Qutip version is 4.5.0.

To unsubscribe from this group and all its topics, send an email to qutip+unsubscribe@googlegroups.com.

Leong Sen Siang

unread,
Mar 31, 2020, 8:20:33 AM3/31/20
to qu...@googlegroups.com
Is it possible to import qutip into python without anaconda? I had did it but with error no module qutip._global.

Thanks in advance.

from 
Sen Siang

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/wIxHtgEFNxM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to qutip+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/qutip/CAKcZDfS4bH5HHhpfhWtjeut0NQz-iRN51P39HyV--1R-R114%2BA%40mail.gmail.com.
Reply all
Reply to author
Forward
0 new messages