Skip to content

Added and documented pip support for installing packages.#14

Open
Paul-dH wants to merge 1 commit intotribut:masterfrom
Paul-dH:add_pip_support
Open

Added and documented pip support for installing packages.#14
Paul-dH wants to merge 1 commit intotribut:masterfrom
Paul-dH:add_pip_support

Conversation

@Paul-dH
Copy link
Copy Markdown

@Paul-dH Paul-dH commented Oct 16, 2020

I run HA in a docker environment and wanted to use HACS. Therefore I added pip support to the script and tested it.

Thought I'd share the addition to the script :)

@tribut
Copy link
Copy Markdown
Owner

tribut commented Oct 16, 2020

Thanks for your contribution!
Can you explain the use-case a bit more for me? Python packages should be installed by Homeassistant automatically according to the requirements of the respective compontents. I use HACS myself, and aiogithubapi (and others) are installed just fine.

@tribut tribut added the enhancement New feature or request label Oct 16, 2020
@Paul-dH
Copy link
Copy Markdown
Author

Paul-dH commented Oct 16, 2020

No problem :)

I'm currently busy setting up HA in docker on a Ubuntu server behind a reverse proxy. I kept getting permission errors so I landed at the community post where this repo was mentioned. After I changed the composefile and added the run script I saw that HA booted up and the only thing that failed were the python packages. That's why I added the ${PIP} part.

My composefile is like this:

version: '3.6'

services:
  homeassistant:
    image: homeassistant/home-assistant:stable
    container_name: home-assistant
    hostname: home-assistant
    restart: always
    ports:
      - '8123:8123'
      - '8943:8943'
    volumes:
      - ./config:/config
      - ./config/docker/run:/etc/services.d/home-assistant/run
    environment:
      - PUID=1000
      - PGID=1000
      - UMASK=007
      - PIP=aiogithubapi
    networks:
      - proxy-tier

networks:
  proxy-tier:
    external:
      name: proxy-tier

@tribut
Copy link
Copy Markdown
Owner

tribut commented Jul 14, 2021

I've tried to use your config, but cannot reproduce the problem. Have you by chance tried again without your changes since?
I understand this PR has been open a very long time, but since nobody else seems to be having problems with pip-packages I am really hesitant to add this without understanding what goes wrong...

@tribut tribut added the question Further information is requested label Jul 14, 2021
@evil-dog
Copy link
Copy Markdown

I have the same issues where Home Assistant tries to install pip packages and fails for permission denied.

These errors stem from 2 HACS custom integrations: frigate, AIO Schluter DITRA-HEAT-E WIFI

It appears that Home Assistant is trying to install these packages to the docker container's /usr/local/lib rather than in the venv.

After adding this pull request and adding the PIP env to my docker compose, everything now works.

home-assistant   |   2025-12-12 01:43:24.734 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package hass-we
b-proxy-lib==0.0.7: error: Failed to install: hass_web_proxy_lib-0.0.7-py3-none-any.whl (hass-web-proxy-lib==0.0.7)
home-assistant   |   Caused by: failed to create directory `/usr/local/lib/python3.13/site-packages/hass_web_proxy_lib`: Permi
ssion denied (os error 13)
home-assistant   | 2025-12-12 01:43:24.735 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'friga
te': Requirements for frigate not found: ['hass-web-proxy-lib==0.0.7'].
home-assistant   | 2025-12-12 01:43:54.835 ERROR (MainThread) [frontend.js.modern.202512032] Uncaught error from Chrome 142.0.
0.0 on Chrome OS 14541.0.0
home-assistant   |   2025-12-12 01:43:22.945 ERROR (SyncWorker_1) [homeassistant.util.package] Unable to install package aioschl
uter==0.1.9: error: Failed to install: aioschluter-0.1.9-py3-none-any.whl (aioschluter==0.1.9)
home-assistant   |   Caused by: failed to create directory `/usr/local/lib/python3.13/site-packages/aioschluter-0.1.9.dist-inf
o`: Permission denied (os error 13)
home-assistant   | 2025-12-12 01:43:22.945 ERROR (MainThread) [homeassistant.setup] Setup failed for custom integration 'schlu
ter': Requirements for schluter not found: ['aioschluter==0.1.9'].
home-assistant   | 2025-12-12 01:43:23.564 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package hass-we
b-proxy-lib==0.0.7: error: Failed to install: hass_web_proxy_lib-0.0.7-py3-none-any.whl (hass-web-proxy-lib==0.0.7)
home-assistant   |   Caused by: failed to create directory `/usr/local/lib/python3.13/site-packages/hass_web_proxy_lib`: Permi
ssion denied (os error 13)
home-assistant   | 2025-12-12 01:43:24.135 ERROR (SyncWorker_5) [homeassistant.util.package] Unable to install package hass-we
b-proxy-lib==0.0.7: error: Failed to install: hass_web_proxy_lib-0.0.7-py3-none-any.whl (hass-web-proxy-lib==0.0.7)
home-assistant   |   Caused by: failed to create directory `/usr/local/lib/python3.13/site-packages/hass_web_proxy_lib`: Permi
ssion denied (os error 13)

@hmoffatt
Copy link
Copy Markdown

It's a workaround rather than a fix though - you have to manually list the packages at that are required by the HACS components you've added, rather than having everything just work as it should.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request question Further information is requested

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants