Skip to content

Permission denied for pythin libs in default installation #718

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
matyro opened this issue Apr 14, 2025 · 2 comments
Open

Permission denied for pythin libs in default installation #718

matyro opened this issue Apr 14, 2025 · 2 comments

Comments

@matyro
Copy link

matyro commented Apr 14, 2025

Hi,
I am currently trying to get some custom plots running for debugging purpose.
To install Matplotlib I simply added it to my /config/pyscript/requirements/... and get following error:

Unable to install package matplotlib: × Failed to build matplotlib==3.10.1├─▶ The build backend returned an error ╰─▶ Call tomesonpy.build_wheel failed (exit status: 1) [stderr] Traceback (most recent call last): File "<string>", line 11, in <module> wheel_filename = backend.build_wheel("/tmp/.tmpksdQ7D/builds-v0/.tmpAbW3Oq", {}, None) File "/tmp/.tmpksdQ7D/builds-v0/.tmpvlQaLO/lib/python3.13/site-packages/mesonpy/__init__.py", line 1020, in wrapper return func(*args, **kwargs) File "/tmp/.tmpksdQ7D/builds-v0/.tmpvlQaLO/lib/python3.13/site-packages/mesonpy/__init__.py", line 1073, in build_wheel with _project(config_settings) as project: ~~~~~~~~^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/contextlib.py", line 141, in __enter__ return next(self.gen) File "/tmp/.tmpksdQ7D/builds-v0/.tmpvlQaLO/lib/python3.13/site-packages/mesonpy/__init__.py", line 947, in _project yield Project(source_dir, build_dir, meson_args, editable_verbose) ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/.tmpksdQ7D/builds-v0/.tmpvlQaLO/lib/python3.13/site-packages/mesonpy/__init__.py", line 662, in __init__ self._meson = _get_meson_command(pyproject_config.get('meson')) ~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/tmp/.tmpksdQ7D/builds-v0/.tmpvlQaLO/lib/python3.13/site-packages/mesonpy/__init__.py", line 982, in _get_meson_command meson_version = subprocess.run(cmd + ['--version'], check=False, text=True, capture_output=True).stdout ~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 556, in run with Popen(*popenargs, **kwargs) as process: ~~~~~^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 1038, in __init__ self._execute_child(args, executable, preexec_fn, close_fds, ~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ pass_fds, cwd, env, ^^^^^^^^^^^^^^^^^^^ ...<5 lines>... gid, gids, uid, umask, ^^^^^^^^^^^^^^^^^^^^^^ start_new_session, process_group) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/local/lib/python3.13/subprocess.py", line 1974, in _execute_child raise child_exception_type(errno_num, err_msg, err_filename) PermissionError: [Errno 13] Permission denied: 'meson' hint: This usually indicates a problem with the package or the build environment.

Is this a known issue and how to avoid this?

Cheers
Dominik

@craigbarratt
Copy link
Member

The error is permission denied. From pathnames like /usr/local/lib/python3.13/subprocess.py it appears that HASS is not running inside a venv, so it's not surprising that HASS can't write to the system directories. You need to configure or run HASS in a manner that allows packages to be installed. Perhaps you could manually install them in whatever environment HASS is running?

@matyro
Copy link
Author

matyro commented Apr 15, 2025

This HASS is running on my test Pi 5 as default installation, pyscript was installed via HACS.
Can the Installation process be modified to directly create a venv?
Or can apps be automatically run in a specified venv (maybe defined in the yaml?

This would make things easier compared to patching it afterwards.
If I have time I may be able to look into it.

@matyro matyro changed the title Support for Matplotlib Permission denied for matplotlib in default installations Apr 15, 2025
@matyro matyro changed the title Permission denied for matplotlib in default installations Permission denied for pythin libs in default installation Apr 15, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants