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

"Connection refused" while running the test program from the README #1446

Closed
yurivict opened this issue May 31, 2022 · 3 comments
Closed

"Connection refused" while running the test program from the README #1446

yurivict opened this issue May 31, 2022 · 3 comments
Labels
enhancement ✨ A request for a new feature.

Comments

@yurivict
Copy link

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/httpcore/_exceptions.py", line 8, in map_exceptions
    yield
  File "/usr/local/lib/python3.8/site-packages/httpcore/backends/sync.py", line 86, in connect_tcp
    sock = socket.create_connection(
  File "/usr/local/lib/python3.8/socket.py", line 808, in create_connection
    raise err
  File "/usr/local/lib/python3.8/socket.py", line 796, in create_connection
    sock.connect(sa)
ConnectionRefusedError: [Errno 61] Connection refused

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/httpx/_transports/default.py", line 60, in map_httpcore_exceptions
    yield
  File "/usr/local/lib/python3.8/site-packages/httpx/_transports/default.py", line 218, in handle_request
    resp = self._pool.handle_request(req)
  File "/usr/local/lib/python3.8/site-packages/httpcore/_sync/connection_pool.py", line 253, in handle_request
    raise exc
  File "/usr/local/lib/python3.8/site-packages/httpcore/_sync/connection_pool.py", line 237, in handle_request
    response = connection.handle_request(request)
  File "/usr/local/lib/python3.8/site-packages/httpcore/_sync/connection.py", line 86, in handle_request
    raise exc
  File "/usr/local/lib/python3.8/site-packages/httpcore/_sync/connection.py", line 63, in handle_request
    stream = self._connect(request)
  File "/usr/local/lib/python3.8/site-packages/httpcore/_sync/connection.py", line 111, in _connect
    stream = self._network_backend.connect_tcp(**kwargs)
  File "/usr/local/lib/python3.8/site-packages/httpcore/backends/sync.py", line 86, in connect_tcp
    sock = socket.create_connection(
  File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.8/site-packages/httpcore/_exceptions.py", line 12, in map_exceptions
    raise to_exc(exc)
httpcore.ConnectError: [Errno 61] Connection refused

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "x.py", line 4, in <module>
    qvm = get_qc('2q-qvm')
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_quantum_computer.py", line 820, in get_qc
    return _get_unrestricted_qvm(
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_quantum_computer.py", line 669, in _get_unrestricted_qvm
    return _get_qvm_with_topology(
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_quantum_computer.py", line 598, in _get_qvm_with_topology
    return _get_qvm_qc(
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_quantum_computer.py", line 551, in _get_qvm_qc
    qam=_get_qvm_or_pyqvm(
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_quantum_computer.py", line 517, in _get_qvm_or_pyqvm
    return QVM(noise_model=noise_model, timeout=execution_timeout, client_configuration=client_configuration)
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_qvm.py", line 116, in __init__
    self.connect()
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_qvm.py", line 120, in connect
    version = self.get_version_info()
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_qvm.py", line 175, in get_version_info
    return self._qvm_client.get_version()
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_qvm_client.py", line 176, in get_version
    return self._post_json({"type": "version"}).text.split()[0]
  File "/usr/local/lib/python3.8/site-packages/pyquil/api/_qvm_client.py", line 259, in _post_json
    response = http.post("/", json=json)
  File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 1120, in post
    return self.request(
  File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 806, in request
    return self.send(request, auth=auth, follow_redirects=follow_redirects)
  File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 893, in send
    response = self._send_handling_auth(
  File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 921, in _send_handling_auth
    response = self._send_handling_redirects(
  File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 958, in _send_handling_redirects
    response = self._send_single_request(request)
  File "/usr/local/lib/python3.8/site-packages/httpx/_client.py", line 994, in _send_single_request
    response = transport.handle_request(request)
  File "/usr/local/lib/python3.8/site-packages/httpx/_transports/default.py", line 218, in handle_request
    resp = self._pool.handle_request(req)
  File "/usr/local/lib/python3.8/contextlib.py", line 131, in __exit__
    self.gen.throw(type, value, traceback)
  File "/usr/local/lib/python3.8/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
    raise mapped_exc(message) from exc
httpx.ConnectError: [Errno 61] Connection refused

Version: 3.1.0
FreeBSD 13.1

@yurivict yurivict added the enhancement ✨ A request for a new feature. label May 31, 2022
@dbanty
Copy link
Contributor

dbanty commented Jun 1, 2022

@yurivict are you running QVM on the default port? It's easy to miss in the README, but just above the program it says:

PyQuil, along with quilc, the QVM, and other libraries, make up what is called the Forest SDK. To make full use of pyQuil, you will need to additionally have installed quilc and the QVM. For more information, check out the docs!

The easiest route is probably to use Docker

@yurivict
Copy link
Author

yurivict commented Jun 1, 2022

Hi @dbanty ,

I didn't realize that quilc and QVM are required.

They fail to compile, see quil-lang/quilc#824

Yuri

@dbanty
Copy link
Contributor

dbanty commented Jun 1, 2022

For just simulating (as in the README example) you should just need QVM, not quilc (if that one is working for you).

I'm going to go ahead and close this issue since it seems like the only remaining problem is getting those applications running—which hopefully the quil-lang team can get sorted for you.

@dbanty dbanty closed this as completed Jun 1, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement ✨ A request for a new feature.
Projects
None yet
Development

No branches or pull requests

2 participants