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:
- Created 5 years ago
- Reactions:5
- Comments:6 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@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 justboxsdk
(which does not include the JWT auth classes and libraries)?In case anyone comes across this like I did – you need to only have
boxsdk["jwt"]
as a dependency inrequirements.txt
. It is not in addition toboxsdk
.I.e. do this:
not this