Skip to content
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

"Entity not available: camera.skyfield" after update to HA 2024.2.0 #24

Open
rzantengmail opened this issue Feb 7, 2024 · 25 comments
Open

Comments

@rzantengmail
Copy link

The picture element does nog loaf anymore and shows: Entity not available: camera.skyfield

@mdisabato
Copy link

I can confirm this. I have uninstalled and reinstalled from HACS and I get the same message: Entity not available: camera.skyfield. I have also done a reboot (not just a restart) and that had no effect.

Configuration entries:

camera:

  • platform: ha_skyfield
    show_constellations: false
    show_time: true
    show_legend: true
    north_up: true

Thank you.

@rzantengmail
Copy link
Author

Screenshot_2024-02-07-22-41-45-191_io homeassistant companion android

Maybe this helps...

@mdisabato
Copy link

Unless you are running this:

"Download the prerequisites: pip3 install skyfield matplotlib numpy (no longer necessary with hassio!)"

If you are running Home Assistant OS, I do not believe there is a way to add any extra OS-level software that is not an add-on or that comes from HACS.

In any event, I loaded this from HACS which should have loaded everything it needed.

@nanobra1n
Copy link

HA2024.2.0 switched over to Python 3.12 and nor HA is now complaining about not being able to install matplotlib:

024-02-07 20:07:25.404 ERROR (SyncWorker_13) [homeassistant.util.package] Unable to install package matplotlib: error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [579 lines of output]
      
      Edit mplsetup.cfg to change the build options; suppress output with --quiet.
      
      BUILDING MATPLOTLIB
            python: yes [3.12.1 (main, Jan  4 2024, 09:41:05) [GCC 13.2.1 20231014]]
          platform: yes [linux]
             tests: no  [skipping due to configuration]
            macosx: no  [Mac OS-X only]
      
      /usr/local/lib/python3.12/site-packages/setuptools/__init__.py:80: _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
      !!
      
              ********************************************************************************
              Requirements should be satisfied by a PEP 517 installer.
              If you are using pip, you can try `pip install --use-pep517`.
              ********************************************************************************
      
      !!
        dist.fetch_build_eggs(dist.setup_requires)
      [02/07/24 20:07:22] WARNING  toml section missing        pyproject_reading.py:42
                                   'pyproject.toml does not
                                   contain a
                                   tool.setuptools_scm
                                   section'
      /tmp/pip-install-gjyslv4b/matplotlib_47bff5baec7f4639a80a2380ed0ce77f/.eggs/setuptools_scm-8.0.4-py3.12.egg/setuptools_scm/git.py:308: UserWarning: git archive did not support describe output
        warnings.warn("git archive did not support describe output")
      /tmp/pip-install-gjyslv4b/matplotlib_47bff5baec7f4639a80a2380ed0ce77f/.eggs/setuptools_scm-8.0.4-py3.12.egg/setuptools_scm/git.py:327: UserWarning: unprocessed git archival found (no export subst applied)
        warnings.warn("unprocessed git archival found (no export subst applied)")
      /usr/local/lib/python3.12/site-packages/setuptools/dist.py:674: SetuptoolsDeprecationWarning: The namespace_packages parameter is deprecated.
      !!
      
              ********************************************************************************
              Please replace its usage with implicit namespaces (PEP 420).
      
              See https://setuptools.pypa.io/en/latest/references/keywords.html#keyword-namespace-packages for details.
              ********************************************************************************
      
      !!
        ep.load()(self, ep.name, value)

I got it working by getting into the homeassistant container (using the Advanced SSH & Web Terminal add-on) and calling docker exec -it homeassistant /bin/bash (see https://developers.home-assistant.io/docs/operating-system/debugging/)

From inside the container bash command line I installed matplotlib by calling pip3 install --use-pep517 matplotlib, restarted and now it's working.

YMMV

@mdisabato
Copy link

mdisabato commented Feb 8, 2024

Will that survive the next Core/OS/Supervisor update?

@timothybuchanan
Copy link

On my HA, not only is the entity now unavailable, but the lines in configuration.yaml cause HA to hang indefinitely when checking before restart. Commenting out the lines allows HA to restart.

@nanobra1n
Copy link

@mdisabato should survive OS/Supervisor, Core ¯\_(ツ)_/¯
@timothybuchanan : it took longer for me than usual, but eventually allowed me to proceed

@rzantengmail
Copy link
Author

thanks @nanobra1n!

I did the same and it is working again :)

@mdisabato
Copy link

I followed the directions. The install spewed a lot of errors (please see attached file) and matplotlib evidently failed to load. The system is at the latest patch level - 2024.2.1. This is not a real high priority for me right now. If someone has time to look at the log, thank you. Otherwise, I'll wait until the next release.

Thank you very much.

matplotlib error.txt

@nanobra1n
Copy link

@mdisabato: Sorry, something must be different on your system than mine. Your error message now complains about numpy, which I don't see.
Also, the fix did not survive the update to 2024.2.1, I had to redo it. Hoping that @partofthething will find a way to fix this.

@mdisabato
Copy link

@nanobra1n: Thank you for taking a look. To be honest, I am not a coder of modern languages. If you have a COBOL app, I'm you're man. :) I can read the code and get and idea of what it's doing, but if you ask me to make any changes, it's "deer in the headlights" time. grins

@danielbrunt57
Copy link

Will that survive the next Core/OS/Supervisor update?

OS - Yes
Supervisor - Yes
Core - No as that is the homeassistant container and will be completely replaced by the next release of Home Assistant. You'll have to pip3 install --use-pep517 matplotlib after every core update (~ 4 times a month)!

@partofthething
Copy link
Owner

partofthething commented Feb 10, 2024

Hmmm thanks for the reports folks. Sorry for the trouble. On python 3.12 there may be a more restrictive combination of numpy and matplotlib versions that I'll have to specify in https://github.com/partofthething/ha_skyfield/blob/master/custom_components/ha_skyfield/manifest.json in order to keep it working nicely with all the installation options.

Looks like some other components are experiencing similar issues: jugla/worldtidesinfocustom#26

@partofthething
Copy link
Owner

On my HA, not only is the entity now unavailable, but the lines in configuration.yaml cause HA to hang indefinitely when checking before restart. Commenting out the lines allows HA to restart.

This may be because your machine is attempting to compile matplotlib and numpy from source rather than using one of the pre-built binaries.. Depending on your hardware that could take a very long time, which would look like a hang, and may end up failing after hanging for a long time.

Not a solution, but just wanted to mention.

@commentsonly
Copy link

yep and the problem is (x86 NUC) that the compilation ends up with an error.
What irritated me more is that there's no way to "temporarily" disable ha_skyfield .. which would prevent the machine trying to re-compile the plotlob on each attempt to validate yaml / restart HA.
I removed the ha_skyfiled folder from the custom_components .. I also have no camera: ..... left in the configuration.yaml and I can't find any leftovers anywhere within the HA configurations but it still moans about "Platform error 'camera' from integration 'ha_skyfield' - Requirements for ha_skyfield not found: ['matplotlib']." and I run of ideas on how to get that solved.
Perhaps you have a guideline on how to remove it until there's a working solution?

@timothybuchanan
Copy link

Just comment out the lines in configuration.yaml, like so:

#camera:

- platform: ha_skyfield

show_constellations: false

@danielbrunt57
Copy link

danielbrunt57 commented Feb 14, 2024

Exactly. That's all I did as well. The HACS integration is still installed and system is working fine now.

#camera:
#  - platform: ha_skyfield
#    show_constellations: false

@tarheelz
Copy link

tarheelz commented Feb 18, 2024

Commenting out the integration removes the error but now you don't have a skyfield image entity correct?

@danielbrunt57
Copy link

danielbrunt57 commented Feb 19, 2024

Commenting out the integration removes the error but now you don't have a skyfield image entity correct?

Correct. But since the integration is currently not working correctly which is causing issues starting HA, that's the only option at this point until the code is changed.

Hmmm thanks for the reports folks. Sorry for the trouble. On python 3.12 there may be a more restrictive combination of
numpy and matplotlib versions that I'll have to specify in
https://github.com/partofthething/ha_skyfield/blob/master/custom_components/ha_skyfield/manifest.json in order to keep it
working nicely with all the installation options.

Looks like some other components are experiencing similar issues: jugla/worldtidesinfocustom#26

@nanobra1n
Copy link

