#Installation Error `uv` on macOS

1 messages · Page 1 of 1 (latest)

cedar lotus
#

I 'm getting this error on macOS as I'm installing dependencies when running uv sync --all-extras The error error: Distribution torch==2.5.1 @ registry+https://pypi.org/simple can't be installed because it doesn't have a source distribution or wheel for the current platform I tried different solutions like in this thread https://github.com/astral-sh/uv/issues/8746#issuecomment-2451678707. But no success. Any suggestions?

GitHub

The situation is the following: I work on workloads that usually require GPUs. The problem is these machines are expensive (usually use VMs), so I try to do as much as possible on my laptop, a Mac ...

cedar lotus
#

<@&1153754985344016546> Hello?! I need to solve this to work on my PR please.

thorn ether
#

Oh I had this issue before, can you try this pytoml using this struct for torch?

...
requires-python = ">=3.12"
dependencies = [
...
    "torch>=2.5.1",
...
]

[tool.uv.sources]
torch = [
  { index = "pytorch-cpu", marker = "platform_system == 'Windows'" },
  { index = "pytorch-cu124", marker = "platform_system == 'Linux'" },
]
torchvision = [
  { index = "pytorch-cpu", marker = "platform_system == 'Windows'" },
  { index = "pytorch-cu124", marker = "platform_system == 'Linux'" },
]

[[tool.uv.index]]
name = "pytorch-cpu"
url = "https://download.pytorch.org/whl/cpu"
explicit = true

[[tool.uv.index]]
name = "pytorch-cu124"
url = "https://download.pytorch.org/whl/cu124"
explicit = true

from docs this worked for me
https://docs.astral.sh/uv/guides/integration/pytorch/#configuring-accelerators-with-environment-markers

#

It's because pytorch doesn't have a apple arm build, so when UV tries to do a sync it fails. This will force UV to use the cpu version

cedar lotus
#

Thanks a lot

thorn ether
cedar lotus
#

I'm checking it right now

cedar lotus
#

Well it worked by using the PEP508 format in the [project.dependencies] like this ```

name = "project"
version = "0.1.0"
requires-python = ">=3.12"
dependencies = [
  "torch>=2.5.1 ; platform_system == 'Linux' and platform_machine == 'x86_64'",
  "torchvision>=0.20.1 ; platform_system == 'Linux' and platform_machine == 'x86_64'",
]```
#

Is it ok for poe check to fail like this I didn't do anything but pulling the latest version error: Import "azure.core.exceptions" could not be resolved python/packages/agbench/src/agbench/run_cmd.py:17:35 - error: Type of "ClientAuthenticationError" is unknown ....

thorn ether
#

neat, but the error doesn't look like a torch error anymore?

cedar lotus
#

Yeah that’s after the poe check

thorn ether
#

yeah based on that it might be you are missing a dependency

#

did you install the azure package using

uv add $pip-package-name
cedar lotus
#

I installed the missing packages and upgraded the AG2 repository and all imports broke

#

Example autogen/python/packages/autogen-magentic-one/examples/example_websurfer.py:40:27 - error: Type of "try_get_underlying_agent_instance" is unknown (reportUnknownMemberType)

steep pilot
# cedar lotus I installed the missing packages and upgraded the AG2 repository and all imports...

magentic-one support is on the way. cc @dusk fossil
In the mean while, check CaptainAgent: https://www.youtube.com/watch?v=laGZmQUolBY
cc <@&1203410105123733514>

AG2

Introducing CaptainAgent in AG2 v0.4—your AI team architect that makes agent orchestration seamless and intelligent.

In this video, see how CaptainAgent:
• Analyzes complex tasks and recommends optimal roles
• Autonomously builds and optimizes agent teams in real time
• Dynamically assembles teams during conversations
• Delegates tasks smar...

▶ Play video
dusk fossil
#

Are you using autogen (v0.4) or ag2?

The path looks like an autogen import 'autogen/python/packages/autogen-magentic-one/examples/example_websurfer.py:40:27 - error: Type of "try_get_underlying_agent_instance" is unknown (reportUnknownMemberType)'

Unless you are trying to use the magentic one implementation, that is still in development (hopefully done next week) and not in the main branch, the fact that magentic one gets imported also lets me think you are installing autogen (v0.4). (Same with agbench)

Are you using this repo? https://github.com/ag2ai/ag2

GitHub

AG2 (formerly AutoGen): The Open-Source AgentOS. Join us at: https://discord.gg/pAbnFJrkgZ - ag2ai/ag2

cedar lotus
#

Well! I realized I was using autogen. But I cloned ag2 last night and I'm setting up the docker container right now