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

dependency packages error? #7

Open
SurferZergy opened this issue Jun 21, 2022 · 0 comments
Open

dependency packages error? #7

SurferZergy opened this issue Jun 21, 2022 · 0 comments

Comments

@SurferZergy
Copy link

Hi, I was running through you example QAOA.ipynb, and ran into error:
module 'pyquil.api' has no attribute 'QVMConnection'
so I downgraded pyquil to 2.1.1 as you mentioned. And then got the stack trace below.
Was wondering if there is a specific python version and forest SDK version i need to run?
(I also had issues getting forest to install, so i just ran the docker (https://docs.rigetti.com/qcs/getting-started/forest-docker-image))
using this command: docker run --rm -it rigetti/forest

`---------------------------------------------------------------------------
Exception Traceback (most recent call last)
in
1 import numpy as np
----> 2 from grove.pyqaoa.maxcut_qaoa import maxcut_qaoa
3 import pyquil.api as api
4 qvm_connection = api.QVMConnection()

~/miniconda3/lib/python3.9/site-packages/grove/pyqaoa/maxcut_qaoa.py in
19 """
20 import numpy as np
---> 21 import pyquil.api as api
22 from pyquil.paulis import PauliTerm, PauliSum
23 import networkx as nx

~/miniconda3/lib/python3.9/site-packages/pyquil/init.py in
1 version = "2.2.1"
2
----> 3 from pyquil.quil import Program
4 from pyquil.api import list_quantum_computers, get_qc

~/miniconda3/lib/python3.9/site-packages/pyquil/quil.py in
29 from typing import List, Dict
30
---> 31 from pyquil._parser.PyQuilListener import run_parser
32 from pyquil.noise import _check_kraus_ops, _create_kraus_pragmas, pauli_kraus_map
33 from pyquil.parameters import format_parameter

~/miniconda3/lib/python3.9/site-packages/pyquil/_parser/PyQuilListener.py in
43 RawInstr, Qubit, Pragma, Declare, AbstractInstruction,
44 ClassicalTrue, ClassicalFalse, ClassicalOr, ResetQubit)
---> 45 from .gen3.QuilLexer import QuilLexer
46 from .gen3.QuilListener import QuilListener
47 from .gen3.QuilParser import QuilParser

~/miniconda3/lib/python3.9/site-packages/pyquil/_parser/gen3/QuilLexer.py in
222
223
--> 224 class QuilLexer(Lexer):
225
226 atn = ATNDeserializer().deserialize(serializedATN())

~/miniconda3/lib/python3.9/site-packages/pyquil/_parser/gen3/QuilLexer.py in QuilLexer()
224 class QuilLexer(Lexer):
225
--> 226 atn = ATNDeserializer().deserialize(serializedATN())
227
228 decisionsToDFA = [ DFA(ds, i) for i, ds in enumerate(atn.decisionToState) ]

~/miniconda3/lib/python3.9/site-packages/antlr4/atn/ATNDeserializer.py in deserialize(self, data)
26 self.data = data
27 self.pos = 0
---> 28 self.checkVersion()
29 atn = self.readATN()
30 self.readStates(atn)

~/miniconda3/lib/python3.9/site-packages/antlr4/atn/ATNDeserializer.py in checkVersion(self)
48 version = self.readInt()
49 if version != SERIALIZED_VERSION:
---> 50 raise Exception("Could not deserialize ATN with version " + str(version) + " (expected " + str(SERIALIZED_VERSION) + ").")
51
52 def readATN(self):

Exception: Could not deserialize ATN with version � (expected 4).`

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