search

Home  >  Q&A  >  body text

Using PyScript: How to use "pip install"?

I'm trying to write an html file that can contact chat gpt.

This is the beginning of the code:

<link rel="stylesheet" href="https://pyscript.net/latest/pyscript.css" />
<script defer src="https://pyscript.net/latest/pyscript.js"></script>

<py-script>
import openai
</py-script>

But when I run it it says:

ModuleNotFoundError: No module named 'openai'

Any idea how to install it on an html file?

I'm trying to figure out how to use:

pip install openai,

But I don't know how to run bash commands from python.

I also tried using but it didn't have any effect on the code.

It might be blocked by my proxy, I'm a beginner in Python, so please explain it briefly.

P粉189606269P粉189606269403 days ago496

reply all(1)I'll reply

  • P粉373596828
  • Cancelreply