Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SyntaxError with Python 3.6 using SharePoint #829

Open
gendergap opened this issue Feb 19, 2024 · 1 comment
Open

SyntaxError with Python 3.6 using SharePoint #829

gendergap opened this issue Feb 19, 2024 · 1 comment
Labels

Comments

@gendergap
Copy link

I am trying to use this module inside an Ansible inventory script to retrieve hosts from a SharePoint list. This works well in a recent (3.11) Python version, but unfortunately I need to rely on Python 3.6 in another environment. There the script fails right away in line 1:

from office365.sharepoint.client_context import ClientContext

# [...] Authentication code like in this example: https://github.com/vgrem/Office365-REST-Python-Client/blob/master/examples/sharepoint/connect_with_client_certificate.py

The SyntaxError thrown is this:

Traceback (most recent call last):
  File "inventory-from-spo.py", line 1, in <module>
    from office365.sharepoint.client_context import ClientContext
  File "/home/me/.local/lib/python3.6/site-packages/office365/sharepoint/client_context.py", line 16, in <module>
    from office365.runtime.odata.request import ODataRequest
  File "/home/me/.local/lib/python3.6/site-packages/office365/runtime/odata/request.py", line 6, in <module>
    from office365.runtime.client_object import ClientObject
  File "/home/me/.local/lib/python3.6/site-packages/office365/runtime/client_object.py", line 1
    from __future__ import annotations
    ^
SyntaxError: future feature annotations is not defined

Is there some kind of compatibility layer one needs to activate?

@vgrem vgrem added the bug label Feb 19, 2024
@MaykJD
Copy link

MaykJD commented Apr 25, 2024

I also had this dependency error, I had to uninstall the current version and reinstall with this version that is specified as support for the python version.

https://pypi.org/project/Office365-REST-Python-Client/2.1.8/

image

image

Hope this helps (:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants