user3928789
user3928789

Reputation: 21

Python cannot find module in the same folder

I have spotipy installed on python3, and when I run it, it calls the __init__.py file, but then that file attempts to import from client, and it says that client can not be found, although client.py is in the same folder as __init__.py.

I'm wondering if the issue lies in the fact that I have multiple versions of python installed?

EDIT: The working directory only has the file I'm running, which as of now simply says "import spotipy". Also, I checked, and it seems like the __init__.py file is unable to import anything else in the folder.

Upvotes: 1

Views: 2090

Answers (1)

akarilimano
akarilimano

Reputation: 1074

As James said, you need to place empty file __init__.py in your folder. Then Python will think of this folder as of a package and you will be able to do your imports.

Upvotes: 1

Related Questions