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

Can't run #49

Open
ravenomeo opened this issue Sep 29, 2020 · 12 comments
Open

Can't run #49

ravenomeo opened this issue Sep 29, 2020 · 12 comments

Comments

@ravenomeo
Copy link

ravenomeo commented Sep 29, 2020

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

@Littleweisheit
Copy link

Littleweisheit commented Oct 4, 2020

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'

@ravenomeo
Copy link
Author

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

@Littleweisheit
Copy link

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

I am using arch linux

@VasLem
Copy link

VasLem commented Oct 11, 2020

yes Location has been renamed to LocationInfo

@ravenomeo
Copy link
Author

Alright. 👍

@ordy
Copy link

ordy commented Oct 16, 2020

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 😅

@ravenomeo
Copy link
Author

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

@Littleweisheit
Copy link

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.

@Mennaruuk
Copy link

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?

@mystiquewolf
Copy link

mystiquewolf commented Feb 6, 2021

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.

@gitgnmn
Copy link

gitgnmn commented Jan 28, 2022

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.

@tio-trom
Copy link

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)

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