这个问题与这个和这个有关。我正在尝试在新创建的 python 虚拟环境中安装和运行 docker(-compose):
$ mkdir temp_venv
$ cd temp_venv
$ virtualenv venv
$ source venv/bin/activate
(venv) $ pip list
pip (8.1.2)
setuptools (21.2.2)
wheel (0.29.0)
docker-compose通过 pip 安装成功,但是当我尝试安装 docker 时抛出以下错误:
(venv) $ pip install docker
Collecting docker
Could not find a version that satisfies the requirement docker (from versions: )
No matching distribution found for docker
尝试使用--pre标志集进行安装会返回相同的错误。此外,当尝试在 venv 中运行 docker 时,会出现以下错误:
WARNING: The "bootstrap" service specifies a port on the host. If multiple containers for this service are created on a single host, the port will clash.
ERROR: Couldn't connect to Docker daemon. You might need to install Docker:
使用pip2安装docker -compose会产生相同的错误(docker 也是如此:
Collecting docker
Retrying (Retry(total=4, connect=None, read=None, redirect=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.python.org', port=443): Read timed out. (read timeout=15)",)': /simple/docker/
Could not find a version that satisfies the requirement docker (from versions: )
No matching distribution found for docker
).