# Introducing, PyScript! ⟨py⟩

**URL:** <https://forum.anaconda.com/t/introducing-pyscript-py/20190>\
**Category:** PyScript\
**Tags:** python, pyscript\
**Created:** [April 30, 2022, 3:19pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190 "2022-04-30T15:19:50Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![calvarado](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/calvarado/32/15_2.png) [@calvarado](https://forum.anaconda.com/u/calvarado)\
**Post date:** [April 30, 2022, 3:19pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/1 "2022-04-30T15:19:50Z")

</div>

Imagine a tool that makes front-end development more accessible to Python practitioners, and puts the power of Python into the hands of people that have historically focused on front-end development…

Introducing, PyScript!

Simply put, PyScript is a tool that brings Python to the browser. PyScript is programming for the 99%. ✊

Here are some helpful resources to get you started on your PyScript adventures:

[PyScript site](https://pyscript.net/)

[PyScript on Github](https://github.com/pyscript/pyscript)

[PyScript official announcement on Anaconda.com](https://www.anaconda.com/blog/pyscript-python-in-the-browser)

[PyScript post on the Anaconda Engineering blog](https://engineering.anaconda.com/2022/04/welcome-pyscript.html)

[PyScript post on Anaconda Nucleus](https://anaconda.cloud/pyscript-python-in-the-browser)

[PyScript Nucleus Project](https://anaconda.cloud/s/pyscript)

Happy PyScripting! Let’s create something great, together. 🙌

---

<div class="post-metadata">

**Author:** ![raymond.lo](https://avatars.discourse-cdn.com/v4/letter/r/0075a9/32.png) [@raymond.lo](https://forum.anaconda.com/u/raymond.lo)\
**Post date:** [April 30, 2022, 5:57pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/2 "2022-04-30T17:57:20Z")

</div>

Where is the “pyscript.js” exactly?

Do I have to build that file from source? or?

rlo@rlo-mac03 pyscript-main % grep -ir “pyscript.js” \*  
GETTING-STARTED.md:│ ├── pyscript.js  
GETTING-STARTED.md:│ └── pyscript.js.map  
GETTING-STARTED.md:   
GETTING-STARTED.md:   
GETTING-STARTED.md:   
GETTING-STARTED.md:   
README.md:  
hello\_world:  
hello\_world.html:  
pyscriptjs/rollup.config.js: file: “examples/build/pyscript.js”,  
pyscriptjs/examples/bokeh.html:   
pyscriptjs/examples/simple\_clock.html:   
pyscriptjs/examples/todo-pylist.html:   
pyscriptjs/examples/matplotlib.html:   
pyscriptjs/examples/handtrack/say\_hello.html:   
pyscriptjs/examples/repl.html:   
pyscriptjs/examples/panel\_stream.html:   
pyscriptjs/examples/webgl/raycaster/index.html:  
pyscriptjs/examples/bokeh\_interactive.html:   
pyscriptjs/examples/d3.html:   
pyscriptjs/examples/toga/freedom.html:   
pyscriptjs/examples/toga/README.md:exists, and the `build/pyscript.js` file has been compiled.  
pyscriptjs/examples/folium.html:   
pyscriptjs/examples/panel.html:   
pyscriptjs/examples/antigravity.html:   
pyscriptjs/examples/repl2.html:   
pyscriptjs/examples/numpy\_canvas\_fractals.html:   
pyscriptjs/examples/panel\_deckgl.html:   
pyscriptjs/examples/panel\_kmeans.html:   
pyscriptjs/examples/hello\_world.html:   
pyscriptjs/examples/mario/play\_mario.html:   
pyscriptjs/examples/todo.html:   
pyscriptjs/examples/altair.html:   
rlo@rlo-mac03 pyscript-main % find . -name pyscript.js  
rlo@rlo-mac03 pyscript-main % find . -name todo.html  
./pyscriptjs/examples/todo.html  
rlo@rlo-mac03 pyscript-main % find . -name pyscript.js  
rlo@rlo-mac03 pyscript-main %

---

<div class="post-metadata">

**Author:** ![calvarado](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/calvarado/32/15_2.png) [@calvarado](https://forum.anaconda.com/u/calvarado)\
**Post date:** [April 30, 2022, 6:33pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/3 "2022-04-30T18:33:54Z")

</div>

Hi @raymond.lo ,

Thanks for replying about this!

For now, you can reference (or download) the `pyscript.js` file hosted at: [https://pyscript.net/alpha/pyscript.js](https://pyscript.net/alpha/pyscript.js)

We will update the process shortly.

Thanks, again. Please come back and show us what you create with PyScript!

---

<div class="post-metadata">

**Author:** ![raymond.lo](https://avatars.discourse-cdn.com/v4/letter/r/0075a9/32.png) [@raymond.lo](https://forum.anaconda.com/u/raymond.lo)\
**Post date:** [April 30, 2022, 7:46pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/4 "2022-04-30T19:46:04Z")

</div>

Got it working 🙂 Nice.

> **[Raymond Lo 👓🤖 on LinkedIn: #anaconda #pyscript #iamintel](https://www.linkedin.com/posts/raymondlo84_anaconda-pyscript-iamintel-activity-6926252709973032960-5eS_?utm_source=linkedin_share&utm_medium=member_desktop_web)**
>
> Got Pyscript running (Python running on a web browser directly!). :) And trying to break it in and see how shell commands works! :)
> 
> Thanks: Peter Wang...

---

<div class="post-metadata">

**Author:** ![MarcSkovMadsen](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/marcskovmadsen/32/2463_2.png) [@MarcSkovMadsen](https://forum.anaconda.com/u/MarcSkovMadsen)\
**Post date:** [April 30, 2022, 8:26pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/5 "2022-04-30T20:26:33Z")

</div>

Hi @calvarado

Is there another another link to pyscript.js? I cannot access a “newly created domain” for security reasons.

---

<div class="post-metadata">

**Author:** ![garyboland](https://avatars.discourse-cdn.com/v4/letter/g/0075a9/32.png) [@garyboland](https://forum.anaconda.com/u/garyboland)\
**Post date:** [April 30, 2022, 9:51pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/6 "2022-04-30T21:51:06Z")

</div>

I downloaded and ran one of the todo.html example from my windows 10 laptop.  
Am I missing dependencies?

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

---

<div class="post-metadata">

**Author:** ![calvarado](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/calvarado/32/15_2.png) [@calvarado](https://forum.anaconda.com/u/calvarado)\
**Post date:** [May 1, 2022, 4:45am UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/7 "2022-05-01T04:45:47Z")

</div>



---

<div class="post-metadata">

**Author:** ![Michael\_Verhulst](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/michael_verhulst/32/530_2.png) [@Michael\_Verhulst](https://forum.anaconda.com/u/Michael_Verhulst)\
**Post date:** [May 1, 2022, 5:05am UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/8 "2022-05-01T05:05:48Z")

</div>

hi,

i think you might have downloaded the zip. next, you have to build from source with nodejs.

use nvm to install nodejs, then run “nvm install 16; nvm use 16”

cd into the dir with the “package.json” file and run “npm install”

then run “npm run dev”

---

<div class="post-metadata">

**Author:** ![alsolh](https://avatars.discourse-cdn.com/v4/letter/a/00a5b5/32.png) [@alsolh](https://forum.anaconda.com/u/alsolh)\
**Post date:** [May 1, 2022, 10:41am UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/9 "2022-05-01T10:41:25Z")

</div>

Got it working, thanks 🙂

> **[Mohamad Al Solh on LinkedIn: #pyscript #webassembly #pythoninabrowser](https://www.linkedin.com/posts/alsolh_pyscript-webassembly-pythoninabrowser-activity-6926459926500249600-n7P8?utm_source=linkedin_share&utm_medium=member_desktop_web)**
>
> Python interpreted in a browser!
> 
> try it out here: https://lnkd.in/defeHUhE
> notice that you don't need to install the python runtime as a prerequisite ...

are these warnings normal?

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

i didnt get below message but got the server running fine

```auto
 Your application is ready~! 🚀

  - Local: http://localhost:8080
  - Network: Add `--host` to expose

```

also does it really run fully in the browser through webassembly? or is there any backend processing in the nodejs server?

---

<div class="post-metadata">

**Author:** ![calvarado](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/calvarado/32/15_2.png) [@calvarado](https://forum.anaconda.com/u/calvarado)\
**Post date:** [May 1, 2022, 1:54pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/10 "2022-05-01T13:54:54Z")

</div>



---

<div class="post-metadata">

**Author:** ![calvarado](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/calvarado/32/15_2.png) [@calvarado](https://forum.anaconda.com/u/calvarado)\
**Post date:** [May 1, 2022, 1:55pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/11 "2022-05-01T13:55:06Z")

</div>



---

<div class="post-metadata">

**Author:** ![Michael\_Verhulst](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/michael_verhulst/32/530_2.png) [@Michael\_Verhulst](https://forum.anaconda.com/u/Michael_Verhulst)\
**Post date:** [May 1, 2022, 4:58pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/12 "2022-05-01T16:58:45Z")

</div>

hi

pyscript does not use backend processing in nodejs or any other backend tech. once you build from source you can host in aws s3 or netlify or any other static content hosting system

---

<div class="post-metadata">

**Author:** ![garyboland](https://avatars.discourse-cdn.com/v4/letter/g/0075a9/32.png) [@garyboland](https://forum.anaconda.com/u/garyboland)\
**Post date:** [May 1, 2022, 5:25pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/13 "2022-05-01T17:25:11Z")

</div>

The latest LTS version didn’t work. google suggested using 16.13.2 as it used older version of npm. That managed to get past ‘npm install’, however the next command ‘npm run dev’ introduced a new error:

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

(thank you for earlier reply)

---

<div class="post-metadata">

**Author:** ![Michael\_Verhulst](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/michael_verhulst/32/530_2.png) [@Michael\_Verhulst](https://forum.anaconda.com/u/Michael_Verhulst)\
**Post date:** [May 1, 2022, 5:32pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/14 "2022-05-01T17:32:59Z")

</div>

let me look into this.

can you make an issue over at [Issues · pyscript/pyscript · GitHub](https://github.com/pyscript/pyscript/issues) ?

---

<div class="post-metadata">

**Author:** ![garyboland](https://avatars.discourse-cdn.com/v4/letter/g/0075a9/32.png) [@garyboland](https://forum.anaconda.com/u/garyboland)\
**Post date:** [May 1, 2022, 6:25pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/15 "2022-05-01T18:25:55Z")

</div>

> <https://github.com/pyscript/pyscript/issues/100>
>
> The latest LTS version didn’t work. google suggested using 16.13.2 as it used ol…der version of npm. That managed to get past ‘npm install’, however the next command ‘npm run dev’ introduced a new error:
> 
> !\[image\](https://user-images.githubusercontent.com/1248548/166159291-8e39c8cf-2e96-47e6-9721-dbc883eb82ec.png)

---

<div class="post-metadata">

**Author:** ![fabio.cescon.97](https://avatars.discourse-cdn.com/v4/letter/f/00a5b5/32.png) [@fabio.cescon.97](https://forum.anaconda.com/u/fabio.cescon.97)\
**Post date:** [May 7, 2022, 2:19pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/16 "2022-05-07T14:19:30Z")

</div>

Hi, I love this project but I’m having an hard time trying to share data between Python and JavaScript.  
I wrote a simple example but I’m not able to make it work.

I’d really appreciate some help, thank you!

```auto
<!DOCTYPE html>
<html>
  <head>
    <link rel="stylesheet" href="https://pyscript.net/alpha/pyscript.css" />
    <script defer src="https://pyscript.net/alpha/pyscript.js"></script>
  </head>
  <body>
    <div id="div1"></div>
    <div id="div2"></div>

    <py-script>
py_string = "This is a Python string!"
    </py-script>

    <script>
      var div1 = document.getElementById("div1");
      var div2 = document.getElementById("div2");
      var js_string = "This is a JavaScript string!";
      div1.innerHTML = js_string
      div2.innerHTML = py_string
    </script>  

    <py-script>
from js import console
console.log(js_string)
    </py-script>

  </body>
</html>

```

---

<div class="post-metadata">

**Author:** ![Ardan](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/ardan/32/1252_2.png) [@Ardan](https://forum.anaconda.com/u/Ardan)\
**Post date:** [May 7, 2022, 2:34pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/17 "2022-05-07T14:34:43Z")

</div>

Hi,  
To get JS variables into Python  
We have to import the variable it self  
As below:

```auto
   <py-script>
from js import js_string <!-- Should import the variable -->
console.log(js_string)
    </py-script>

```

---

<div class="post-metadata">

**Author:** ![fabio.cescon.97](https://avatars.discourse-cdn.com/v4/letter/f/00a5b5/32.png) [@fabio.cescon.97](https://forum.anaconda.com/u/fabio.cescon.97)\
**Post date:** [May 7, 2022, 2:41pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/18 "2022-05-07T14:41:20Z")

</div>

Thank you that worked, how can I get Python variables into JS?

---

<div class="post-metadata">

**Author:** ![Ardan](https://dub1.discourse-cdn.com/anaconda/user_avatar/forum.anaconda.com/ardan/32/1252_2.png) [@Ardan](https://forum.anaconda.com/u/Ardan)\
**Post date:** [May 8, 2022, 1:49am UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/19 "2022-05-08T01:49:07Z")

</div>

Pretty much here is explained:  
Until pyscript documentation is published read this for now:

[https://pyodide.org/en/stable/usage/type-conversions.html](https://pyodide.org/en/stable/usage/type-conversions.html)

---

<div class="post-metadata">

**Author:** ![Damian\_Shaw](https://avatars.discourse-cdn.com/v4/letter/d/0075a9/32.png) [@Damian\_Shaw](https://forum.anaconda.com/u/Damian_Shaw)\
**Post date:** [May 9, 2022, 1:34pm UTC](https://forum.anaconda.com/t/introducing-pyscript-py/20190/20 "2022-05-09T13:34:13Z")

</div>

Reading through this forum a lot of people seem to be misunderstanding the limitations of PyScript. Trying to use libraries that require access to system sockets, calls, or start processes.

While education is going to always be challenging with a library like this I wonder if it would make sense to highlight some common limitations on the front of the site itself? Like instead of using `requests` use `pyfetch` (or whatever library ends up being standardized, and a link to some documentation), and examples of things which can’t be done such as scanning user processes, or launching a new process, or connecting directly to sockets, etc…

[Next page](https://forum.anaconda.com/t/introducing-pyscript-py/20190.md?page=2)
