#1468 ImportError: Using SOCKS proxy, but the 'socksio' package is not installed. Make sure to install httpx using `pip instal

220.130* Posted at: 2 hours ago 👁9

网络连接失败:Traceback (most recent call last):
File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/util/TestSrtTrans.py", line 19, in run

text:List[dict] = translator.run(translate_type=self.translator_type,

File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/translator/__init__.py", line 924, in run

return DeepSeek(**kwargs).run()

File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/translator/_base.py", line 83, in run

raise e.last_attempt.exception()

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/tenacity/__init__.py", line 480, in call

result = fn(*args, **kwargs)

File "/Users/peijingbo/MyCode/pyvideotrans/videotrans/translator/_deepseek.py", line 53, in _item_task

model = OpenAI(api_key=self.api_key, base_url=self.api_url)

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/openai/_client.py", line 166, in init

super().__init__(

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/openai/_base_client.py", line 864, in init

self._client = http_client or SyncHttpxClientWrapper(

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/openai/_base_client.py", line 794, in init

super().__init__(**kwargs)

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/httpx/_client.py", line 697, in init

self._mounts: dict[URLPattern, BaseTransport | None] = {

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/httpx/_client.py", line 700, in

else self._init_proxy_transport(

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/httpx/_client.py", line 750, in _init_proxy_transport

return HTTPTransport(

File "/Users/peijingbo/MyCode/pyvideotrans/venv/lib/python3.10/site-packages/httpx/_transports/default.py", line 191, in init

raise ImportError(

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


=
system:macOS-26.1-arm64-arm-64bit
version:v3.84
frozen:False
language:zh
root_dir:/Users/peijingbo/MyCode/pyvideotrans
Python: 3.10.19 (main, Oct 9 2025, 15:25:03) [Clang 17.0.0 (clang-1700.3.19.1)]

1 Replies

这个错误是由于您的系统中缺少 socksio 包导致的。当您设置了 SOCKS 代理但未安装必要的依赖包时,就会出现这个问题。

请按以下步骤解决:

  1. 打开终端(Terminal)。
  2. 激活您运行 pyVideoTrans 的 Python 虚拟环境(如果使用了虚拟环境)。
  3. 执行以下命令安装缺失的依赖:

    pip install httpx[socks]

    或者,如果上述命令失败,可以尝试分别安装:

    pip install socksio
    pip install httpx

安装完成后,重新启动 pyVideoTrans 即可。

Post Your Reply
Open source and free maintenance is not easy. If this project is helpful to you, please consider making a small donation to help the project continue to maintain and update.

Donate: https://ko-fi.com/jianchang512

Trending Questions