Skip to content

Missing socksio dependency causes ImportError when using SOCKS proxy #47

@Explorer1092

Description

@Explorer1092

Description

When running the strands command with a SOCKS proxy configured, the application fails with an ImportError due to missing socksio package.

Error Message

ImportError: Using SOCKS proxy, but the 'socksio' package is not installed. Make sure to install httpx using `pip install httpx[socks]`.

Full Traceback

Traceback (most recent call last):
  File "/Users/user/.local/bin/strands", line 3, in <module>
    from strands_agents_builder.strands import main
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/strands_agents_builder/__init__.py", line 3, in <module>
    from . import handlers, models, utils
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/strands_agents_builder/models/__init__.py", line 6, in <module>
    from . import bedrock, ollama
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/strands_agents_builder/models/ollama.py", line 6, in <module>
    from strands.models.ollama import OllamaModel
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/strands/models/ollama.py", line 10, in <module>
    import ollama
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/ollama/__init__.py", line 40, in <module>
    _client = Client()
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/ollama/_client.py", line 116, in __init__
    super().__init__(httpx.Client, host, **kwargs)
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/ollama/_client.py", line 93, in __init__
    self._client = client(
      base_url=_parse_host(host or os.getenv('OLLAMA_HOST')),
      **kwargs,
    )
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/httpx/_client.py", line 700, in __init__
    else self._init_proxy_transport(
        proxy,
        limits=limits,
    )
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/httpx/_client.py", line 750, in _init_proxy_transport
    return HTTPTransport(
        verify=verify,
        proxy=proxy,
    )
  File "/Users/user/.local/pipx/venvs/strands-agents-builder/lib/python3.13/site-packages/httpx/_transports/default.py", line 191, in __init__
    raise ImportError(
        "Using SOCKS proxy, but the 'socksio' package is not installed. "
        "Make sure to install httpx using `pip install httpx[socks]`."
    ) from None
ImportError: Using SOCKS proxy, but the 'socksio' package is not installed. Make sure to install httpx using `pip install httpx[socks]`.

Environment

  • Python: 3.13
  • Installation method: pipx
  • OS: macOS Darwin 24.6.0

Workaround

The issue can be resolved by manually injecting the missing dependency:

pipx inject strands-agents-builder socksio

Suggested Fix

Consider adding socksio as an optional dependency or including it in the base dependencies if SOCKS proxy support is intended. Alternatively, update the installation instructions to mention this requirement for users who need SOCKS proxy support.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions