Forum Discussion
Update Built-in libraries in new Environment
- 1 year ago
I have experienced this. It's baffling that nobody suggested this, but unfortunately this page reads like 99.9 of all requests for help with Microsoft I've ever seen. Conda packages override pypy ones. Try adding the packages needed from conda instead of pypy in the environment package area. You should see the option at the top left in the same screen that you posted the screenshot of.
Hi Anonymous,
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.
- Anonymous1 year agoNot applicable
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.- Anonymous1 year agoNot applicable
Hi Anonymous,
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 python2. 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.0Please 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.- Anonymous1 year agoNot applicable
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.