I tried building activity watch from scratch, to see if that help with my issue #208
I get the following error, seems to be a decoding problem:
make --directory=aw-core build DEV=
make[1]: Entering directory '/opt/activitywatch/aw-core'
pip3 install . -r requirements.txt --upgrade
Processing /opt/activitywatch/aw-core
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-req-build-y10quhhg/setup.py", line 14, in
exec(f.read(), about)
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 386: ordinal not in range(128)Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-req-build-y10quhhg/
make[1]: * [Makefile:10: build] Error 1
make[1]: Leaving directory '/opt/activitywatch/aw-core'
make: * [Makefile:33: build] Error 2
I'm running the build on archlinux wtih python 3.6.5. Are there any dependencies not mentioned in the _Install from source_ guide I might be missing?
It seems that it fails at this part:
about = {} # type: Any
with open(os.path.join(base_dir, "aw_core", "__about__.py")) as f:
exec(f.read(), about)
Manually adding the about data and then running make build again should quick-fix it so you can go on finding the bug for the other issue :smiley:
about = {}
about["__title__"] = "aw-core"
about["__summary__"] = "Core library for ActivityWatch"
about["__uri__"] = "https://github.com/ActivityWatch/aw-core"
about["__version__"] = "0.4.1"
about["__author__"] = "Erik Bj盲reholt, Johan Bj盲reholt"
about["__email__"] = "[email protected], [email protected]"
about["__license__"] = "MPL2"
about["__copyright__"] = "Copyright 2017 %s" % about["__author__"]
# with open(os.path.join(base_dir, "aw_core", "__about__.py")) as f:
# exec(f.read(), about)
This probably occurs for aw-core, aw-research and aw-server, so you'll likely need to change it in all three setup.py files.
But of course we should still investigate why it doesn't work for you. But I can't do that right now.
I guess that it can't decode "Bj盲reholt"
So... please change your surnames @ErikBjare @johan-bjareholt :stuck_out_tongue:
Cant't test it, but this could possibly fix it:
with open(os.path.join(base_dir, "aw_core", "__about__.py"), 'r', encoding='utf-8') as f:
exec(f.read(), about)
Might be something with your system configuration (it should try to read the file as unicode and not ascii), but here's a fix that should hopefully resolve the issue that we could apply globally:
Replace the lines in setup.py that @Otto-AA mentioned with:
import codecs
with codecs.open(os.path.join(base_dir, "aw_core", "__about__.py"), encoding="utf-8") as f:
exec(f.read(), about)
Edit: I now see that @Otto-AA beat me to it, try his first!
Personally I believe that you both might be wrong, encoding=None is the default which calls locale.getprefferedencoding() which should on any sane OS should be "UTF-8".
Prior to python3 the encoding was always "ascii" by default, so my assumption here is that while he has python3 installed it is actually running inside a python2 instance which he probably also has installed. You can see in setup.py that we have written #!/usr/bin/env python which on most systems (with a exception on fedora and arch) would default to python2 rather than python3, so if he is simply running it with ./setup.py install it is highly likely that this is in python2. We should replace this with #!/usr/bin/env python3
Okay I am wrong, it explicitly says right in the log message that it runs on python3.6
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
Thanks for the quick suggestions!
I modified ./aw-server/setup.py and ./aw-core/setup.py with the suggestion from @Otto-AA, there is no aw-research after cloning the repo though.
The build continues now, but there still is a problem when building the client:
make[1]: Entering directory '/opt/activitywatch/aw-client'
pip3 install . -r requirements.txt --upgrade
Processing /opt/activitywatch/aw-client
Collecting aw-core from git+https://github.com/ActivityWatch/aw-core.git@master#egg=aw-core (from -r requirements.txt (line 1))
Cloning https://github.com/ActivityWatch/aw-core.git (to master) to /tmp/pip-build-qvod5moe/aw-core
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 1, in
File "/tmp/pip-build-qvod5moe/aw-core/setup.py", line 14, in
exec(f.read(), about)
File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
return codecs.ascii_decode(input, self.errors)[0]
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 386: ordinal not in range(128)
Edit:
From the output it looks like it's cloning the aw-core again and that build isn't working without the modified setup.py?
You can try it again after removing the first line of the requirements.txt file in aw-core and aw-server. (this line)
Maybe that helps...
Yeah, what @Otto-AA wrote should work. But I just pushed https://github.com/ActivityWatch/aw-core/commit/c29d28a8a0b634c1b51d639f2bc018c7b9498a75 which should just make things work without any changes on your side @pahofmann
I pulled the lastest version for aw-server and aw-core, now the build went though fine.
Thanks for the quick help!
Any tips on how to further troubleshoot #208 would be much appreciated.
Most helpful comment
Yeah, what @Otto-AA wrote should work. But I just pushed https://github.com/ActivityWatch/aw-core/commit/c29d28a8a0b634c1b51d639f2bc018c7b9498a75 which should just make things work without any changes on your side @pahofmann