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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
MikkelFeddersen
Frequent Visitor

Update Built-in libraries in new Environment

Hi everyone,

I am working in notebooks in Fabric, and I want to update a built-in library to a newer version, by creating a new environment and installing the newer version through PyPI.

However, when I start a session with the new notebook, it still uses the same version as in the public library (transformers 4.37.2 instead of 4.49.0).

I have also tried installing it through %pip and !pip install. This works in the current session but does not install when I create a new version. I have been given admin rights, but that does not help either. Has anyone experienced this?

 

17 REPLIES 17
Pradeep_O_S
Frequent Visitor

Unfortunately, there is currently no way to override the runtime packages in Fabric. Only session-level libraries can be modified using %pip and !pip install.

So the Library Management only work for packages that are not in built-in?

It seems so. I encountered the same issue you did. Installing a newer version at the environment level doesn’t appear to have any effect. My hypothesis is that Microsoft is intentionally restricting this to avoid potential dependency conflicts with the standard packages bundled in the environment.

v-pbandela-msft
Community Support
Community Support

Hi @MikkelFeddersen,

I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please "Accept  as  Solution" and give a 'Kudos' so other members can easily find it.

Thank you,
Pavan.

v-pbandela-msft
Community Support
Community Support

Hi @MikkelFeddersen,

Thank you for reaching out in Microsoft Community Forum.

Thank you @nilendraFabric  for the helpful response.


The reason you’re seeing the older library version after restarting the session is because Fabric notebooks use session-based environments, which do not persist custom library installations across sessions.

Please follow below steps to resolve the error;

1. please make sure the updated version is available, run the following at the start of your notebook:
%pip install transformers==4.49.0

2.Create a new environment with the updated library version by specifying the following in requirements.txt:
transformers==4.49.0

3.If you’re still seeing the older version, clear the session cache by restarting the kernel or using:
!pip cache purge

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

Hi,

I have followed step number 2 the entire time, but whenever I choose the new environment, I still get the old package versions. The command !pip cache purge does not resolve the issue. Best regards.

MikkelFeddersen_0-1742299099819.png

MikkelFeddersen_1-1742299406741.png

 



Hi @MikkelFeddersen,

Thank you for reaching out in Microsoft Community Forum.

Please follow below steps to resolve the error;

1. Run the following command to confirm the notebook is using the correct environment, If it still points to the base environment, reattach the new environment.
!which python

2. Close the notebook completely > Reopen it, go to Kernel > Change Environment, select the new environment, and restart the notebook.

3.Check if the correct version is loaded by running:
import transformers
print(transformers.__version__)

If the version is still incorrect, force reinstall it:
!pip install --force-reinstall transformers==4.49.0

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

Hi,


When I run the command `!which python` in my own environment, I consistently get the following output:
`/home/trusted-service-user/cluster-env/trident_env/bin/python`
This happens regardless of whether I use my own environment or the default one. I have reattached my own environment multiple times, closed the notebook, restarted the session, etc., but with no changes. It seems I am unable to attach my own environment to the notebook. I have also tried to recreate the environment, but I encountered the same result.

Hi @MikkelFeddersen,

Thank you for the detailed update. Please follow below steps to resolve the error;

1.Even if you created the environment, it won’t be applied unless you publish it.
Go to Fabric > Environments → Verify your environment is "Published" (not just "Saved").

2.Manually Attach the Environment, Please run the below command
!source /home/trusted-service-user/cluster-env/<your_env_name>/bin/activate

3.Force Reinstall the Library and Verify:
For installation; %pip install --force-reinstall transformers==4.49.0

For Verification;
import transformers
print(transformers.__version__)

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

Hi,

The packages are all published:

MikkelFeddersen_0-1742379227026.png


But I still cant connect to the environment:

MikkelFeddersen_1-1742379271112.png

 

 

Hi @MikkelFeddersen,

Thank you for the update and sharing the screenshots.

1. Please check the fabric permissions
Go to Admin Portal > Tenant Settings > Environments → Ensure you have "Create and Manage Environments" permissions.

