NationalSecurityAgency / qgis-earthsunmoon-plugin

QGIS plugin to show the location of the sun, moon, and planets at their zenith for a particular date and time.
GNU General Public License v2.0
30 stars 5 forks source link

zoneinfo package also needs to be installed on Anaconda #2

Open thayeray opened 1 year ago

thayeray commented 1 year ago

After installing the 'timezonefinder' and 'skyfield' packages the 'zoneinfo' package was still missing, so the additional algorithms still did not work. In Anaconda I was able to install 'zoneinfo' under the name 'backports.zoneinfo', I then modified the plugin code to import from 'backports.zoneinfo' not 'zoneinfo'. I use MacOS.

hamiltoncj commented 12 months ago

I was surprised that zoneinfo was missing. I thought that would be standard with the QGIS Python 3.9+. Can you give me the details on what you did to make it work. I could add that to the instructions and potentially use try/except around import zoneinfo. I don't want to use pytz because it is in essence being deprecated. It is already missing some of the time zones that zoneinfo supports.

thayeray commented 12 months ago

I am on MacOS for the M1 (ARM not Intel) processor. The Anaconda QGIS is compiled for M1 so it is better for me than the installers on the QGIS website. I used the GUI For Anacaonda (Anaconda-Navigator) to install backports.zoneinfo (0.2.1) that had several dependencies that were also installed. I then changed references in the plugin's .py files to import from backports.zoneinfo (functions.py, planetpositions.py, sunposition.py, moonposition.py, infoDialog.py). For example for infoDialog.py:

from backports.zoneinfo import ZoneInfo, available_timezones

When I did that the icons appear in the QGIS toolbar, and all tools work except for the Solar/lunar information tool, which does not do anything (no dialog is opened when I click on it). I even checked to see if the dialog appeared behind the main QGIS window, which it does not. The log messages panel shows only Python warnings for depricated use of numpy matrices. I have not investigated further. -Thayer

On Anaconda (for MacOS M1) I need to install backports.zoneinfo and to change your plugin code  to import from backports.zoneinfo instead of 'zoneinfo'. When I did that the icons appear in the QGIS toolbar.

On Monday, September 25, 2023 at 09:57:36 AM EDT, C Hamilton ***@***.***> wrote:  

I was surprised that zoneinfo was missing. I thought that would be standard with the QGIS Python 3.9+. Can you give me the details on what you did to make it work. I could add that to the instructions and potentially use try/except around import zoneinfo. I don't want to use pytz because it is in essence being deprecated. It is already missing some of the time zones that zoneinfo supports.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>