OpenBB
OpenBB copied to clipboard
[Bug] Docker Mac M1 - Getting started
Describe the bug Just getting started with OpenBB terminal using Docker on my M1 Mac and I get the following Error
/home/python/openbb_terminal/helper_classes.py:361: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure.
plt.show()
To Reproduce Followed the documentation installation steps and tried running the following
2023 Jan 08, 17:31 (๐ฆ) /stocks/ $ load AMZN
Loading Daily data for AMZN with starting period 2020-01-06.
Company: Amazon.com, Inc. Exchange: NASDAQ/NMS (GLOBAL MARKET) Currency: USD
AMZN Performance
โโโโโโโโโณโโโโโโโโโณโโโโโโโโโโณโโโโโโโโโโโณโโโโโโโโณโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโโโโโโโณโโโโโโโโโโโโโ โ 1 Day โ 1 Week โ 1 Month โ 1 Year โ YTD โ Volatility (1Y) โ Volume (10D avg) โ Last Price โ โกโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฉ โ 1.1 % โ 2.26 % โ -2.46 % โ -47.63 % โ 0.3 % โ 50.22 % โ 65.09 M โ 86.08 โ โโโโโโโโโดโโโโโโโโโดโโโโโโโโโโดโโโโโโโโโโโดโโโโโโโโดโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโโโโโโโดโโโโโโโโโโโโโ
2023 Jan 08, 17:31 (๐ฆ) /stocks/ $ candle
/home/python/openbb_terminal/helper_classes.py:361: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. plt.show()
2023 Jan 08, 17:31 (๐ฆ) /stocks/ $ /home/python/openbb_terminal/menu.py:43: UserWarning: Matplotlib is currently using agg, which is a non-GUI backend, so cannot show the figure. pyplot.pause(0.1)
Desktop (please complete the following information):
- OS: Ventura
- Python version - docker image so should be whatever ghcr.io/openbb-finance/openbbterminal/openbb:2.1.0 comes with
Additional context XQuartz is installed and running
You can change this in the terminal,
/settings/backend MacOSX
or you can add this to your .env file:
OPENBB_BACKEND='MacOSX'
Unfortunately I'm now seeing this error:
โ openbb xhost +$IP; docker compose run -e DISPLAY=$IP:0 openbb
access control disabled, clients can connect from any host
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
Traceback (most recent call last):
File "/home/python/terminal.py", line 2, in <module>
from openbb_terminal import terminal_controller
File "/home/python/openbb_terminal/terminal_controller.py", line 27, in <module>
from openbb_terminal.terminal_helper import is_packaged_application
File "/home/python/openbb_terminal/terminal_helper.py", line 22, in <module>
from openbb_terminal import thought_of_the_day as thought
File "/home/python/openbb_terminal/thought_of_the_day.py", line 11, in <module>
from openbb_terminal.helper_funcs import get_user_agent
File "/home/python/openbb_terminal/helper_funcs.py", line 55, in <module>
matplotlib.use(cfgPlot.BACKEND)
File "/home/python/.cache/pypoetry/virtualenvs/openbb-K8M3siuK-py3.10/lib/python3.10/site-packages/matplotlib/__init__.py", line 1129, in use
name = validate_backend(backend)
File "/home/python/.cache/pypoetry/virtualenvs/openbb-K8M3siuK-py3.10/lib/python3.10/site-packages/matplotlib/rcsetup.py", line 255, in validate_backend
else _validate_standard_backends(s))
File "/home/python/.cache/pypoetry/virtualenvs/openbb-K8M3siuK-py3.10/lib/python3.10/site-packages/matplotlib/rcsetup.py", line 82, in __call__
raise ValueError(msg)
ValueError: "'macosx'" is not a valid value for backend; supported values are ['GTK3Agg', 'GTK3Cairo', 'GTK4Agg', 'GTK4Cairo', 'MacOSX', 'nbAgg', 'QtAgg', 'QtCairo', 'Qt5Agg', 'Qt5Cairo', 'TkAgg', 'TkCairo', 'WebAgg', 'WX', 'WXAgg', 'WXCairo', 'agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']; remove quotes surrounding your string
Here's what I've tried:
I have a .env file next to my docker-compose.yaml with the following set:
OPENBB_BACKEND='MacOSX'
Tried adding the env directly to the docker-compose.yml file
version: '3.8'
services:
openbb:
environment:
- DISPLAY=host.docker.internal:0.0
- OPENBB_BACKEND='MacOSX'
volumes:
- ~/OpenBBUserData:/home/python/OpenBBUserData
- ~/.openbb_terminal:/home/python/.openbb_terminal
platform: linux/amd64
image: ghcr.io/openbb-finance/openbbterminal/openbb:2.1.0
stdin_open: true # docker run -i
tty: true # docker run -t
I've also tried making the change in the terminal with the same result as before