2.Manually Set Environment in Notebook Metadata
Go to Notebook Settings > Advanced > Metadata → Add

{
"kernel": {
"name": "python3",
"environment": "<your_env_name>"
}
}

3.Create a new notebook, select your environment, and verify with below code
!which python

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

 

Hi,

We do not see Environments in Tenant Settings, or Advanced in Notebook Settings:

MikkelFeddersen_0-1742389395748.png

MikkelFeddersen_1-1742389419699.png

 

 



Hi @MikkelFeddersen,

Thank you for reaching out in Microsoft Community Forum.

please follow below steps to resolve the issue;

1. Since you can't see Environments in Tenant Settings, it indicates you lack admin privileges. Ask your Fabric Admin to grant you access to "Create and Manage Environments" in Tenant Settings.

2. Make sure you are using a Premium workspace with Fabric capacity enabled.

3. Manually activate the environment in the current session using:
!source /home/trusted-service-user/cluster-env/<your_env_name>/bin/activate
!pip install --force-reinstall transformers==4.49.0

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

Hi,

1. The pictures I sent in my previous reply are from our admin user, so the admins cannot see the settings you mentioned.
2. I do have a Fabric capacity.

Best regards

Hi @MikkelFeddersen,

Thank you for reaching out in Microsoft Community Forum.

Please go through the above mentioned steps and check step by step again ,if still faces the same issue then please consider raising a support ticket for further assistance.

To raise a support ticket for Fabric and Power BI, kindly follow the steps outlined in the following guide:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticket

Please continue using Microsoft community forum.

If you found this post helpful, please consider marking it as "Accept as Solution" and give it a 'Kudos'. if it was helpful. help other members find it more easily.

Regards,
Pavan.

MikkelFeddersen
Frequent Visitor

Hi,

I have done both, but unfortunately, that it is not the issue.

nilendraFabric
Community Champion
Community Champion

Hello @MikkelFeddersen 

Few things to check :

1) Please make sure in new env , publish of library is successful (Not just saved)

2) selectthe environment from the Environment dropdown in your notebook

 

Helpful resources

Announcements
MarchFBCvideo - carousel

Fabric Monthly Update - March 2025

Check out the March 2025 Fabric update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.

"); $(".slidesjs-pagination" ).prependTo(".pagination_sec"); $(".slidesjs-pagination" ).append("
"); $(".slidesjs-play.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-stop.slidesjs-navigation").appendTo(".playpause_sec"); $(".slidesjs-pagination" ).append(""); $(".slidesjs-pagination" ).append(""); } catch(e){ } /* End: This code is added by iTalent as part of iTrack COMPL-455 */ $(".slidesjs-previous.slidesjs-navigation").attr('tabindex', '0'); $(".slidesjs-next.slidesjs-navigation").attr('tabindex', '0'); /* start: This code is added by iTalent as part of iTrack 1859082 */ $('.slidesjs-play.slidesjs-navigation').attr('id','playtitle'); $('.slidesjs-stop.slidesjs-navigation').attr('id','stoptitle'); $('.slidesjs-play.slidesjs-navigation').attr('role','tab'); $('.slidesjs-stop.slidesjs-navigation').attr('role','tab'); $('.slidesjs-play.slidesjs-navigation').attr('aria-describedby','tip1'); $('.slidesjs-stop.slidesjs-navigation').attr('aria-describedby','tip2'); /* End: This code is added by iTalent as part of iTrack 1859082 */ }); $(document).ready(function() { if($("#slides .item").length < 2 ) { /* Fixing Single Slide click issue (commented following code)*/ // $(".item").css("left","0px"); $(".item.slidesjs-slide").attr('style', 'left:0px !important'); $(".slidesjs-stop.slidesjs-navigation").trigger('click'); $(".slidesjs-previous").css("display", "none"); $(".slidesjs-next").css("display", "none"); } var items_length = $(".item.slidesjs-slide").length; $(".slidesjs-pagination-item > button").attr("aria-setsize",items_length); $(".slidesjs-next, .slidesjs-pagination-item button").attr("tabindex","-1"); $(".slidesjs-pagination-item button").attr("role", "tab"); $(".slidesjs-previous").attr("tabindex","-1"); $(".slidesjs-next").attr("aria-hidden","true"); $(".slidesjs-previous").attr("aria-hidden","true"); $(".slidesjs-next").attr("aria-label","Next"); $(".slidesjs-previous").attr("aria-label","Previous"); //$(".slidesjs-stop.slidesjs-navigation").attr("role","button"); //$(".slidesjs-play.slidesjs-navigation").attr("role","button"); $(".slidesjs-pagination").attr("role","tablist").attr("aria-busy","true"); $("li.slidesjs-pagination-item").attr("role","list"); $(".item.slidesjs-slide").attr("tabindex","-1"); $(".item.slidesjs-slide").attr("aria-label","item"); /*$(".slidesjs-stop.slidesjs-navigation").on('click', function() { var itemNumber = parseInt($('.slidesjs-pagination-item > a.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); });*/ $(".slidesjs-stop.slidesjs-navigation, .slidesjs-pagination-item > button").on('click keydown', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); var itemNumber = parseInt($('.slidesjs-pagination-item > button.active').attr('data-slidesjs-item')); $($('.item.slidesjs-slide')[itemNumber]).find('.c-call-to-action').attr('tabindex', '0'); }); $(".slidesjs-play.slidesjs-navigation").on('click', function() { $.each($('.item.slidesjs-slide'),function(i,el){ $(el).find('.c-call-to-action').attr('tabindex', '-1'); }); }); $(".slidesjs-pagination-item button").keyup(function(e){ var keyCode = e.keyCode || e.which; if (keyCode == 9) { e.preventDefault(); $(".slidesjs-stop.slidesjs-navigation").trigger('click').blur(); $("button.active").focus(); } }); $(".slidesjs-play").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-stop").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-play")) { $(".slidesjs-stop").focus(); } } }); $(".slidesjs-stop").on("click",function (event) { if (event.handleObj.type === "click") { $(".slidesjs-play").focus(); } else if(event.handleObj.type === "keydown"){ if (event.which === 13 && $(event.target).hasClass("slidesjs-stop")) { $(".slidesjs-play").focus(); } } }); $(".slidesjs-pagination-item").keydown(function(e){ switch (e.which){ case 37: //left arrow key $(".slidesjs-previous.slidesjs-navigation").trigger('click'); e.preventDefault(); break; case 39: //right arrow key $(".slidesjs-next.slidesjs-navigation").trigger('click'); e.preventDefault(); break; default: return; } $(".slidesjs-pagination-item button.active").focus(); }); }); // Start This code is added by iTalent as part of iTrack 1859082 $(document).ready(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); $("#tip2").attr("aria-hidden","true").addClass("hidden"); $(".slidesjs-stop.slidesjs-navigation, .slidesjs-play.slidesjs-navigation").attr('title', ''); $("a#playtitle").focus(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").mouseover(function(){ $("#tip1").attr("aria-hidden","false").removeClass("hidden"); }); $("a#playtitle").blur(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#playtitle").mouseleave(function(){ $("#tip1").attr("aria-hidden","true").addClass("hidden"); }); $("a#play").keydown(function(ev){ if (ev.which ==27) { $("#tip1").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); $("a#stoptitle").focus(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").mouseover(function(){ $("#tip2").attr("aria-hidden","false").removeClass("hidden"); }); $("a#stoptitle").blur(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").mouseleave(function(){ $("#tip2").attr("aria-hidden","true").addClass("hidden"); }); $("a#stoptitle").keydown(function(ev){ if (ev.which ==27) { $("#tip2").attr("aria-hidden","true").addClass("hidden"); ev.preventDefault(); return false; } }); }); // End This code is added by iTalent as part of iTrack 1859082
Top Solution Authors
Top Kudoed Authors