Skip to content

Tarik Billa

  • Web Development
    • html
    • vue.js
    • laravel
    • css
    • javascript
    • jquery
    • node.js
    • php
    • asp.net
  • Programming
    • python
    • java
    • c
    • c++
    • c#
  • git
  • android

attributeerror

AttributeError(“‘str’ object has no attribute ‘read'”)

October 16, 2022 by Tarik

The problem is that for json.load you should pass a file like object with a read function defined. So either you use json.load(response) or json.loads(response.read()).

Categories python Tags attributeerror, python, python-2.7, urllib2 Leave a comment

AttributeError: ‘module’ object has no attribute [duplicate]

October 7, 2022 by Tarik

You have mutual top-level imports, which is almost always a bad idea. If you really must have mutual imports in Python, the way to do it is to import them within a function: # In b.py: def cause_a_to_do_something(): import a a.do_something() Now a.py can safely do import b without causing problems. (At first glance it … Read more

Categories python Tags attributeerror, python Leave a comment

Why do I get AttributeError: ‘NoneType’ object has no attribute ‘something’?

September 21, 2022 by Tarik

NoneType means that instead of an instance of whatever Class or Object you think you’re working with, you’ve actually got None. That usually means that an assignment or function call up above failed or returned an unexpected result.

Categories python Tags attributeerror, nonetype, python Leave a comment
Newer posts
← Previous Page1 … Page3 Page4

Tarik Billa

Software Engineer
tarikbilla@gmail.com
+8801884414000
  • Reuse a hash in YAMLApril 17, 2024
  • Dockerfile: how to redirect the output of a RUN command to a variable?April 16, 2024
  • How to cd to a directory with spaces in the directory name?April 16, 2024
  • Maximum MIME type length when storing the type in a databaseApril 16, 2024
  • What is the difference between Unit, Integration, Regression and Acceptance Testing?April 16, 2024
© 2026 Tarik Billa