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

Error importing QNET package #95

Open
Leo-am opened this issue Sep 25, 2021 · 0 comments
Open

Error importing QNET package #95

Leo-am opened this issue Sep 25, 2021 · 0 comments

Comments

@Leo-am
Copy link

Leo-am commented Sep 25, 2021

  • QNET version: 2.0.0
  • Python version: 3.6
  • Operating System: MacOS Catalina 10.15.7

Description

Describe what you were trying to get done.
Tell us what happened, what went wrong, and what you expected to happen.

What I Did

Installed QNET package from source using:

pip install git+https://github.com/mabuchilab/qnet.git@develop#egg=qnet

Then, I tried to simply import the package using:

import qnet

Which produced the following error:

Traceback (most recent call last):

File "<stdin>", line 1, in <module>

File "/Users/leo/miniconda3/envs/test_for_clock/lib/python3.6/site-packages/qnet/__init__.py", line 14, in <module>

import qnet.algebra._rules

File "/Users/leo/miniconda3/envs/test_for_clock/lib/python3.6/site-packages/qnet/algebra/_rules.py", line 3, in <module>

from .core.circuit_algebra import (

File "/Users/leo/miniconda3/envs/test_for_clock/lib/python3.6/site-packages/qnet/algebra/core/circuit_algebra.py", line 19, in <module>

from .algebraic_properties import (

File "/Users/leo/miniconda3/envs/test_for_clock/lib/python3.6/site-packages/qnet/algebra/core/algebraic_properties.py", line 13, in <module>

from ...utils.indices import IdxSym

File "/Users/leo/miniconda3/envs/test_for_clock/lib/python3.6/site-packages/qnet/utils/indices.py", line 431, in <module>

class IndexOverList(IndexRangeBase):

File "/Users/leo/miniconda3/envs/test_for_clock/lib/python3.6/site-packages/qnet/utils/indices.py", line 438, in IndexOverList

values = attr.ib(convert=tuple)

TypeError: attrib() got an unexpected keyword argument 'convert'

The error is generated, from what I understood, due to a change of attributes in pytest from 'convert' to 'converter'.
I was able to make the QNET package to work by changing the file at: /Users/leo/miniconda3/envs/test_for_clock/lib/python3.6/site-packages/qnet/utils/indices.py in line 438, where I changed:

    values = attr.ib(convert=tuple)

to

    values = attr.ib(converter=tuple)

The QNET package now works perfectly. (pytest version 6.2.5, and attrs version 21.2.0)

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

1 participant