shareplum icon indicating copy to clipboard operation
shareplum copied to clipboard

syntaxError while import

Open likhithn opened this issue 4 years ago • 9 comments

While making an old code compatible for python3 I got the error below Traceback (most recent call last): File "/home/lmycode.py", line 33, in from shareplum import Site File ""/home/.local/lib/python3.5/site-packages/shareplum/init.py", line 6, in from .site import Site # noqa: F401 File "/home/.local/lib/python3.5/site-packages/shareplum/site.py", line 12, in from .list import _List2007, _List365 File "/home/.local/lib/python3.5/site-packages/shareplum/list.py", line 547 url = self.site_url + f"/_api/lists/getbytitle('{self.list_name}')/RenderListDataAsStream" ^ SyntaxError: invalid syntax

What could be the reason for the failure?

likhithn avatar Apr 02 '20 08:04 likhithn

Same issue here.

wannli avatar Apr 02 '20 18:04 wannli

What is your import statement and what python version are you using?

jasonrollins avatar Apr 06 '20 22:04 jasonrollins

from shareplum import Site Was using python2 but since it's deprecating, needed it to be compatible with python 3 as well

likhithn avatar Apr 06 '20 23:04 likhithn

I'm not sure why you are seeing this problem. Can you assure you have the latest version?

jasonrollins avatar Apr 11 '20 18:04 jasonrollins

I am using Python v3.5 but the code worked fine in v2.7

likhithn avatar Apr 14 '20 09:04 likhithn

If you pip install shareplum --upgrade, do you still see the issue?

jasonrollins avatar Apr 14 '20 23:04 jasonrollins

Same issue here with Python v3.5 !!

losistefano avatar May 06 '20 09:05 losistefano

It exits even after $ pip3 install shareplum --upgrade but the error message seem a bit different now File "/home/likhithn/.local/lib/python3.5/site-packages/shareplum/errors.py", line 4 super().init(f"{msg} : {details}") ^ SyntaxError: invalid syntax

likhithn avatar Sep 02 '20 13:09 likhithn

Shareplum requires Python 3.6+, it does not support Python 3.5.

Python 3.5 is in end-of-life, it will not receive ANY updates starting next month, not even for security issues. Do not use Python 3.5 anymore. Update and you can enjoy shareplum.

SpiritQuaddicted avatar Sep 02 '20 20:09 SpiritQuaddicted