RedisTimeSeries icon indicating copy to clipboard operation
RedisTimeSeries copied to clipboard

Default to `python3` in make system or document how to switch

Open dpipemazo opened this issue 3 years ago • 3 comments

Building from source, had a quite difficult time running on a system without python2 installed and without having to install Python2.

Since I had my own Python3 pre-installed, this was the best way to get it to build:

python3 system-setup.py
make build MK.pyver=3

Without the MK.pyver=3 the make errored out since it was checking for python2 dependencies. It wasn't well-documented how to work around this and the workaround was discerned by looking at the Makefiles in readies and looking through the code for examples of it being set.

It might be easier to default to Python3 in general, but also likely worth documenting how to install on a system with Python3.

dpipemazo avatar Mar 04 '21 00:03 dpipemazo

Python2 is not involved at all. You're not supposed to be specifying MK.pyver on the command line. For RedisTimeSeries, it's only supposed to work with what's in the Makefile, which is MK.pyver:=3.

Note that ./deps/readies/bin/getpy3 not only verifies installation of Python 3 and pip, but also installs a few packages required for the build process, so one shouldn't skip it even if Python 3 is available on the system.

Please try to reproduce your experience in a Docker container. Something like:

docker run -it -v /home/user/:/home/user ubuntu:focal bash

Then go into /home/me/RedisTimeSeries (assuming it's there) and do:

./deps/readies/bin/getpy3
./system-setup.py
make

rafie avatar May 06 '21 12:05 rafie

This was done in a Dockerfile. The dependency is in the deps submodule, see here

I think another issue that might be happening here is I didn't use getpy3, since I already have python3 installed. I had some issues with the getpy3 script (even with python pre-installed) and didn't want it conflicting with my pre-installed python/pip/venv. As such, I skipped this step, just ran system-setup and then make build.

See Dockerfile here.

Perhaps I used the build system incorrectly, but I don't think it's unreasonable and I'm pretty sure there's a dependency on python2 when used in this fashion.

dpipemazo avatar May 06 '21 13:05 dpipemazo

@dpipemazo what getpy3 basically does is to establish Python and pip on any reasonable(/supported) platform, and then install packages from ./deps/readies/paella/requirements.txt via pip. So if you have python & pip already set up, you can simply do python3 -m pip install -r ./deps/readies/paella/requirements.txt and everything will work as expected. I think it's a good idea to enable something like JUSTREQ=1 ./getpy3 to enable such behavior. Also, since your Dockerfile contains quite a few installation processes, it is a good practice to perform the RedisTimeSeries installation within a virtualenv.

rafie avatar May 06 '21 18:05 rafie