# I can't import numpy in code node

**URL:** <https://community.n8n.io/t/i-cant-import-numpy-in-code-node/106979>\
**Category:** Questions\
**Created:** [April 27, 2025, 11:52am UTC](https://community.n8n.io/t/i-cant-import-numpy-in-code-node/106979 "2025-04-27T11:52:52Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Joy\_Li](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/joy_li/32/59317_2.png) [@Joy\_Li](https://community.n8n.io/u/Joy_Li)\
**Post date:** [April 27, 2025, 11:52am UTC](https://community.n8n.io/t/i-cant-import-numpy-in-code-node/106979/1 "2025-04-27T11:52:52Z")

</div>

I am trying to add a code node using python, but when i run the code"import numpy as np",  
it return an error:‘packaging’ is included in the Pyodide distribution, but it is not installed. You can install it by calling: await micropip.install(“packaging”) in Python, or await pyodide.loadPackage(“packaging”) in JavaScript See [Loading packages — Version 0.27.5](https://pyodide.org/en/stable/usage/loading-packages.html) for more details.

---

<div class="post-metadata">

**Author:** ![anon61017519](https://avatars.discourse-cdn.com/v4/letter/a/67e7ee/32.png) [@anon61017519](https://community.n8n.io/u/anon61017519)\
**Post date:** [April 27, 2025, 2:55pm UTC](https://community.n8n.io/t/i-cant-import-numpy-in-code-node/106979/2 "2025-04-27T14:55:19Z")

</div>

Hello @Joy_Li

Open a separate workflow and test this suggestion below.

Remember to check the credentials and adjust according to your needs

If you find any part in Portuguese, translate it to your language, because I don’t speak English. So I need to take your message, translate it to Portuguese, understand the problem, see if I can help in any way, answer the question, translate it to English and then post it in the community. I wish you all the best!

The changes were the automatic installation of packages, improved error handling and removal of the Pyodide dependency  
It also simplifies data generation, its return structuring.

If this suggestion solved your problem, mark my post as a solution (blue box with check mark) so that this ongoing discussion does not distract others who want to find the answer to the original question and click the heart. Thank you 👍

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/n8n/user_avatar/community.n8n.io/system/32/195824_2.png) [@system](https://community.n8n.io/u/system)\
**Post date:** [July 26, 2025, 2:55pm UTC](https://community.n8n.io/t/i-cant-import-numpy-in-code-node/106979/3 "2025-07-26T14:55:38Z")

</div>

Closed on July 26, 2025, 2:55pm UTC

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.
