Hi. I figure I'd try some i3pystatus modules so I try the clock example first..
i3pystatus clock {
module = 'clock'
format = [ ('%a %b %-d %b %X', 'America/New_York'), ('%X', 'Etc/GMT+9') ]
}
... and got this exception.
2018-07-26 21:24:58 WARNING Exception in `i3pystatus clock`
post_config_hook() (AttributeError) i3pystatus.py line 266.
2018-07-26 21:24:58 INFO Traceback
AttributeError: module 'i3pystatus' has no attribute 'Status'
File "/py3status/py3status/module.py", line 133, in prepare_module
self.module_class.post_config_hook()
File "/py3status/py3status/modules/i3pystatus.py", line 266, in post_config_hook
status = i3pystatus.Status()
I can do all this okay.
Python 3.6.6
>>> import i3pystatus
>>> i3pystatus.Status()
<i3pystatus.core.Status object at 0x7fd98ca55a58>
>>> import tobes
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'tobes'
The last one is for except ImportError: --> except (ImportError, ModuleNotFoundError). Thanks. :no_entry_sign:
I think this is a naming issue. can you give more details like exactly how it is running and especially what the working directory is. You are importing the py3status module not the actual package
I've just checked and it works for me - there was a different bug that I've fixed
I order += two different i3pystatus modules in my config and that was it for both. I was trying them to see if things are still working okay. I have i3pystatus installed via AUR (Arch Linux). I'll try this again later. I also have a local copy of i3pystatus in ~/src next to py3status.
the config is not the issue it is the __working directory__ py3status is running in and what the paths are like.
did you get this working?
Still happening. I hadn't looked at this yet. Will be on IRC later. Gotta go for an hour.
ok it is all about your code layout and where you run py3status from. The other option is just to rename the module
I'm on IRC right now if you want to troubleshoot this issue with me. And merge other things.
Okay... Renaming i3pystatus module didn't work at first. It turns out that I am still using py3status2. We could catch this error just in case...
I changed it back to py3status... Still no good. Renaming to i3pystatus_test... does the job.
I don't know about my code layout and where I run py3status from as I always used the same sudo python3 setup.py develop and I installed i3pystatus via aur/i3pystatus.
/usr/bin/py3status
/usr/bin/i3pystatus
Could it be because I'm on Python 3.7.0 now?
@cyrinux Hi. Can you see if you're experiencing this problem too on your machine?
where I run py3status from
not where it is installed as such but the directory you are in when you run py3status. The issue is all about PYTHON_PATH ie where python is looking for the module, because it finds the wrong file. renaming the module stops the name conflict so maybe we should consider that. But really I'd like my config rewriter merged first and it is still just a local branch
$ python -c "import sys; print('\n'.join(sys.path))"
/usr/lib/python37.zip
/usr/lib/python3.7
/usr/lib/python3.7/lib-dynload
/home/chris/.local/lib/python3.7/site-packages
/usr/lib/python3.7/site-packages
/home/chris/src/py3status
EDIT: I'll look in them.
EDIT:
[/usr/lib/python3.7]
./site-packages/i3pystatus-3.35-py3.7.egg-info
./site-packages/i3pystatus.egg-link
./site-packages/i3pystatus
/usr/lib/python3.7/site-packages/i3pystatus/ is owned by i3pystatus r1721.0d7156b-1
/usr/lib/python3.7/site-packages/i3pystatus-3.35-py3.7.egg-info/ is owned by i3pystatus r1721.0d7156b-1
error: No package owns /usr/lib/python3.7/site-packages/i3pystatus.egg-link
Owned by i3pystatus r1721.0d7156b-1.
EDIT: I still have this issue after uninstalling i3pystatus.
i3pystatus clock {
module = 'clock'
format = [ ('%a %b %-d %b %X', 'America/New_York'), ('%X', 'Etc/GMT+9') ]
}
@lasers this works well for me
Hmm. Instead of renaming module and breaking people's configs, I'll nuke my machine sooner or later. In the meanwhile, I can stick with renamed module. @cyrinux Thanks for testing this. :+1: