question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python Attribute Error: 'module' object has no attribute 'connect'

See original GitHub issue

Configured the .ini file and attempted to run the python script in the installation guide. When entering code in line by line instead of executing the script I can get through the nfldb.connect() line with no error but nothing is printed.


Traceback (most recent call last):
  File "nfldb.py", line 2, in <module>
    import nfldb
  File "C:\Users\xx\nfldb.py", line 4, in <module>
    db = nfldb.connect()
AttributeError: 'module' object has no attribute 'connect'

Issue Analytics

  • State:closed
  • Created 9 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
BurntSushicommented, Dec 27, 2014

Could you please include the full code that you’re using?

Judging by the error message, it looks like you’ve named your script nfldb.py and then tried to run that script. The import nfldb line will then import your script instead of the actual nfldb library. Try changing the file name of your program.

0reactions
joaoeloycommented, Apr 5, 2020

such “basic” error that is actually really hard to comprehend where its comming from… until u do. the amout of time i went on circles to fix this - Andrew Gallant BurntSushi@ your wisdom will last for centuries! thanks

Read more comments on GitHub >

github_iconTop Results From Across the Web

Python AttributeError: 'module' object has no attribute 'connect'
The error message shows you've named a file sqlite3.py : /home/michael/ownCloud/sqlite3.py". which masks the standard module of the same ...
Read more >
AttributeError: 'module' object has no attribute 'Connection' #13
I have run python setup.py install without errors, and then python server.py got me this: $ python server.py Traceback (most recent call last):...
Read more >
AttributeError: 'module' object has no attribute 'main'
Module object has no attribute error : Python. An attribute in Python means some property that is associated with a particular type of...
Read more >
AttributeError: 'module' object has no attribute 'Connection'
I'm starting a new project with pyramid and mongodb. When I run the command: development.ini pserve shows the following error:.
Read more >
AttributeError: module 'X' has no attribute 'Y' in Python
To solve the Python "AttributeError: module has no attribute", make sure you haven't named your local modules with names of remote modules, ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found