Python Libraries Install

Rohit Kulkarni 731 Reputation points
2022-09-09T14:45:30.843+00:00

Hello Team,

While writing a code in python in data bricks to access the SharePoint. I have installed the two libraries :

pip install Office365-REST-Python-Client

pip install sharepy

But when the notebook restart the cluster then it will give error saying Office365,sharepy in not present. I need to re-install again the libraries each time.

My queries is why i need to install every time whenever the cluster will start. Please advise me.

Regards
RK

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,514 questions
{count} votes

1 answer

Sort by: Most helpful
  1. HimanshuSinha-msft 19,486 Reputation points Microsoft Employee Moderator
    2022-09-12T21:19:29.58+00:00

    Hello @Rohit Kulkarni ,
    Thanks for the question and using MS Q&A platform.
    As we understand the ask here is how to install libraries on the cluster , please do let us know if its not accurate.
    I did tried out the using the global init scripts and it did worked for me .

    240261-image.png

    240271-image.png

    pip install Office365-REST-Python-Client
    pip install sharepy

    240252-image.png

    To chedk if the package has inatlled or not , please use tyhe code snippet . It does not show under the library tab .

    %python
    import pkg_resources
    for d in pkg_resources.working_set:
    print(d)

    240229-image.png

    Please do let me if you have any queries.
    Thanks
    Himanshu


    • Please don't forget to click on 130616-image.png or upvote 130671-image.png button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how
    • Want a reminder to come back and check responses? Here is how to subscribe to a notification
      • If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.