AutomaThemely icon indicating copy to clipboard operation
AutomaThemely copied to clipboard

Can't run

Open ravenomeo opened this issue 3 years ago • 12 comments

There's a bug in the code. The updsuntimes.py script tries to import Location.py, but the module is saved as "location.py" which gives an importation error. Simply due to Uppercase and Lowercase management(L and l). You can change every instance of Location to location, or you can just rename location.py to Location.py(Don't know if the latter works though.

Edit: So after fixing that in mine, turns out when you run automathemely from terminal, you get a "Module not callable error" from line 66 of updsuntimes.py (location=Location()). I fixed this by changing it to (location=Location.Location()). Hope this helps

ravenomeo avatar Sep 29 '20 07:09 ravenomeo

I still cant work Traceback (most recent call last): File "/usr/bin/automathemely", line 33, in sys.exit(load_entry_point('AutomaThemely==1.3', 'console_scripts', 'automathemely')()) File "/usr/lib/python3.8/site-packages/automathemely/bin/run.py", line 80, in main automathemely.autoth_tools.argmanager.main(user_settings) File "/usr/lib/python3.8/site-packages/automathemely/autoth_tools/argmanager.py", line 99, in main from . import settsmanager File "/usr/lib/python3.8/site-packages/automathemely/autoth_tools/settsmanager.py", line 4, in gi.require_version('Gtk', '3.0') AttributeError: module 'gi' has no attribute 'require_version'

Littleweisheit avatar Oct 04 '20 08:10 Littleweisheit

What version of python do you have and what distro are you running it on?

ravenomeo avatar Oct 04 '20 11:10 ravenomeo

What version of python do you have and what distro are you running it on?

I am using arch linux

Littleweisheit avatar Oct 07 '20 03:10 Littleweisheit

yes Location has been renamed to LocationInfo

VasLem avatar Oct 11 '20 14:10 VasLem

Alright. 👍

ravenomeo avatar Oct 11 '20 15:10 ravenomeo

Managed to run it on arch after replacing all the location with Location in /usr/lib/python3.8/site-packages/automathemely/autoth_tools/updsuntimes.py

But now I'm getting a sun_times error when running the application from terminal:

  File "/usr/lib/python3.8/site-packages/automathemely/bin/run.py", line 96, in main
    with open(get_local('sun_times'), 'rb') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/<username>/.config/automathemely/sun_times'

Edit:

Think I got it running now. In autoth_tools/updsuntimes.py

  • Reverted my previous changes from Location to location
  • imported from astral import LocationInfo like suggested above
  • imported from astral.sun import sun
  • changed line 66 location = Location() to location = LocationInfo()
  • changed line 76 and 77
sunrise = location.sun()['sunrise'].replace(second=0) + timedelta(minutes=us_se['offset']['sunrise'])
sunset = location.sun()['sunset'].replace(second=0) + timedelta(minutes=us_se['offset']['sunset'])

to

sunrise = sun(location.observer)['sunrise'].replace(second=0) + timedelta(minutes=us_se['offset']['sunrise'])
sunset = sun(location.observer)['sunset'].replace(second=0) + timedelta(minutes=us_se['offset']['sunset'])

Now I got my sun_times in .config folder and my theme changed to the light variant.

Oh, just noticed that the pending PR https://github.com/C2N14/AutomaThemely/pull/41 does exactly the same thing :sweat_smile:

ordy avatar Oct 16 '20 14:10 ordy

Lol. I'm glad we all got it to work in the end

ravenomeo avatar Oct 16 '20 16:10 ravenomeo

Managed to run it on arch after replacing all the location with Location in /usr/lib/python3.8/site-packages/automathemely/autoth_tools/updsuntimes.py

But now I'm getting a sun_times error when running the application from terminal:

  File "/usr/lib/python3.8/site-packages/automathemely/bin/run.py", line 96, in main
    with open(get_local('sun_times'), 'rb') as file:
FileNotFoundError: [Errno 2] No such file or directory: '/home/<username>/.config/automathemely/sun_times'

Edit:

Think I got it running now. In autoth_tools/updsuntimes.py

* Reverted my previous changes from `Location` to `location`

* imported `from astral import LocationInfo` like suggested above

* imported `from astral.sun import sun`

* changed line 66 `location = Location()` to `location = LocationInfo()`

* changed line 76 and 77
sunrise = location.sun()['sunrise'].replace(second=0) + timedelta(minutes=us_se['offset']['sunrise'])
sunset = location.sun()['sunset'].replace(second=0) + timedelta(minutes=us_se['offset']['sunset'])

to

sunrise = sun(location.observer)['sunrise'].replace(second=0) + timedelta(minutes=us_se['offset']['sunrise'])
sunset = sun(location.observer)['sunset'].replace(second=0) + timedelta(minutes=us_se['offset']['sunset'])

Now I got my sun_times in .config folder and my theme changed to the light variant.

Oh, just noticed that the pending PR #41 does exactly the same thing sweat_smile

I do as you say still dont work.But I install python-gobject(sudo pacman -S python-gobject),Its finally worked.

Littleweisheit avatar Oct 16 '20 16:10 Littleweisheit

Unfortunately, I tried doing everything on this page, but alas, nothing worked. AutomaThemely refuses to run. I'm currently on Manjaro (XFCE) 20.1.2. Can an update fix this issue?

Mennaruuk avatar Nov 06 '20 18:11 Mennaruuk

I do as you say still dont work.But I install python-gobject(sudo pacman -S python-gobject), Its finally worked.

  • In Ubuntu repos python-gobject seems to be for python 2.7.
  • There is a package python3-gi which i believe is the python 3 alternative, which is installed by default in Ubuntu 20.04
  • I also tried python3.6 -m pip install --user pygobject but it also is already installed.

Still got the ImportError: cannot import name '_gi' This is with the replaced file from pull request #41 I'm giving up and subscribing here.

mystiquewolf avatar Feb 06 '21 13:02 mystiquewolf

I do as you say still dont work.But I install python-gobject(sudo pacman -S python-gobject), Its finally worked.

* In Ubuntu repos python-gobject seems to be for python 2.7.

* There is a package python3-gi which i believe is the python 3 alternative, which is installed by default in Ubuntu 20.04

* I also tried `python3.6 -m pip install --user pygobject` but it also is already installed.

Still got the ImportError: cannot import name '_gi' This is with the replaced file from pull request #41 I'm giving up and subscribing here.

You can fix this by changing gi to pgi and installing pgi in your venv. As long as the problem is that it can't find the gi module (you mention '_gi'?). I think this should bypass any need for other packages for gi functionality. Not sure what the pros and cons are with this solution compared to using system dependencies and continue using gi though.

Edit: Just saw the date... I'll leave this here if anyone else stumbles through.

gitgnmn avatar Jan 28 '22 19:01 gitgnmn

Same here cannot start it

~ >>> automathemely                                                            
Traceback (most recent call last):
  File "/usr/bin/automathemely", line 33, in <module>
    sys.exit(load_entry_point('AutomaThemely==1.3', 'console_scripts', 'automathemely')())
  File "/usr/lib/python3.10/site-packages/automathemely/bin/run.py", line 29, in main
    from automathemely.autoth_tools import argmanager, extratools, envspecific, updsuntimes
  File "/usr/lib/python3.10/site-packages/automathemely/autoth_tools/updsuntimes.py", line 8, in <module>
    from astral import Location
ImportError: cannot import name 'Location' from 'astral' (/usr/lib/python3.10/site-packages/astral/__init__.py)

tio-trom avatar Mar 14 '22 19:03 tio-trom