# Import gevent module in PyScript

**URL:** <https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709>\
**Category:** PyScript\
**Created:** [September 14, 2022, 7:28pm UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709 "2022-09-14T19:28:24Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericbegny](https://avatars.discourse-cdn.com/v4/letter/e/db6015/32.png) [@ericbegny](https://forum.anaconda.com/u/ericbegny)\
**Post date:** [September 14, 2022, 7:28pm UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/1 "2022-09-14T19:28:25Z")

</div>

How to import gevent module in PyScript ?

I tried the following things :

in py-script  
import gevent

ModuleNotFoundError: No module named ‘gevent’

in py-env  
– gevent

ValueError: Couldn’t find a pure Python 3 wheel for ‘gevent’. You can use `micropip.install(..., keep_going=True)` to get a list of all packages with missing wheels.

in py-env  
– ‘./gevent-1.4.0-cp35-cp35m-win\_amd64.whl’

ValueError: ‘gevent-1.4.0-cp35-cp35m-win\_amd64.whl’ is not a pure Python 3 wheel  
(tried different wheels, no one seems working)

---

<div class="post-metadata">

**Author:** ![john.hanley](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/john.hanley/32/1294_2.png) [@john.hanley](https://forum.anaconda.com/u/john.hanley)\
**Post date:** [September 15, 2022, 4:26am UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/2 "2022-09-15T04:26:06Z")

</div>

The package `gevent-1.4.0-cp35-cp35m-win_amd64.whl` is built for Windows. Windows packages are not compatible in the browser virtual machine. The package must be a pure Python wheel or a package ported to run under Pyodide.

A pure Python wheel usually contains `none-any.whl` in the file name.

This article will help understand Python wheels:

> **[What Are Python Wheels and Why Should You Care? – Real Python](https://realpython.com/python-wheels/)**
>
> In this tutorial, you'll learn what Python wheels are and why you should care as both a developer and end user of Python packages. You'll see how the wheel format has gained momentum over the last decade and how it has made the package installation...

---

<div class="post-metadata">

**Author:** ![ericbegny](https://avatars.discourse-cdn.com/v4/letter/e/db6015/32.png) [@ericbegny](https://forum.anaconda.com/u/ericbegny)\
**Post date:** [September 15, 2022, 6:33am UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/3 "2022-09-15T06:33:41Z")

</div>

Thanks for the link, I am looking into

---

<div class="post-metadata">

**Author:** ![ericbegny](https://avatars.discourse-cdn.com/v4/letter/e/db6015/32.png) [@ericbegny](https://forum.anaconda.com/u/ericbegny)\
**Post date:** [September 15, 2022, 9:07am UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/4 "2022-09-15T09:07:21Z")

</div>

@john.hanley  
Good article, but couldn’t create my own Pure wheel from the gevent files (‘stddef.h’ : No such file or directory)

I still look after a possible way to import gevent in PyScript

---

<div class="post-metadata">

**Author:** ![neil](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/neil/32/1303_2.png) [@neil](https://forum.anaconda.com/u/neil)\
**Post date:** [September 15, 2022, 12:49pm UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/5 "2022-09-15T12:49:35Z")

</div>

I think that’s a C header file.

I strongly suspect you won’t be able to make gevent into a pure Python wheel due to the nature of what it is. It appears to be using various low level (non-Python) things - see the description for all the references to libuv, SSL etc.

> **[gevent](https://pypi.org/project/gevent/)**
>
> Coroutine-based network library

---

<div class="post-metadata">

**Author:** ![ericbegny](https://avatars.discourse-cdn.com/v4/letter/e/db6015/32.png) [@ericbegny](https://forum.anaconda.com/u/ericbegny)\
**Post date:** [September 15, 2022, 1:14pm UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/6 "2022-09-15T13:14:49Z")

</div>

Thanks @neil  
So If I understand, it is not possible to import gevent in a PyScript project, right ?

---

<div class="post-metadata">

**Author:** ![neil](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/neil/32/1303_2.png) [@neil](https://forum.anaconda.com/u/neil)\
**Post date:** [September 17, 2022, 7:43pm UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/7 "2022-09-17T19:43:40Z")

</div>

Well, strictly speaking i was just addressing the aspect of you producing a pure Python wheel, and in theory there’s still the other option John mentioned:

> a package ported to run under Pyodide.

So if you are able to port gevent to Pyodide then you’d be okay…

but that’s probably easier said than done!

I haven’t looked into that side in enough depth to know if there were any serious blockers, but my sense is that it might well be challenging. Check the Pyodide documentation for more details.

---

<div class="post-metadata">

**Author:** ![ericbegny](https://avatars.discourse-cdn.com/v4/letter/e/db6015/32.png) [@ericbegny](https://forum.anaconda.com/u/ericbegny)\
**Post date:** [September 18, 2022, 6:48am UTC](https://forum.anaconda.com/t/import-gevent-module-in-pyscript/36709/8 "2022-09-18T06:48:17Z")

</div>

Thx neil  
It might be challenging, especially for me ! 😉
