Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Fabric Notebook error: pip magic command is disabled.: pip install semantic-link

Running a notebook in Fabric works fine when it is executed interactivly. It fails when the notebook is scheduled or a pipeline is created to execute the notebook. 
I believe it fails when scheduled on the first of two lines below:
 
%pip install semantic-link
%load_ext sempy

 

Here is the error

Notebook execution failed at Notebook service with http status code - '200', please check the Run logs on Notebook, additional details - 'Error name - MagicUsageError, Error value - %pip magic command is disabled.' :

 

Any Thoughts?

Status: Delivered

Hi @PJChip ,

 

Glad you‘ve solved it and thank you for sharing, for other users with similar experiences you can check the comments below. This thread will now be closed.

 

Best regards.
Community Support Team_ Caitlyn

Comments
v-xiaoyan-msft
Community Support
Status changed to: Investigating

Hi @PJChip ,

 

Based on your error message,please ensure that your execution environment is set up to install dependencies from this file during the setup phase of the notebook execution. instead of using `%pip` to install packages, create a `requirements.txt` file with all the necessary packages listed.  

 

You may also consider to ensure that the execution environment where the notebook is scheduled to run has the same configuration as the interactive environment where `%pip` works.

 

Best regards.
Community Support Team_Caitlyn

PJChip
Frequent Visitor

Solved! Great idea on the environment:

  1. I created an environment and set it as the workspace default. It includes the semantic-link library
  2. Remove the pip line that installs the semantic link library.

PJChip_1-1704908407350.png

 

PJChip_0-1704908358328.png

 

v-xiaoyan-msft
Community Support
Status changed to: Delivered

Hi @PJChip ,

 

Glad you‘ve solved it and thank you for sharing, for other users with similar experiences you can check the comments below. This thread will now be closed.

 

Best regards.
Community Support Team_ Caitlyn

kobia10
Microsoft Employee

Hi @v-xiaoyan-msft ,

 

Relating to the approach above using requirements file, can you please elaborate more on how this can be used?

Using env. is quite heavy....

 

Kobi