1.拉取镜像,建立容器


kylin@kylin:/shujv/par$ sudo docker pull python:3.14.3
[sudo] kylin 的密码:
3.14.3: Pulling from library/python
1bd4defc8c5e: Pull complete 
cace8fbd9245: Pull complete 
bc8128ce97cc: Pull complete 
642b703f20ff: Pull complete 
bcc9a0bdacbc: Pull complete 
7150cbe43a7c: Pull complete 
4b75252fb560: Pull complete 
Digest: sha256:4b827abf32c14b7df9a0dc5199c2f0bc46e2c9862cd5d77eddae8a2cd8460f60
Status: Downloaded newer image for python:3.14.3
kylin@kylin:/shujv/par$ 

kylin@kylin:/shujv/par$ sudo docker run -itd -v /shujv/par:/par --net=host --name python3143 python:3.14.3
[sudo] kylin 的密码:
456cfe0c0e25ccdb542516f8b75dada111657175e1c5a1a311a117881e862cc9
kylin@kylin:/shujv/par$ sudo docker exec -it python3143 bash
root@kylin:/# pip list installed
Package Version
------- -------
pip     25.3


2.设置pip默认镜像为清华源

root@kylin:/# pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
Writing to /root/.config/pip/pip.conf
root@kylin:/# pip install databend
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting databend
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e5/79/d0a9ec4604ba822a19810f280a3a649df459666da84df1fe6ce9d9ac00d0/databend-1.2.810-cp312-abi3-manylinux_2_28_aarch64.whl (58.7 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 0.0/58.7 MB ? eta -:--:--
[notice] A new release of pip is available: 25.3 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.14/site-packages/pip/_internal/cli/base_command.py", line 107, in _run_wrapper
    status = _inner_run()
  File "/usr/local/lib/python3.14/site-packages/pip/_internal/cli/base_command.py", line 98, in _inner_run
    return self.run(options, args)
           ~~~~~~~~^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.14/site-packages/pip/_internal/cli/req_command.py", line 85, in wrapper
    return func(self, options, args)

  File "/usr/local/lib/python3.14/site-packages/pip/_internal/operations/prepare.py", line 121, in get_http_url
    from_path, content_type = download(link, temp_dir.path)


RuntimeError: can't start new thread


安装软件包报错。
网上查到了这个错误的原因是 docker版本过低(version 20.x)而容器对应的基础镜像版本过高,如Ubuntu22.04、Debian12等,执行程序时程序无法多线程执行。
3.按照文中的提示设置取消进度条

root@kylin:/# pip config --user set global.progress_bar off
Writing to /root/.config/pip/pip.conf
root@kylin:/# pip install duckdb
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting duckdb
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/2d/94/24364da564b27aeebe44481f15bd0197a0b535ec93f188a6b1b98c22f082/duckdb-1.4.4-cp314-cp314-manylinux_2_26_aarch64.manylinux_2_28_aarch64.whl (18.4 MB)
Installing collected packages: duckdb
Successfully installed duckdb-1.4.4
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

[notice] A new release of pip is available: 25.3 -> 26.0.1
[notice] To update, run: pip install --upgrade pip
root@kylin:/# pip install databend
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
Collecting databend
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/e5/79/d0a9ec4604ba822a19810f280a3a649df459666da84df1fe6ce9d9ac00d0/databend-1.2.810-cp312-abi3-manylinux_2_28_aarch64.whl (58.7 MB)
Installing collected packages: databend
Successfully installed databend-1.2.810
WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager, possibly rendering your system unusable. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv. Use the --root-user-action option if you know what you are doing and want to suppress this warning.

[notice] A new release of pip is available: 25.3 -> 26.0.1
[notice] To update, run: pip install --upgrade pip


可以安装软件包了。

Logo

腾讯云面向开发者汇聚海量精品云计算使用和开发经验,营造开放的云计算技术生态圈。

更多推荐