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

Transpiler: Invalid plugin name for simple case #8743

Closed
nonhermitian opened this issue Sep 14, 2022 · 5 comments
Closed

Transpiler: Invalid plugin name for simple case #8743

nonhermitian opened this issue Sep 14, 2022 · 5 comments
Labels
bug Something isn't working

Comments

@nonhermitian
Copy link
Contributor

Environment

  • Qiskit Terra version: master
  • Python version: 3.10
  • Operating system: osx

What is happening?

from qiskit import *
from qiskit.providers.fake_provider import FakeAthens

sim = FakeAthens()

qc = QuantumCircuit(3)
qc.h(0)
qc.cx(0,1)
qc.cx(1,2)
qc.measure_all()

trans_qc = transpile(qc, sim)

gives:

TranspilerError: 'Invalid plugin name stochastic for stage routing'

How can we reproduce the issue?

Run above

What should happen?

This is a simple case that should give no errors

Any suggestions?

No response

@alexanderivrii
Copy link
Contributor

alexanderivrii commented Sep 14, 2022

For what it's worth, a few hours ago I have checked out and installed from source a new qiskit-terra repository, and everything (including the code above) seems to run fine (but I am running python 3.10 on windows). Have you tried updating qiskit, running pip install -e ., etc.?

@mtreinish
Copy link
Member

Yeah, this is a case of your local editable install having stale package metadata. When we added new entry points for transpiler plugins (in #8305) that added required metadata to the package. If you're using an old editable/development install when you pull the latest version the code expects the package metadata which isn't installed. As @alexanderivrii suggested you can just run pip install or setup.py again and that should solve the error for you. I'm going to close this issue, but please feel free to re-open if I'm missing something or that isn't correct.

@nonhermitian
Copy link
Contributor Author

Just to be clear, I pull from main, update the rust inplace, and just work in the local dir. Is that not a valid way to work with Qiskit anymore?

@jakelishman
Copy link
Member

In this case, there were more setuptools entry points added in Python space, so it needed a Python-space re-install as well. Entry points are handled by the package metadata, and editable installs won't pick up changes to those - it's similar to the dependencies changes.

In general, yeah, just pulling changes should be sufficient if you've got an editable install. If there's Rust changes, build them in place. If there's changes to the requirements or the entry points (changes in setup.py, pyproject.toml, requirements.txt or requirements-dev.txt are all indicative that this might have happened), then it needs a Python-space re-install as well.

@nonhermitian
Copy link
Contributor Author

Ok this magically worked itself out somehow so no worries anymore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants