Any idea why I get the following error when trying...
# ask-metaflow
w
Any idea why I get the following error when trying to use the
@batch()
operator? (more detailed
batch
command provided)
Copy code
@batch(image='huggingface/transformers-pytorch-gpu', cpu=16, memory=2**16, gpu=1)
1
Copy code
2024-05-16T20:54:03.112Z	Setting up task environment.
	2024-05-16T20:54:03.112Z	bash: python: command not found
	2024-05-16T20:54:03.112Z	bash: line 0: [: -le: unary operator expected
	2024-05-16T20:54:03.112Z	bash: line 0: [: -gt: unary operator expected
	2024-05-16T20:54:03.113Z	tar: job.tar: Cannot open: No such file or directory
	2024-05-16T20:54:03.113Z	tar: Error is not recoverable: exiting now
	2024-05-16T20:54:03.114Z	bash: python: command not found
If I run the docker image provided locally, I see these versions of python installed
Copy code
root@48dd99a6c126:/# which python
root@48dd99a6c126:/# python --version
bash: python: command not found
root@48dd99a6c126:/# which python3
/usr/bin/python3
root@48dd99a6c126:/# python3 --version
Python 3.8.10
So, python is NOT a recognized command but python3 is. Any way I can get the remote task to use
python3
instead of
python
here?
c
Unfortunately this LOC is hardcoded. A quick hack is it to change that line to python3. An alternate route that doesn't require messing with Metaflow is to make your own image, using this HF image as the base image, and then symlink python to python3.
w
Ahh gotcha, I saw that bit of code going through the metaflow repo earlier and was hoping there was some flag I didn't see that could fix it. I'll change out the image on my end as that seems easiest but thanks for the fast reply @crooked-jordan-29960!!
c
No prob!