Forum Discussion

cw88's avatar
cw88
Helper IV
1 year ago
Solved

Python notebook: Use public libraries

I am testing the Python Notebook (preview) Announcing Python Notebook in Preview | Microsoft Fabric Blog | Microsoft Fabric 

and want to use the public library snowflake-connector-python . 

The only way i have found to use the library is "%pip install snowflake-connector-python", but it installs the library on every execution. Is there a better way without instaling on every execution?
Thanks!
  • Anonymous's avatar
    Anonymous
    1 year ago

    Hi cw88 

     

    This might be a current limitation on python notebook by public preview. When switching the notebook to Python notebook, it doesn't provide an option for choosing a custom environment which allows installing additional libraries in advance. So you can only use %pip and %conda commands for inline installations as of now. 

    Use Python experience on Notebook - Microsoft Fabric | Microsoft Learn

     

    As this is just in preview stage, it is likely to be improved in the future. Please provide your valuable feedback and suggestions at https://ideas.fabric.microsoft.com/ to let the product team hear it. 

     

    Best Regards,
    Jing
    If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

2 Replies

  • Yes, we could try doing it this way instead...  you can create a new environment.
    To do this, go to your workspace and, in the "Create" section, look for the option to create a new environment.
    There, you can install public libraries, along with many other configurations, so you don’t have to work with your default setup.

     


    Later, when you are in your notebook, that environment will appear as an option for you to select and execute within, instead of using the default one.

     

    You can find more information here:
    Create and Use an Environment

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi cw88 

     

    This might be a current limitation on python notebook by public preview. When switching the notebook to Python notebook, it doesn't provide an option for choosing a custom environment which allows installing additional libraries in advance. So you can only use %pip and %conda commands for inline installations as of now. 

    Use Python experience on Notebook - Microsoft Fabric | Microsoft Learn

     

    As this is just in preview stage, it is likely to be improved in the future. Please provide your valuable feedback and suggestions at https://ideas.fabric.microsoft.com/ to let the product team hear it. 

     

    Best Regards,
    Jing
    If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!