# Uv + ray in example is not working

**URL:** https://discuss.ray.io/t/uv-ray-in-example-is-not-working/22783
**Category:** Uncategorized
**Created:** [July 2, 2025, 1:04am UTC](https://discuss.ray.io/t/uv-ray-in-example-is-not-working/22783 "2025-07-02T01:04:43Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![JasonZhu1313](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/jasonzhu1313/32/8077_2.png) [@JasonZhu1313](https://discuss.ray.io/u/JasonZhu1313)
#### Post date: [July 2, 2025, 1:04am UTC](https://discuss.ray.io/t/uv-ray-in-example-is-not-working/22783/1 "2025-07-02T01:04:43Z")

</div>

> <https://github.com/ray-project/ray/issues/54263>
>
> \### What happened + What you expected to happen
> 
> Awesome work on combining uv wi…th Ray \[uv + Ray: Pain-Free Python Dependencies in Clusters | Anyscale\](https://www.anyscale.com/blog/uv-ray-pain-free-python-dependencies-in-clusters). I was trying to run the simple examples in blog. But failed when submitting the job to ray cluster.
> 
> 
> 
> 
> pyproject.toml:
> \`\`\`
> \[project\]
> name = "my\_llm\_batch\_inference"
> version = "0.1"
> dependencies = \[
> "numpy",
> "pyyaml",
> "ray\[llm\]",
> \]
> requires-python = "\>=3.10"
> 
> 
> \`\`\`
> 
> batch\_inference.py
> \`\`\`
> import ray
> from ray.data.llm import vLLMEngineProcessorConfig, build\_llm\_processor
> import numpy as np
> 
> config = vLLMEngineProcessorConfig(
> model\_source="/shared/public/elr-models/Qwen/Qwen3-0.6B/a9c98e602b9d36d2a2f7ba1eb0f5f31e4e8e5143",
> engine\_kwargs={
> "enable\_chunked\_prefill": True,
> "max\_num\_batched\_tokens": 4096,
> "max\_model\_len": 16384,
> },
> concurrency=1,
> batch\_size=64,
> )
> processor = build\_llm\_processor(
> config,
> preprocess=lambda row: dict(
> messages=\[
> {"role": "system", "content": "You are a bot that responds with haikus."},
> {"role": "user", "content": row\["item"\]}
> \],
> sampling\_params=dict(
> temperature=0.3,
> max\_tokens=250,
> )
> ),
> postprocess=lambda row: dict(
> answer=row\["generated\_text"\],
> \*\*row # This will return all the original columns in the dataset.
> ),
> )
> 
> ds = ray.data.from\_items(\["Start of the haiku is: Complete this for me..."\])
> 
> ds = processor(ds)
> ds.show(limit=1)
> 
> \`\`\`
> 
> Command to submit Ray job:
> \`\`\`
> uv run --refresh ray job submit \\
> --runtime-env-json '{
> "working\_dir": "/home/jobuser/uv\_ray\_test",
> "py\_executable": "/home/jobuser/uv\_ray\_test/.venv/bin/python"
> }' \\
> -- python batch\_inference.py
> 
> \`\`\`
> 
> I got the following error:
> 
> \`\`\`
> 
> (my-llm-batch-inference) jobuser \[~/uv\_ray\_test \]$ sh /home/jobuser/uv\_ray\_test/submit\_job.sh
> Job submission server address: http://100.96.115.47:8265
> 2025-07-02 00:51:37,913 INFO dashboard\_sdk.py:338 -- Uploading package gcs://\_ray\_pkg\_b45a803f8fbcc647.zip.
> 2025-07-02 00:51:37,913 INFO packaging.py:588 -- Creating a file package for local module '/home/jobuser/uv\_ray\_test'.
> 
> \-------------------------------------------------------
> Job 'raysubmit\_VaTJVLm4vKk1Crz9' submitted successfully
> \-------------------------------------------------------
> 
> Next steps
> Query the logs of the job:
> ray job logs raysubmit\_VaTJVLm4vKk1Crz9
> Query the status of the job:
> ray job status raysubmit\_VaTJVLm4vKk1Crz9
> Request the job to be stopped:
> ray job stop raysubmit\_VaTJVLm4vKk1Crz9
> 
> Tailing logs until the job exits (disable with --no-wait):
> 2025-07-02 00:51:37,932 INFO job\_manager.py:531 -- Runtime env is setting up.
> 2025-07-02 00:51:41,220 INFO worker.py:1588 -- Using address 100.96.115.47:6379 set in the environment variable RAY\_ADDRESS
> 2025-07-02 00:51:41,229 INFO worker.py:1723 -- Connecting to existing Ray cluster at address: 100.96.115.47:6379...
> 2025-07-02 00:51:41,242 INFO worker.py:1908 -- Connected to Ray cluster. View the dashboard at 100.96.115.47:8265 
> No cloud storage mirror configured
> (raylet) \[2025-07-02 00:52:31,133 E 108104 108104\] (raylet) worker\_pool.cc:586: Some workers of the worker process(339127) have not registered within the timeout. The process is dead, probably it crashed during start.
> (raylet) usage: default\_worker.py \[-h\] --cluster-id CLUSTER\_ID --node-id NODE\_ID
> (raylet) --node-ip-address NODE\_IP\_ADDRESS --node-manager-port
> (raylet) NODE\_MANAGER\_PORT
> (raylet) \[--raylet-ip-address RAYLET\_IP\_ADDRESS\]
> (raylet) --redis-address REDIS\_ADDRESS --gcs-address
> (raylet) GCS\_ADDRESS \[--redis-username REDIS\_USERNAME\]
> (raylet) \[--redis-password REDIS\_PASSWORD\] --object-store-name
> (raylet) OBJECT\_STORE\_NAME \[--raylet-name RAYLET\_NAME\]
> (raylet) \[--logging-level {debug,info,warning,error,critical}\]
> (raylet) \[--logging-format LOGGING\_FORMAT\]
> (raylet) \[--temp-dir TEMP\_DIR\] \[--storage STORAGE\]
> (raylet) \[--load-code-from-local\] \[--worker-type WORKER\_TYPE\]
> (raylet) --metrics-agent-port METRICS\_AGENT\_PORT
> (raylet) --runtime-env-agent-port RUNTIME\_ENV\_AGENT\_PORT
> (raylet) \[--object-spilling-config OBJECT\_SPILLING\_CONFIG\]
> (raylet) \[--logging-rotate-bytes LOGGING\_ROTATE\_BYTES\]
> (raylet) \[--logging-rotate-backup-count LOGGING\_ROTATE\_BACKUP\_COUNT\]
> (raylet) \[--runtime-env-hash RUNTIME\_ENV\_HASH\] --startup-token
> (raylet) STARTUP\_TOKEN \[--ray-debugger-external\]
> (raylet) \[--session-name SESSION\_NAME\] \[--webui WEBUI\]
> (raylet) --worker-launch-time-ms WORKER\_LAUNCH\_TIME\_MS
> (raylet) \[--worker-preload-modules WORKER\_PRELOAD\_MODULES\]
> (raylet) \[--enable-resource-isolation ENABLE\_RESOURCE\_ISOLATION\]
> (raylet) default\_worker.py: error: unrecognized arguments: /home/jobuser/uv\_ray\_test/.venv/lib/python3.10/site-packages/ray/\_private/workers/default\_worker.py
> ^Z
> \[2\]+ Stopped  
> 
> \`\`\`
> 
> I tried to put "uv run" as py\_executable, still failed.
> 
> 
> 
> 
> \### Versions / Dependencies
> 
> Ray version:
> \`\`\`
> (my-llm-batch-inference) jobuser \[~/uv\_ray\_test \]$ uv pip show ray
> Name: ray
> Version: 2.47.1
> Location: /home/jobuser/uv\_ray\_test/.venv/lib/python3.10/site-packages
> Requires: click, filelock, jsonschema, msgpack, packaging, protobuf, pyyaml, requests
> Required-by: vllm
> 
> \`\`\`
> 
> \### Reproduction script
> 
> 
> 
> pyproject.toml:
> \`\`\`
> \[project\]
> name = "my\_llm\_batch\_inference"
> version = "0.1"
> dependencies = \[
> "numpy",
> "pyyaml",
> "ray\[llm\]",
> \]
> requires-python = "\>=3.10"
> 
> 
> \`\`\`
> 
> batch\_inference.py
> \`\`\`
> import ray
> from ray.data.llm import vLLMEngineProcessorConfig, build\_llm\_processor
> import numpy as np
> 
> config = vLLMEngineProcessorConfig(
> model\_source="/shared/public/elr-models/Qwen/Qwen3-0.6B/a9c98e602b9d36d2a2f7ba1eb0f5f31e4e8e5143",
> engine\_kwargs={
> "enable\_chunked\_prefill": True,
> "max\_num\_batched\_tokens": 4096,
> "max\_model\_len": 16384,
> },
> concurrency=1,
> batch\_size=64,
> )
> processor = build\_llm\_processor(
> config,
> preprocess=lambda row: dict(
> messages=\[
> {"role": "system", "content": "You are a bot that responds with haikus."},
> {"role": "user", "content": row\["item"\]}
> \],
> sampling\_params=dict(
> temperature=0.3,
> max\_tokens=250,
> )
> ),
> postprocess=lambda row: dict(
> answer=row\["generated\_text"\],
> \*\*row # This will return all the original columns in the dataset.
> ),
> )
> 
> ds = ray.data.from\_items(\["Start of the haiku is: Complete this for me..."\])
> 
> ds = processor(ds)
> ds.show(limit=1)
> 
> \`\`\`
> 
> Command to submit Ray job:
> \`\`\`
> uv run --refresh ray job submit \\
> --runtime-env-json '{
> "working\_dir": "/home/jobuser/uv\_ray\_test",
> "py\_executable": "/home/jobuser/uv\_ray\_test/.venv/bin/python"
> }' \\
> -- python batch\_inference.py
> 
> \`\`\`
> 
> I got the following error:
> 
> \`\`\`
> 
> (my-llm-batch-inference) jobuser \[~/uv\_ray\_test \]$ sh /home/jobuser/uv\_ray\_test/submit\_job.sh
> Job submission server address: http://100.96.115.47:8265
> 2025-07-02 00:51:37,913 INFO dashboard\_sdk.py:338 -- Uploading package gcs://\_ray\_pkg\_b45a803f8fbcc647.zip.
> 2025-07-02 00:51:37,913 INFO packaging.py:588 -- Creating a file package for local module '/home/jobuser/uv\_ray\_test'.
> 
> \-------------------------------------------------------
> Job 'raysubmit\_VaTJVLm4vKk1Crz9' submitted successfully
> \-------------------------------------------------------
> 
> Next steps
> Query the logs of the job:
> ray job logs raysubmit\_VaTJVLm4vKk1Crz9
> Query the status of the job:
> ray job status raysubmit\_VaTJVLm4vKk1Crz9
> Request the job to be stopped:
> ray job stop raysubmit\_VaTJVLm4vKk1Crz9
> 
> Tailing logs until the job exits (disable with --no-wait):
> 2025-07-02 00:51:37,932 INFO job\_manager.py:531 -- Runtime env is setting up.
> 2025-07-02 00:51:41,220 INFO worker.py:1588 -- Using address 100.96.115.47:6379 set in the environment variable RAY\_ADDRESS
> 2025-07-02 00:51:41,229 INFO worker.py:1723 -- Connecting to existing Ray cluster at address: 100.96.115.47:6379...
> 2025-07-02 00:51:41,242 INFO worker.py:1908 -- Connected to Ray cluster. View the dashboard at 100.96.115.47:8265 
> No cloud storage mirror configured
> (raylet) \[2025-07-02 00:52:31,133 E 108104 108104\] (raylet) worker\_pool.cc:586: Some workers of the worker process(339127) have not registered within the timeout. The process is dead, probably it crashed during start.
> (raylet) usage: default\_worker.py \[-h\] --cluster-id CLUSTER\_ID --node-id NODE\_ID
> (raylet) --node-ip-address NODE\_IP\_ADDRESS --node-manager-port
> (raylet) NODE\_MANAGER\_PORT
> (raylet) \[--raylet-ip-address RAYLET\_IP\_ADDRESS\]
> (raylet) --redis-address REDIS\_ADDRESS --gcs-address
> (raylet) GCS\_ADDRESS \[--redis-username REDIS\_USERNAME\]
> (raylet) \[--redis-password REDIS\_PASSWORD\] --object-store-name
> (raylet) OBJECT\_STORE\_NAME \[--raylet-name RAYLET\_NAME\]
> (raylet) \[--logging-level {debug,info,warning,error,critical}\]
> (raylet) \[--logging-format LOGGING\_FORMAT\]
> (raylet) \[--temp-dir TEMP\_DIR\] \[--storage STORAGE\]
> (raylet) \[--load-code-from-local\] \[--worker-type WORKER\_TYPE\]
> (raylet) --metrics-agent-port METRICS\_AGENT\_PORT
> (raylet) --runtime-env-agent-port RUNTIME\_ENV\_AGENT\_PORT
> (raylet) \[--object-spilling-config OBJECT\_SPILLING\_CONFIG\]
> (raylet) \[--logging-rotate-bytes LOGGING\_ROTATE\_BYTES\]
> (raylet) \[--logging-rotate-backup-count LOGGING\_ROTATE\_BACKUP\_COUNT\]
> (raylet) \[--runtime-env-hash RUNTIME\_ENV\_HASH\] --startup-token
> (raylet) STARTUP\_TOKEN \[--ray-debugger-external\]
> (raylet) \[--session-name SESSION\_NAME\] \[--webui WEBUI\]
> (raylet) --worker-launch-time-ms WORKER\_LAUNCH\_TIME\_MS
> (raylet) \[--worker-preload-modules WORKER\_PRELOAD\_MODULES\]
> (raylet) \[--enable-resource-isolation ENABLE\_RESOURCE\_ISOLATION\]
> (raylet) default\_worker.py: error: unrecognized arguments: /home/jobuser/uv\_ray\_test/.venv/lib/python3.10/site-packages/ray/\_private/workers/default\_worker.py
> ^Z
> \[2\]+ Stopped  
> 
> \`\`\`
> 
> I tried to put "uv run" as py\_executable, still failed.
> 
> 
> 
> \### Issue Severity
> 
> High: It blocks me from completing my task.

---

<div class="post-metadata">

### Author: ![christina](https://sea2.discourse-cdn.com/flex020/user_avatar/discuss.ray.io/christina/32/7542_2.png) [@christina](https://discuss.ray.io/u/christina)
#### Post date: [July 2, 2025, 1:22am UTC](https://discuss.ray.io/t/uv-ray-in-example-is-not-working/22783/2 "2025-07-02T01:22:49Z")

</div>

Hi! Thanks for submitting a bug! I’ve triaged it with `uv` and hopefully someone will get back to you soon 🙂
