mk-maddin / wattpilot-HA

This is a custom component to allow control of Fronius Wattpilot wallbox/electro vehicle charging devices in Homeassistant.
Apache License 2.0
59 stars 10 forks source link

How to install wattpilot phython module? #3

Closed thecem closed 2 years ago

thecem commented 2 years ago

"At the moment you will have to install the wattpilot python module manually to your HA instance in advance."

Is there a how to ? who could i install the phython module?

THX!

thecem commented 2 years ago

If I try, I get:

bash-5.1# pip install .
Processing /config/wattpilot
  Installing build dependencies ... error
  error: subprocess-exited-with-error

  × pip subprocess to install build dependencies did not run successfully.
  │ exit code: 1
  ╰─> [30 lines of output]
      Collecting pyyaml>=5.4.1
        Downloading PyYAML-6.0.tar.gz (124 kB)
           ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 125.0/125.0 KB 5.3 MB/s eta 0:00:00
        Installing build dependencies: started
        Installing build dependencies: finished with status 'done'
        Getting requirements to build wheel: started
        Getting requirements to build wheel: finished with status 'error'
        error: subprocess-exited-with-error

        × Getting requirements to build wheel did not run successfully.
        │ exit code: 1
        ╰─> [6 lines of output]
            running egg_info
            writing lib/PyYAML.egg-info/PKG-INFO
            writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
            writing top-level names to lib/PyYAML.egg-info/top_level.txt
            failed to import Cython: Error loading shared library /tmp/pip-build-env-dfpks9hd/overlay/lib/python3.9/site-packages/Cython/Compiler/Scanning.cpython-39-x86_64-linux-gnu.so: Operation not permitted
            error: Cython does not appear to be installed
            [end of output]

        note: This error originates from a subprocess, and is likely not a problem with pip.
      error: subprocess-exited-with-error

      × Getting requirements to build wheel did not run successfully.
      │ exit code: 1
      ╰─> See above for output.

      note: This error originates from a subprocess, and is likely not a problem with pip.
      WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
      You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: You are using pip version 22.0.3; however, version 22.0.4 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
bash-5.1# 
mk-maddin commented 2 years ago

Hi,

This depends on your Home Assistant setup. Are you using supervised? HA OS? Docker Container? Python VirtualEnv setup?

Independently of this my recommendation is to help pushing the corresponding pypi packaging I requested here ( https://github.com/joscha82/wattpilot/issues/3). Then you do not longer need to install it manually, but HA automatically does the installation from Pypi :)

Am Mi., 20. Apr. 2022 um 17:31 Uhr schrieb thecem @.***

:

"At the moment you will have to install the wattpilot python module https://github.com/joscha82/wattpilot manually to your HA instance in advance."

Is there a how to ? who could i install the phython module?

THX!

— Reply to this email directly, view it on GitHub https://github.com/mk-maddin/wattpilot-HA/issues/3, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALC6G2HXG7X3C4QRRL6HX6DVGAPNZANCNFSM5T4N5EZA . You are receiving this because you are subscribed to this thread.Message ID: @.***>

thecem commented 2 years ago

I use:

Version | core-2022.4.5 Installationstyp | Home Assistant OS

mk-maddin commented 2 years ago

Looks to me like you are trying to build & install. HA OS does not have the resources to build the python package, but can only install pre-build packages. That's not really a problem of wattpilot HA integration, but more of how to build the wattpilot python module created by @joscha82.

Independently of this what you can do is:

a) take another machine with full python installation b) download the wattpilot python module from: https://github.com/joscha82/wattpilot c) execute "python3 setup.py sdist bdist_wheel" within the downloaded folder d) copy the WHOLE downloaded folder over to your HA OS machine (including the newly created /dist folder from above command) e) install the module on your HA machine via: "pip3 install --force dist/wattpilot-*-py3-none-any.whl"

thecem commented 2 years ago

thx! Now I get following:

bash-5.1# pip3 install --force dist/wattpilot-*-py3-none-any.whl
Processing ./dist/wattpilot-0.0.1-py3-none-any.whl
Collecting PyYAML
  Using cached PyYAML-6.0.tar.gz (124 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... error
  error: subprocess-exited-with-error

  × Getting requirements to build wheel did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      running egg_info
      writing lib/PyYAML.egg-info/PKG-INFO
      writing dependency_links to lib/PyYAML.egg-info/dependency_links.txt
      writing top-level names to lib/PyYAML.egg-info/top_level.txt
      failed to import Cython: Error loading shared library /tmp/pip-build-env-1_bsrgig/overlay/lib/python3.9/site-packages/Cython/Compiler/Scanning.cpython-39-x86_64-linux-gnu.so: Operation not permitted
      error: Cython does not appear to be installed
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error

× Getting requirements to build wheel did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
bash-5.1# 
mk-maddin commented 2 years ago

Looks like the same issue, just with another package "PyYAML" instead of wattpilot itself.

Have you tried installing this dependency manually via: pip3 install pyyaml

If this does not work I expect you need to get the sources of pyyaml (should be this: https://github.com/yaml/pyyaml ), download to external machine, compile via pip3 compile and install then once again using the /dist/pyyaml*-.whl ...so same way as previously with wattpilot.

seems manual dependency installation on HA OS is much more complicated than on a usual python virtenv ^^ - sorry for this. As said the easiest solution would be to get the wattpilot package published into PyPi :/

mk-maddin commented 2 years ago

Should be fine now as https://github.com/joscha82/wattpilot/issues/3 was closed and python module is installed now automatically :)

thecem commented 2 years ago

Thx! A big step forward!