X Tutup
The Wayback Machine - https://web.archive.org/web/20250617001642/https://github.com/python/cpython/issues/92622
Skip to content

Importing packages from Torchvision in IDLE makes matplotlib plots not show up #92622

Closed as not planned
@ylevental

Description

@ylevental

Bug report

Again, this does not happen when I run the program from the command line, just in IDLE. If you remove the import lines that include torchvision, then the plot shows up. Otherwise, the plot is not visible.

from torchvision import datasets
from torchvision.transforms import ToTensor
from matplotlib import pyplot as plt

import numpy as np

img = np.array([[1,2,3,4,5],[6,7,8,9,10],[6,7,8,9,10],[6,7,8,9,10],[6,7,8,9,10]])

plt.imshow(img, cmap="gray")
plt.show()

Your environment

  • CPython versions tested on: 3.9.12
  • Operating system and architecture: Fedora 34

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      X Tutup