0

I have a project in PyCharm that its debugger began crashing after I added a few lines of code. I deleted all the code and left a simple print in the file.

The code is located in the folder: "heapq\test_heapq.py" as shown in screenshot 1.

The error I get is "ImportError: cannot import name 'heappush'" as shown in screenshot 2.

What causes this error?

The location of the code in the project tree

The ImportError stack trace

RaamEE
  • 3,017
  • 4
  • 33
  • 53

1 Answers1

1

Turns out that heapq is a Python standard library and I am guessing that it's being used by Pycharm's debugger.

The folder I created in named heapq and it collided with Python's standard library's heapq.

The solution was to rename the folder and problem solved.

RaamEE
  • 3,017
  • 4
  • 33
  • 53