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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Nikhil234
Frequent Visitor

import httpx errors in notebook

i need to use the httpx package but it fails in fabric. is there i can update the python envriment to include this package. 

 

Nikhil234_0-1723536299256.png

 

Thanks

1 ACCEPTED SOLUTION
Hofpower
Frequent Visitor

Hi @Nikhil234 

 

Have you considered using environments? See https://learn.microsoft.com/en-us/fabric/data-engineering/create-and-use-environment

 

You can add the required library in your environment and then attach the environment either on workspace- or notebook-level to be used in your code. Using this environment should then enable importing the library in the notebook without executing pip install each time. 

 

Hope this helps. 🙂

View solution in original post

4 REPLIES 4
Hofpower
Frequent Visitor

Hi @Nikhil234 

 

Have you considered using environments? See https://learn.microsoft.com/en-us/fabric/data-engineering/create-and-use-environment

 

You can add the required library in your environment and then attach the environment either on workspace- or notebook-level to be used in your code. Using this environment should then enable importing the library in the notebook without executing pip install each time. 

 

Hope this helps. 🙂

Anonymous
Not applicable

Hi @Nikhil234 ,

 

I tested installing and calling it directly in Notebook interactive environment and it worked. Could you give it a try?

 

pip install httpx

 

vcgaomsft_0-1723539603154.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Nikhil234
Frequent Visitor

Nikhil234_0-1723539456425.png

This work but it must be re run each session. is there anyway to make it permenant 

Anonymous
Not applicable

Hi @Nikhil234 ,

 

From the previous description you have created a customized environment. Make sure you have saved and published the environment configuration:

vcgaomsft_2-1723542376014.png

The publish consumes some time and after success you will get a success message in the alert. Please check it.

vcgaomsft_0-1723542853766.png

Check that httpx is installed after restarting the session:

vcgaomsft_1-1723543040482.png

The call succeeded.

vcgaomsft_2-1723543326433.png

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June FBC25 Carousel

Fabric Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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