# Adding custom python library to pyodide

**URL:** <https://discourse.mozilla.org/t/adding-custom-python-library-to-pyodide/80489>\
**Category:** Development\
**Created:** [May 21, 2021, 1:17pm UTC](https://discourse.mozilla.org/t/adding-custom-python-library-to-pyodide/80489 "2021-05-21T13:17:33Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Gaurav\_poudel](https://avatars.discourse-cdn.com/v4/letter/g/dec6dc/32.png) [@Gaurav\_poudel](https://discourse.mozilla.org/u/Gaurav_poudel)\
**Post date:** [May 21, 2021, 1:17pm UTC](https://discourse.mozilla.org/t/adding-custom-python-library-to-pyodide/80489/1 "2021-05-21T13:17:33Z")

</div>

I am trying to use a wheel package in the browser using pyodide. The wheel package is attached herewith also.

When I run the following command in the browser console, I get an error.  
Cmd:  
await loadPyodide();  
await pyodide.runPythonAsync(` import micropip await micropip.install('https://test-bucket-file-parse.s3-ap-southeast-1.amazonaws.com/ICON_PACKAGE-1.0-py3-none-any.whl')`)

Error:  
`OSError: [Errno 29] I/O error`

---

<div class="post-metadata">

**Author:** ![freaktechnik](https://sea1.discourse-cdn.com/flex001/user_avatar/discourse.mozilla.org/freaktechnik/32/37766_2.png) [@freaktechnik](https://discourse.mozilla.org/u/freaktechnik)\
**Post date:** [May 21, 2021, 3:38pm UTC](https://discourse.mozilla.org/t/adding-custom-python-library-to-pyodide/80489/2 "2021-05-21T15:38:40Z")

</div>

Have you checked the network monitor in the appropriate toolbox? It’s possible loading the file over the internet is failing.

Also note that this might be hard to make compatible with the add-on guidelines: [Add-on Policies | Firefox Extension Workshop](https://extensionworkshop.com/documentation/publish/add-on-policies/#development-practices)  
you would likely have to bundle all the python wheels with the extension (and possibly provide source code?).

It’s also possible pyodide needs eval, which is not allowed by default in extensions:

> **[Content Security Policy - Mozilla | MDN](https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/Content_Security_Policy#eval()_and_friends)**
>
> Extensions developed with WebExtension APIs have a Content Security Policy (CSP) applied to them by default. This restricts the sources from which they can load code such as
