0

Trying to use SharePlum, but getting this error when importing :-

>>> from shareplum import Office365
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/myac/.local/lib/python2.7/site-packages/shareplum/__init__.py", line 5, in <module>
    from .office365 import Office365  # noqa: F401
  File "/home/myac/.local/lib/python2.7/site-packages/shareplum/office365.py", line 6, in <module>
    from .request_helper import post
  File "/home/myac/.local/lib/python2.7/site-packages/shareplum/request_helper.py", line 2, in <module>
    from .errors import ShareplumRequestError
  File "/home/myac/.local/lib/python2.7/site-packages/shareplum/errors.py", line 4
    super().__init__(f"{msg} : {details}")

I've installed shareplum, requests, requests-ntlm, requests-toolbelt, and lxml but I keep getting this error.

Any clues?

crissal
  • 2,547
  • 7
  • 25
Simon
  • 97
  • 3
  • 13
  • Can you please show how did you installed shareplum and friends ? From the initiate looks it seems like a mismatch between Py2 and Py3. – DhakkanCoder Feb 02 '21 at 11:13
  • Ah, you might be onto something here. I have Python2.7 and Python3.5 on my machine. I have tried to install shareplum for both versions, so I've done pip install shareplum and also pip3 install shareplum – Simon Feb 02 '21 at 11:24
  • ...and I've also broken pip3 in the process somehow! Now I get an error when running pip3 --version. I think I tried to update pip3 and got myself into a bit of a muddle. – Simon Feb 02 '21 at 11:26
  • ... ok, so I've resolved my pip issue (upgraded pip to a version which did not support python 3.5x so I downgraded it to v20.3.4 which does. But I still have the shareplum problem. :o( – Simon Feb 03 '21 at 15:42
  • Can you please enlist the following for me for both, Python3 and Python2: `pip freeze | grep -i SharePlum` and `python -V` or (`python2 -V`/`python3 -V`) depending on how you're using it. – DhakkanCoder Feb 04 '21 at 08:36
  • SharePlum==0.5.1 python -V Python 2.7.12 – Simon Feb 11 '21 at 18:08
  • python3 -V Python 3.7.9 – Simon Feb 11 '21 at 18:08

1 Answers1

1

The Shareplum version that you've installed has been configured on your python 2.7 interpreter(this is your default python version), though the version is 0.5.1, which is not supported on Python2.7: https://pypi.org/project/SharePlum/0.5.1/

Either you downgrade you Shareplum version to the one which is compatible with python2.7 i.e. https://pypi.org/project/SharePlum/0.3.0/

pip install shareplum==0.3.0

or

Make use of Python3 and install latest shareplum for that :

pip3 install shareplum

And when running terminal or the script, please make use of python3 binary instead of python

DhakkanCoder
  • 794
  • 3
  • 15