you will need to exit and restart the terminal before the changes take place. also something else which may be contributing is that your docker compose file is requesting Linux/AMD64 for the platform, which is not MacOSX, Darwin/AMD64
Thanks for the feedback. I'm just following along with the installation instructions here:
https://docs.openbb.co/terminal/quickstart/installation?tab=docker#14-pull-and-run-the-container
I was wondering about the platform property but didn't see anything in the docs. Unfortunately, when I try to change that to Darwin/amd64 I'm now seeing this error:
โ openbb xhost +$IP; docker compose run -e DISPLAY=$IP:0 openbb
access control disabled, clients can connect from any host Error response from daemon: image with reference ghcr.io/openbb-finance/openbbterminal/openbb:2.1.0 was found but does not match the specified platform: wanted darwin/amd64, actual: linux/amd64
When testing the env settings, I definitely killed the container and recreated it.
Any other ideas?
@Chavithra might have some wisdom to share.
If it is a Linux environment, try adding this to the docker compose file:
extra_hosts:
- "host.docker.internal:host-gateway"
Then running with this instead :
xhost +local:
docker compose run openbb
Sorry, I'm confused by your comment.
Per the installation instructions, I'm downloading the docker-compose.yml file here: https://raw.githubusercontent.com/OpenBB-finance/OpenBBTerminal/main/build/docker/docker-compose.yaml
The platform is set as platform: linux/amd64
I'm unsure what you mean by: If it is a Linux environment..."
The docker image that is referenced in the instructions is a linux environment. The platform that you mentioned, Darwin/amd64 doesn't seem to exist.
Do you know if the docker instructions were tested on Mac? My docker-compose file now looks like this:
version: '3.8'
services:
openbb:
environment:
- DISPLAY=host.docker.internal:0.0
- OPENBB_BACKEND='MacOSX'
volumes:
- ~/OpenBBUserData:/home/python/OpenBBUserData
- ~/.openbb_terminal:/home/python/.openbb_terminal
platform: linux/amd64
image: ghcr.io/openbb-finance/openbbterminal/openbb:2.1.0
stdin_open: true # docker run -i
tty: true # docker run -t
extra_hosts:
- "host.docker.internal:host-gateway"
And running
โ openbb xhost +local:
docker compose run openbb
returns:
non-network local connections being added to access control list
<jemalloc>: MADV_DONTNEED does not work (memset will be used instead)
<jemalloc>: (This is the expected behaviour if you are running under QEMU)
Traceback (most recent call last):
File "/home/python/terminal.py", line 2, in <module>
from openbb_terminal import terminal_controller
File "/home/python/openbb_terminal/terminal_controller.py", line 27, in <module>
from openbb_terminal.terminal_helper import is_packaged_application
File "/home/python/openbb_terminal/terminal_helper.py", line 22, in <module>
from openbb_terminal import thought_of_the_day as thought
File "/home/python/openbb_terminal/thought_of_the_day.py", line 11, in <module>
from openbb_terminal.helper_funcs import get_user_agent
File "/home/python/openbb_terminal/helper_funcs.py", line 55, in <module>
matplotlib.use(cfgPlot.BACKEND)
File "/home/python/.cache/pypoetry/virtualenvs/openbb-K8M3siuK-py3.10/lib/python3.10/site-packages/matplotlib/__init__.py", line 1129, in use
name = validate_backend(backend)
File "/home/python/.cache/pypoetry/virtualenvs/openbb-K8M3siuK-py3.10/lib/python3.10/site-packages/matplotlib/rcsetup.py", line 255, in validate_backend
else _validate_standard_backends(s))
File "/home/python/.cache/pypoetry/virtualenvs/openbb-K8M3siuK-py3.10/lib/python3.10/site-packages/matplotlib/rcsetup.py", line 82, in __call__
raise ValueError(msg)
ValueError: "'macosx'" is not a valid value for backend; supported values are ['GTK3Agg', 'GTK3Cairo', 'GTK4Agg', 'GTK4Cairo', 'MacOSX', 'nbAgg', 'QtAgg', 'QtCairo', 'Qt5Agg', 'Qt5Cairo', 'TkAgg', 'TkCairo', 'WebAgg', 'WX', 'WXAgg', 'WXCairo', 'agg', 'cairo', 'pdf', 'pgf', 'ps', 'svg', 'template']; remove quotes surrounding your string
โ openbb
We have moved to plolty on develop!