Hi - I have Docker installed and running (e.g. can run the hello world docker image), but when I try doing a local lean backtest still get the Please make sure Docker is installed and running issue.
Here's the output when running lean cli in verbose.
Thanks!
Traceback (most recent call last):
File "C:\Users\PC\AppData\Roaming\Python\Python36\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 "c:\programdata\anaconda3\lib\site-packages\lean\components\docker\docker_manager.py", line 427, in
_get_docker_client
docker_client = docker.from_env()
File "C:\Users\PC\AppData\Roaming\Python\Python36\site-packages\docker\client.py", line 101, in from_env
**kwargs_from_env(**kwargs)
File "C:\Users\PC\AppData\Roaming\Python\Python36\site-packages\docker\client.py", line 45, in __init__
self.api = APIClient(*args, **kwargs)
File "C:\Users\PC\AppData\Roaming\Python\Python36\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
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\programdata\anaconda3\lib\site-packages\lean\main.py", line 103, in main
lean.main(standalone_mode=False)
File "C:\Users\PC\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 782, in main
rv = self.invoke(ctx)
File "C:\Users\PC\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "c:\programdata\anaconda3\lib\site-packages\lean\click.py", line 125, in invoke
result = super().invoke(ctx)
File "C:\Users\PC\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "C:\Users\PC\AppData\Roaming\Python\Python36\site-packages\click\core.py", line 610, in invoke
return callback(*args, **kwargs)
File "c:\programdata\anaconda3\lib\site-packages\lean\commands\backtest.py", line 342, in backtest
container.update_manager().pull_docker_image_if_necessary(engine_image, update)
File "c:\programdata\anaconda3\lib\site-packages\lean\components\util\update_manager.py", line 95, in
pull_docker_image_if_necessary
if not force and self._docker_manager.image_installed(image):
File "c:\programdata\anaconda3\lib\site-packages\lean\components\docker\docker_manager.py", line 296, in
image_installed
docker_client = self._get_docker_client()
File "c:\programdata\anaconda3\lib\site-packages\lean\components\docker\docker_manager.py", line 429, in
_get_docker_client
raise error
lean.models.errors.MoreInfoError: Please make sure Docker is installed and running
Error: Please make sure Docker is installed and running
Visit https://www.lean.io/docs/lean-cli/user-guides/troubleshooting#02-Common-errors for more information
Louis Szeto
Hi Gui
It seems pywin32 is not installed, the following should fix it:
Also, please make sure you've updated to the most updated LEAN CLI version by pip install --upgrade lean and the python is not installed from the windows app store. If the above solution doesn't work, please uninstall and reinstall from scratch (doc).
Best
Louis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
Gui Reis
Thanks Louis - much appreciated.
Gui Reis
The material on this website is provided for informational purposes only and does not constitute an offer to sell, a solicitation to buy, or a recommendation or endorsement for any security or strategy, nor does it constitute an offer to provide investment advisory services by QuantConnect. In addition, the material offers no opinion with respect to the suitability of any security or specific investment. QuantConnect makes no guarantees as to the accuracy or completeness of the views expressed in the website. The views are subject to change, and may have become unreliable for various reasons, including changes in market conditions or economic circumstances. All investments involve risk, including loss of principal. You should consult with an investment professional before making any investment decisions.
To unlock posting to the community forums please complete at least 30% of Boot Camp.
You can continue your Boot Camp training progress from the terminal. We hope to see you in the community soon!