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

WinError 32 during using qiskit.visualization.pass_manager_visualization #12634

Open
BStar14 opened this issue Jun 21, 2024 · 2 comments · May be fixed by #12635
Open

WinError 32 during using qiskit.visualization.pass_manager_visualization #12634

BStar14 opened this issue Jun 21, 2024 · 2 comments · May be fixed by #12635
Labels
bug Something isn't working

Comments

@BStar14
Copy link

BStar14 commented Jun 21, 2024

Environment

  • Qiskit version: 1.1.1
  • Python version: 3.12.3
  • Operating system: Windows 11

What is happening?

When you try to draw the Graphviz diagram with pass_manager_visualization, You get a PermissionError: [WinError 32] The process cannot access the file because it is being used by another process during running os.remove(tmppath).

How can we reproduce the issue?

from qiskit_ibm_runtime.fake_provider import FakeKyiv
from qiskit.transpiler.preset_passmanagers import generate_preset_pass_manager

pm = generate_preset_pass_manager(optimization_level=2, backend=FakeKyiv())
pm.draw()

What should happen?

Draw the Graphviz diagram

Any suggestions?

Kind of deep copying the image would work.

with Image.open(tmppath) as image_:
    image = image_.copy()
os.remove(tmppath)
@BStar14 BStar14 added the bug Something isn't working label Jun 21, 2024
@HuangJunye
Copy link
Collaborator

This is similar to #6005

@HuangJunye HuangJunye linked a pull request Jun 21, 2024 that will close this issue
@skwodnjs
Copy link

I can reproduce the issue.

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

Successfully merging a pull request may close this issue.

3 participants