Installing Prodigy in AWS EC2 Windows instance

Hi Prodigy team,

Our developer helped us install Prodigy in AWS. We want to use JupyterLab next but do not know how to proceed. I am attaching a screenshot of my Windows PowerShell. Can you advise next steps in order to set up the jupyterlab interface? Thank you!

hi @jiebei!

Thanks for your message and welcome to the Prodigy community :wave:

Have you installed pip onto your Windows machine?

You can check by trying:

pip --version

If so, per the GitHub repo instructions, you can install the extension in two steps:

pip install jupyterlab>=3.0.0
pip install jupyterlab-prodigy

You can test if you the installation worked by running:

jupyter labextension list

I hope this helps. Let us know if you have other questions!

Thanks Ryan. I believe the installation is okay. By running jupyter labextension list, i can see the msg as below.
p1

But when I tried to follow the this instruction, I got error as the screen shows. What shall I do next? Thank you!

p3

hi @jiebei!

Thanks for the update.

If possible, when posting code or console outputs, can you copy/paste for code instead of screenshots? You can use the markdown/code format to render the code. This makes it easier to search and for us to copy/paste code chunks. Thank you :slight_smile:

To run Prodigy in Jupyter, you'll need to run commands in the Jupyter notebook, not the terminal. You can do this by first running jupyter lab, then opening a notebook and adding ! to the command (e.g., !python -m prodigy ...) so that it's run as a terminal command in Jupyter. At this point, then you can open Prodigy in Jupyter lab tab.

Also, can you add the prefix python -m to your prodigy commands? I suspect this is why you're getting the error about "The term 'prodigy' is not recognized". Adding python -m is generally a good practice to always do whether in Jupyter or running in terminal.

If python -m prodigy ... doesn’t work, check whether the correct virtual environment is activated. If you’re using the system Python rather than an environment, you might need to run python3 rather than python .

I hope this helps! Let me know if you have further questions.

Hi, I am still having issues of starting the server. I used two termnal windows in AWS EC2 windows. In the first window, my commend below can start the prodigy.

cd Projects
prodigy/Scripts/activate

and in the second terminal winder, I simply used

jupyter lab

then I move to the browser to work in jupyter lab. I used, but got the message C:\Users\Administrator\AppData\Local\Programs\Python\Python310\python.exe: No module named prodigy. how can I fix it? Thank you!

!python -m prodigy ner.manual ner_news_headlines blank:en ./news_headlines.jsonl --label PERSON,ORG,PRODUCT,LOCATION

hi @Jiebei!

I suspect the issue is in the 2nd terminal window you didn't activate your virtual environment (you had only for the first).

It will likely be much easier to simply run all of your commands into one terminal that is running JupyterLab. For example, start in a new terminal window. Run all in that same terminal.

cd Projects # makes sure your in the right folder
prodigy/Scripts/activate # activates your venv
jupyter lab # runs jupyter lab with the activated venv

Then when you get into Jupyter, run your Prodigy commands in a chunk, appended with ! to indicate that your running the command in the terminal, not in python, like this:

If that still doesn't work, in Jupyter you can combine commands with && to ensure that you run Prodigy in your virtual environment.

For example, if you are in JupyterLab and you're in the correct directory, you can run:

!prodigy/Scripts/activate && python -m prodigy ...

I hope this helps!