It's fixed for me in 2024.2.3 which contains:
Remove matplotlib pinning due to Python 3.12 incompatibility (@sbyx - #110706)

@mdisabato
Copy link

Nope. Didn't work for me.
Uploading IMG_0079.png…

@danielbrunt57
Copy link

danielbrunt57 commented Feb 24, 2024

@mdisabato It looks like your image did not finish uploading?
image

@danielbrunt57
Copy link

danielbrunt57 commented Feb 24, 2024

Did not work for me either...

Logger: homeassistant.config
Source: config.py:1293
First occurred: 7:21:09 PM (1 occurrences)
Last logged: 7:21:09 PM

Platform error: camera - Requirements for ha_skyfield not found: ['matplotlib'].

So, even though I should not have to as per docs...

Download the prerequisites: pip3 install skyfield matplotlib numpy (no longer necessary with hassio!)

I did it anyway...

homeassistant:/config# pip3 install --use-pep517 matplotlib

but it still fails...

Looking in indexes: https://pypi.org/simple, https://wheels.home-assistant.io/musllinux-index/
Collecting matplotlib
  Downloading matplotlib-3.8.3.tar.gz (35.9 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 35.9/35.9 MB 95.4 MB/s eta 0:00:00
  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
  ╰─> [123 lines of output]
      /tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools_scm/git.py:308: UserWarning: git archive did not support describe output
        warnings.warn("git archive did not support describe output")
      /tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools_scm/git.py:327: UserWarning: unprocessed git archival found (no export subst applied)
        warnings.warn("unprocessed git archival found (no export subst applied)")
      /tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools_scm/_integration/setuptools.py:90: UserWarning: version of matplotlib already set
        warnings.warn(f"version of {dist_name} already set")
      
      Edit mplsetup.cfg to change the build options; suppress output with --quiet.
      
      BUILDING MATPLOTLIB
            python: yes [3.12.1 (main, Jan  4 2024, 11:43:50) [GCC 13.2.1 20231014]]
          platform: yes [linux]
             tests: no  [skipping due to configuration]
            macosx: no  [Mac OS-X only]
      
      running egg_info
      writing lib/matplotlib.egg-info/PKG-INFO
      writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt
      writing requirements to lib/matplotlib.egg-info/requires.txt
      writing top-level names to lib/matplotlib.egg-info/top_level.txt
      Traceback (most recent call last):
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/core/__init__.py", line 24, in <module>
          from . import multiarray
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/core/multiarray.py", line 10, in <module>
          from . import overrides
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/core/overrides.py", line 8, in <module>
          from numpy.core._multiarray_umath import (
      ImportError: Error loading shared library /tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/core/_multiarray_umath.cpython-312-aarch64-linux-musl.so: Operation not permitted
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/__init__.py", line 130, in <module>
          from numpy.__config__ import show as show_config
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/__config__.py", line 4, in <module>
          from numpy.core._multiarray_umath import (
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/core/__init__.py", line 50, in <module>
          raise ImportError(msg)
      ImportError:
      
      IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
      
      Importing the numpy C-extensions failed. This error can happen for
      many reasons, often due to issues with your setup or how NumPy was
      installed.
      
      We have compiled some common reasons and troubleshooting tips at:
      
          https://numpy.org/devdocs/user/troubleshooting-importerror.html
      
      Please note and check the following:
      
        * The Python version is: Python3.12 from "/usr/local/bin/python"
        * The NumPy version is: "1.26.4"
      
      and make sure that they are the versions you expect.
      Please carefully study the documentation linked above for further help.
      
      Original error was: Error loading shared library /tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/core/_multiarray_umath.cpython-312-aarch64-linux-musl.so: Operation not permitted
      
      
      The above exception was the direct cause of the following exception:
      
      Traceback (most recent call last):
        File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 353, in <module>
          main()
        File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 335, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
                                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/usr/local/lib/python3.12/site-packages/pip/_vendor/pyproject_hooks/_in_process/_in_process.py", line 118, in get_requires_for_build_wheel
          return hook(config_settings)
                 ^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 325, in get_requires_for_build_wheel
          return self._get_build_requires(config_settings, requirements=['wheel'])
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 295, in _get_build_requires
          self.run_setup()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/build_meta.py", line 311, in run_setup
          exec(code, locals())
        File "<string>", line 279, in <module>
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/__init__.py", line 103, in setup
          return distutils.core.setup(**attrs)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 185, in setup
          return run_commands(dist)
                 ^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/core.py", line 201, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/dist.py", line 963, in run_command
          super().run_command(command)
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/dist.py", line 988, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 321, in run
          self.find_sources()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 329, in find_sources
          mm.run()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 550, in run
          self.add_defaults()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/command/egg_info.py", line 588, in add_defaults
          sdist.add_defaults(self)
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/command/sdist.py", line 102, in add_defaults
          super().add_defaults()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 251, in add_defaults
          self._add_defaults_ext()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/command/sdist.py", line 335, in _add_defaults_ext
          build_ext = self.get_finalized_command('build_ext')
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 305, in get_finalized_command
          cmd_obj.ensure_finalized()
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/setuptools/_distutils/cmd.py", line 111, in ensure_finalized
          self.finalize_options()
        File "<string>", line 80, in finalize_options
        File "/tmp/pip-install-cnorkwdo/matplotlib_52f14ac9f22b424997a97c9cc253e92b/setupext.py", line 403, in get_extensions
          add_numpy_flags(ext)
        File "/tmp/pip-install-cnorkwdo/matplotlib_52f14ac9f22b424997a97c9cc253e92b/setupext.py", line 511, in add_numpy_flags
          import numpy as np
        File "/tmp/pip-build-env-cjsw2wr6/overlay/lib/python3.12/site-packages/numpy/__init__.py", line 135, in <module>
          raise ImportError(msg) from e
      ImportError: Error importing numpy: you should not try to import numpy from
              its source directory; please exit the numpy source tree, and relaunch
              your python interpreter from there.
      [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.

@mdisabato
Copy link

Nope. Didn't work for me.
Uploading IMG_0079.png…

@mdisabato
Copy link

I tried this "pip3 install --use-pep517 matplotlib" again and got a message it needs to be run in a VENV. Is there any permanent way to get this working again?

Thank you.

Michael

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

8 participants