# Read CSV file with Pyscript using Pandas

**URL:** <https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527>\
**Category:** PyScript\
**Created:** [August 7, 2022, 11:17am UTC](https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527 "2022-08-07T11:17:00Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![lahsaouinouhaila](https://avatars.discourse-cdn.com/v4/letter/l/f5a800/32.png) [@lahsaouinouhaila](https://forum.anaconda.com/u/lahsaouinouhaila)\
**Post date:** [August 7, 2022, 11:17am UTC](https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527/1 "2022-08-07T11:17:00Z")

</div>

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/\_base.py”, line 429, in eval\_code .run(globals, locals) File “/lib/python3.10/site-packages/\_pyodide/\_base.py”, 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:

```auto
<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	
	<title>RADAR</title>
	 <link rel="shortcut icon" href="R.jpg" type=image/x-icon>
	<link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
<script defer src="https://pyscript.net/alpha/pyscript.js"></script>
</head>
<body>
<py-env> <!--python library-->
- pandas
 </py-env>

  <py-script> 
import pandas as pd
df=pd.read_csv('cmaregraphe.csv', sep='[;\s]+', engine='python')
p=df['Niveau'].max()
print(p)
 </py-script>  
</body></html>

```

my csv file contains

 ![image](https://europe1.discourse-cdn.com/anaconda/original/2X/4/4b1afbe511526063ec2e1cd589a92903ced6362a.png)

any help please 🙏🏻 🙏🏻

---

<div class="post-metadata">

**Author:** ![ktsh.tanaka.2020](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/ktsh.tanaka.2020/32/1400_2.png) [@ktsh.tanaka.2020](https://forum.anaconda.com/u/ktsh.tanaka.2020)\
**Post date:** [August 7, 2022, 11:41am UTC](https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527/2 "2022-08-07T11:41:10Z")

</div>

dear [lahsaouinouhaila](https://forum.anaconda.com/u/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.

> <https://github.com/pyscript/pyscript/blob/main/docs/tutorials/getting-started.md>

![pyscript](https://europe1.discourse-cdn.com/anaconda/original/2X/7/7ade8f3dcbf9c7f43ee6d39ff31ad7b079aa0e46.jpeg)

Regards, you.  
ktsh.tanaka.2020

---

<div class="post-metadata">

**Author:** ![lahsaouinouhaila](https://avatars.discourse-cdn.com/v4/letter/l/f5a800/32.png) [@lahsaouinouhaila](https://forum.anaconda.com/u/lahsaouinouhaila)\
**Post date:** [August 7, 2022, 12:04pm UTC](https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527/3 "2022-08-07T12:04:40Z")

</div>

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

```auto
  <py-script> 
 from datetime import datetime
 now = datetime.now()
 now.strftime("%d/%m/%Y, %H:%M:%S")
 </py-script>  

```

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

---

<div class="post-metadata">

**Author:** ![ktsh.tanaka.2020](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/ktsh.tanaka.2020/32/1400_2.png) [@ktsh.tanaka.2020](https://forum.anaconda.com/u/ktsh.tanaka.2020)\
**Post date:** [August 7, 2022, 12:37pm UTC](https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527/4 "2022-08-07T12:37:52Z")

</div>

dear [lahsaouinouhaila](https://forum.anaconda.com/u/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 lib.so 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.  
ktsh.tanaka.2020

---

<div class="post-metadata">

**Author:** ![lahsaouinouhaila](https://avatars.discourse-cdn.com/v4/letter/l/f5a800/32.png) [@lahsaouinouhaila](https://forum.anaconda.com/u/lahsaouinouhaila)\
**Post date:** [August 7, 2022, 12:56pm UTC](https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527/5 "2022-08-07T12:56:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ktsh.tanaka.2020](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/ktsh.tanaka.2020/32/1400_2.png) [@ktsh.tanaka.2020](https://forum.anaconda.com/u/ktsh.tanaka.2020)\
**Post date:** [August 7, 2022, 2:00pm UTC](https://forum.anaconda.com/t/read-csv-file-with-pyscript-using-pandas/30527/6 "2022-08-07T14:00:29Z")

</div>

dear [lahsaouinouhaila](https://forum.anaconda.com/u/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.

> **[8 Alternatives to Pandas for Processing Large Datasets](https://towardsdatascience.com/8-alternatives-to-pandas-for-processing-large-datasets-928fc927b08c)**
>
> Stop using Pandas

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

ktsh.tanaka.2020
