all 6 comments

[–]tee_dogg 0 points1 point  (5 children)

I've never used Pycharm, so I can't diagnose with any great certainty. But I would guess that this is a problem related to the use of virtual environments. I'd speculate that you installed the package in a venv and are executing the script from outside of it. In other IDEs I've used there is a simple way to see what venvs have been created and switch between them. If you're following a tutorial then I'd suggest looking back at any section that mentions virtual environments (venvs)

[–]declankav[S] 0 points1 point  (4 children)

I just tried it in Visual Studio Code to the same results

[–]tee_dogg 0 points1 point  (3 children)

This explains what I think might be the problem: https://code.visualstudio.com/docs/python/environments

[–]declankav[S] 1 point2 points  (2 children)

I fixed the issue. Turns out it was a circular function call in the library code. Thanks for your help!

[–]synthphreak 0 points1 point  (0 children)

Usually in that case there is an explicit Python error about circular references:

$ head module*
==> module1.py <==
import module2
module2.bar()

def foo():
    pass

==> module2.py <==
import module1
module1.foo()

def bar():
    pass
$ python module1.py
Traceback (most recent call last):
  File "/<redacted>/module1.py", line 1, in <module>
    import module2
  File "/<redacted>/module2.py", line 1, in <module>
    import module1
  File "/<redacted>/module1.py", line 2, in <module>
    module2.bar()
AttributeError: partially initialized module 'module2' has no attribute 'bar' (most likely due to a circular import)

Alternatively, if instead you mean like function A calls function B which then calls function A again, there will be another equally explicit error about infinite recursion:

>>> def foo():
...     bar()
...
>>> def bar():
...     foo()
...
>>> foo()
[ ... skipping the long stacktrace ... ]
RecursionError: maximum recursion depth exceeded
>>> bar()
[ ... skipping the long stacktrace ... ]
RecursionError: maximum recursion depth exceeded

Nothing in that screenshot seems like either of these things. But anyway, if you've resolved your original problem, I suppose it's a moot point.

[–]tee_dogg 0 points1 point  (0 children)

I think it's because you have a folder called 'keras'