gcalcli
gcalcli copied to clipboard
pip3 install on Ubuntu 20.04 breaks
Did pip3 install gcalcli
Runs this:
urxvt -fn "-*-terminus-medium-*-*-*-16-*-*-*-*-*-*-*" -e sh -c "/usr/local/bin/gcalcli --calendar [email protected]\#yellow --calendar [email protected]\#white --lineart unicode calw now 13 --monday --military --width 33 --color-date white | less -R"
Gets this:
Traceback (most recent call last):
File "/usr/local/bin/gcalcli", line 11, in <module>
load_entry_point('gcalcli==4.3.0', 'console_scripts', 'gcalcli')()
File "/usr/local/lib/python3.8/dist-packages/gcalcli-4.3.0-py3.8.egg/gcalcli/cli.py", line 167, in main
File "/usr/local/lib/python3.8/dist-packages/gcalcli-4.3.0-py3.8.egg/gcalcli/gcal.py", line 1282, in CalQuery
File "/usr/local/lib/python3.8/dist-packages/gcalcli-4.3.0-py3.8.egg/gcalcli/gcal.py", line 487, in _GraphEvents
TypeError: can't concat str to bytes
Seems like you've found a bug, but I'm not able to repro this on my debian system. I'm using python 3.8.3 and I installed urxvt in order to try out your command exactly. I obviously had to use different calendars, though. In any case, this works as expected for me, no crash.
Are you able to create a simpler repro case? You're running a specific terminal with a specific font, a specifc shell in that terminal, gcalcli with a whole bunch of specific options, and then piping the output to a pager. Maybe you could boil this down a bit?
For example, I suppose that you'll have the same issue with this command:
/usr/local/bin/gcalcli --calendar [email protected]\#yellow --calendar [email protected]\#white --lineart unicode calw now 13 --monday --military --width 33 --color-date white
In order to work on this, the first step for me is to repro the situation.
I also get the same error, even while running
/usr/local/bin/gcalcli --calendar [email protected]\#yellow --calendar [email protected]\#white --lineart unicode calw now 13 --monday --military --width 33 --color-date white
OS: Manjaro Terminal emulator: xfce4-terminal Python: 3.8.3 gcalcli: 4.3.0
-
I recommend always using
python3.8 -m pipand never simplypip3. In the past I have had a lot of problems with the command-linepiptools not connecting to the Python distribution I thought they were. -
Debian does not play super-well with pip, in my experience. After struggling for a while trying to get a good setup for installing system packages with
pipon Ubuntu, I now recommend using virtual environments to install anything you need from pip. For example on my Ubuntu 20.04 system I have thepython3-pipandpython3-venvDebian packages installed and then can use:
activate_bin="$HOME/venv/python3/bin/activate"
if [ ! -f "$activate_bin" ]; then
python3 -m venv --system-site-packages ~/venv/python3
fi
. "$activate_bin"
After the activation script is run, any uses of pip within that shell installs stuff in ~/venv/python3 instead of /usr/local/bin.