QuantConnect / lean-cli

CLI for running the LEAN engine locally and in the cloud
https://www.lean.io/cli
Apache License 2.0
194 stars 99 forks source link

'NpipeHTTPAdapter' error when it needs the docker #13

Closed cordmaur closed 3 years ago

cordmaur commented 3 years ago

Hi, I've successfully installed lean-cli on windows and the coding, autocompletition and cloud backtesting are working fine. The problem is when I need to prepare data or run a local backtest. Although my Docker is up and running, I keep receiving the Docker error: Error: Please make sure Docker is installed and running

When I use the verbose option, it shows:

Traceback (most recent call last):
  File "d:\programs\anaconda\envs\fastai\lib\site-packages\docker\api\client.py", line 159, in __init__
    self._custom_adapter = NpipeHTTPAdapter(
NameError: name 'NpipeHTTPAdapter' is not defined

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "d:\programs\anaconda\envs\fastai\lib\site-packages\lean\components\docker\docker_manager.py", line 307, in _get_docker_client
    docker_client = docker.from_env()
  File "d:\programs\anaconda\envs\fastai\lib\site-packages\docker\client.py", line 101, in from_env
    **kwargs_from_env(**kwargs)
  File "d:\programs\anaconda\envs\fastai\lib\site-packages\docker\client.py", line 45, in __init__
    self.api = APIClient(*args, **kwargs)
  File "d:\programs\anaconda\envs\fastai\lib\site-packages\docker\api\client.py", line 165, in __init__
    'Install pypiwin32 package to enable npipe:// support'
docker.errors.DockerException: Install pypiwin32 package to enable npipe:// support

Pypwin32 has been installed manually with pip. Tried running other containers and docker seems to be Ok. No other clue from the internet.

Any ideas?

Thanks Mauricio

cordmaur commented 3 years ago

Found the answer in this thread: https://stackoverflow.com/questions/54147852/docker-python-client-support-for-window-10

There is a problem running Python 3.6/3.7 and pypiwin32 224. The following command solved the issue: pip install pypiwin32==220