Read CSV file with Pyscript using Pandas

hey guys i’m using pyscrit with pandas but i get the following message

JsException(PythonError: Traceback (most recent call last): File “/lib/python3.10/site-packages/_pyodide/”, line 429, in eval_code .run(globals, locals) File “/lib/python3.10/site-packages/_pyodide/”, line 300, in run coroutine = eval(self.code, globals, locals) File “”, line 1, in ModuleNotFoundError: No module named ‘pandas’ )

in my web site but the code i wrote in sublime not in using anaconda

so the code’s:

<!DOCTYPE html>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	 <link rel="shortcut icon" href="R.jpg" type=image/x-icon>
	<link rel="stylesheet" href="" />
<script defer src=""></script>
<py-env> <!--python library-->
- pandas

import pandas as pd
df=pd.read_csv('cmaregraphe.csv', sep='[;\s]+', engine='python')

my csv file contains

any help please :pray:t2: :pray:t2:

1 Like

dear lahsaouinouhaila.

Thank you for posting.

Since you presented the detailed error code and source code, it was easy to understand the cause.
For details, please refer to the following URL, but it can be easily corrected.


Regards, you.

hello sir @ktsh.tanaka.2020 i would tell you that i can use python normaly (what i tested yesterday’s :point_right:t2:print(‘hello’) i can see the result in my web site normaly without appering any error message also i tried this code

 from datetime import datetime
 now =
 now.strftime("%d/%m/%Y, %H:%M:%S")

it’s working perfectly but why pandas it’s not working that’s what i want to know i saw some videos on youtube talking about pandas and using pyscript but no one get the same error message i has i hope i can find a solution cause i really need to connect my python script to my browzer

1 Like

dear lahsaouinouhaila.

thank you for reply.

In pyscript, Pandas often doesn’t work because the numpy, pytz, and dateutil needed to run Pandas are often not imported.

I think this is because the current pyscript specification requires you to specify the required packages directly.

In other words, libraries that are located directly in the /lib/python3.9 directory instead of site-packages will be imported without doing anything, but in the case of other libraries, if they are not directly located. I don’t think it has been imported.

Especially in the case of numpy and scipy, not only python scripts but also libraries such as dll and are used.

In other words, pyscript is not a runtime engine, but an interface for launching Python on the base system.

If you have any requests for improvement in the future, we would appreciate it if you could contact us.

Regards, you.

1 Like

Thank you sir for replying I appreciate it .
I wonder if I can use some thing else that can play the same role as pandas using pyscript

1 Like

dear lahsaouinouhaila.

thank you for reply.
I have a few options, each with its pros and cons.

For details, please refer to the article at the following URL.

In terms of using numpy, GPU, SQL, etc., they may not be compatible with Pyscript.


1 Like