swar / nba_api

An API Client package to access the APIs for NBA.com
MIT License
2.34k stars 515 forks source link

A general question. #404

Open bubbsJanko opened 7 months ago

bubbsJanko commented 7 months ago

I am sorry to be a bother but I use your project and it is very good so I figure you may be able to help me. It has to do with importing. For example, in this file https://github.com/swar/nba_api/blob/master/tests/unit/test_static_data.py you do from nba_api.stats.static import teams

I have a program with the same file structure as you. When I run from packageName.module import whatever I get module not found error. The thing is, when I build the same program in pycharm the import works perfectly, but in vscode it does not.

Let's say I have the following directory structure: parent_dir/ foo_dir/ foo.py bar_dir/ bar.py

I wanted to import bar.py from within foo.py, in pycharm I can with from parent_dir.bar_dir import bar but in vscode throws error. Same python installed I do not know what the problem can be something with my vscode configuration. If you can help me thanks.

bubbsJanko commented 7 months ago

Does it have to do with someone you do with the python path?

owqejfb commented 7 months ago

you say it works in pycharm but not vscode? are they both in the same directory when you open them? could also be something with your python path.