I’ve spent a couple of hours playing around within Terminal and I’m at my wit’s end. Forgive my lack of computational literacy–I feel like I can point to information that might be part of the problem but I’m not 100% sure. I’ll speak with as limited (but accurate) scope as possible.
- I’ve created a virtual environment for Prodigy
- When I type “prodigy” into Terminal I get a list of Available recipes and Available commands.
- Executing a command such as “python -m spacy download en_core_web_sm” works successfully (i.e. returns the following message)
- The challenge is, I can’t seem to load data. Examples of problematic commands:
*“from prodigy.components.loaders import CSV”
“from: can’t read /var/mail/prodigy.components.loaders”
“python -m from prodigy.components.loaders import CSV”
“/anaconda3/envs/prodigyenv/bin/python: No module named from”
I searched my Mac for prodigy.components.loaders and the only location I find is “Macintosh HD ▸ anaconda3 ▸ envs ▸ prodigyenv ▸ lib ▸ python3.7 ▸ site-packages ▸ prodigy”
*When I’m executing in Terminal, I’m in the directory “/Users/willstamatis/Prodigy”
I can’t figure out how else to debug this–could anyone offer some guidance?
It’s possible I’m misunderstanding this, but just in case it’s this simple: you might be putting in Python code into your terminal app, which expects only Bash code? You might find it helpful to use Jupyter notebooks, or perhaps the ipython shell, to get an environment where you can execute both command-line commands like
python -m spacy or
python -m prodigy, and Python lines like
from prodigy.components.loaders import CSV.
Thank you for responding. When I launch Jupyter notebooks, I believe I’m running them in a different environment.
The documentation I read online seemed to indicate that I should create a new environment in which to install Prodigy–am I hearing that I should try and install Prodigy in the same environment that my Jupyter notebooks use? If so, could I launch the Prodigy web app from a Jupyter notebook?
I’m a bit confused because in every example I see it seems like users run Prodigy from Terminal (or another Terminal-like shell).
I think you can execute shell commands from a notebook if you type a
! before them – e.g.
!prodigy. It all comes down to personal preference – if you feel comfortable using the terminal, I’d definitely suggest using that instead of adding yet another layer of abstraction (and potential Python environment issues) via a Jupyter notebook
The main problem in this case here is that the code you’re trying the run here is Python code – so it should be placed in a
.py file, so it can be executed by Python. Just typing it on the command line doesn’t work.