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.

AttributeError: 'NoneType' object has no attribute 'from_settings_file'

See original GitHub issue
  • I have checked that the [SDK documentation][sdk-docs] and [API documentation][api-docs] doesn’t solve my issue

Description of the Issue

I am getting the error: AttributeError: 'NoneType' object has no attribute 'from_settings_file'

My complete code:

from boxsdk import JWTAuth, Client
auth = JWTAuth.from_settings_file('/home/joel/peroorkada/staticfiles/conf/box.json')
client = Client(auth)
service_account = client.user().get()
print('Service Account user ID is {0}'.format(me.id))

I’ve verified the settings file with cat. It exists. When importing the module and checking its methods:

>>> from boxsdk import JWTAuth, Client
>>> dir(JWTAuth)
['__bool__', '__class__', '__delattr__', '__dir__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__gt__', '__hash__', '__init__', '__init_subclass__', '__le__', '__lt__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__']

Versions Used

Box Python SDK: 2.0.0 Python: 3.6.7

Error Message, Including Traceback

$python3 ./testbox1.py n Traceback (most recent call last): File “./testbox1.py”, line 26, in <module> auth = JWTAuth.from_settings_file(‘/home/joel/peroorkada/staticfiles/conf/box.json’) AttributeError: ‘NoneType’ object has no attribute ‘from_settings_file’

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:5
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

11reactions
mattwillercommented, Dec 25, 2018

@droidzone The Python SDK can be installed in two flavors: one with JWT auth and one without. Could you also verify that you’ve installed boxsdk[jwt] and not just boxsdk (which does not include the JWT auth classes and libraries)?

4reactions
stephencweisscommented, Jun 15, 2020

In case anyone comes across this like I did – you need to only have boxsdk["jwt"] as a dependency in requirements.txt. It is not in addition to boxsdk.

I.e. do this:

# requirements.txt
boxsdk["jwt"]
...

not this

# requirements.txt
boxsdk
boxsdk["jwt"]
...
Read more comments on GitHub >

github_iconTop Results From Across the Web

'NoneType' object has no attribute 'from_settings_file' (boxsdk ...
I confess that I overlooked a part of the documentation for boxsdk, which mentions that JWTAuth for boxsdk requires that boxsdk be installed ......
Read more >
Attribute error:'NoneType' object has no attribute
spatialReference.Name >>> print dsc. i'm getting following error at line 5. Attributeerror:'NoneType' object has no attribute Name.
Read more >
AttributeError: 'NoneType' object has no attribute 'version_tuple
On CS9 pipeline, Container Build and Image build jobs are failing with following errors: ``` TASK [oooci-build-images : Create temp venv w/ ...
Read more >
NoneType' object has no attribute 'from_settings_file' (boxsdk ...
AttributeError : 'NoneType' object has no attribute 'from_settings_file' File "django/core/handlers/exception.py", line 34, in inner response ...
Read more >
How to fix PyCharm AttributeError: 'NoneType' object has no ...
... entry = _cache.get(encoding, _unknown) AttributeError: 'NoneType' object has no attribute 'get' Process finished with exit code 1 ...
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