theOehrly / Fast-F1

FastF1 is a python package for accessing and analyzing Formula 1 results, schedules, timing data and telemetry
https://docs.fastf1.dev
MIT License
2.54k stars 264 forks source link

DOC: Added installation required for local packaging #641

Closed wocampodev closed 1 month ago

wocampodev commented 1 month ago

Added details to the documentation for installing C and C++ binaries before attempting to contribute to the project

theOehrly commented 1 month ago

IMO, this really shouldn't be necessary. There is no C or C++ code in FastF1. Therefore, there is nothing to compile in the FastF1 source code. Can you please go into more detail about what problem you encountered on which OS?

wocampodev commented 1 month ago

Certainly, it's not strictly necessary, but for some reason, when packaging Fast-F1 within a virtual environment to use editable mode, as mentioned in the documentation with the command python -m pip install -e . I encountered an error related to missing some GNU libraries. Therefore, in the case of Windows, I had to install the Build Tools.

image

This image is for reference, showing the same error description that appeared for me.

This probably happened because some internal dependency of Fast-F1 needs to be compiled to C code beforehand. Perhaps I should change the description in the contribution to give it a sense of a recommendation instead of presenting it as a strictly necessary step that must be taken?

theOehrly commented 1 month ago

Ok, I'm sorry to be a bit of a pain here, but things just don't line up for me here yet. And I'd like to figure out the root cause of this issue before just merging some kind of workaround.

So first off, pip should simply use prebuilt wheels for the dependencies, also when installing FastF1 in editable mode. In your case, it seems that pip instead used a source distribution for at least one of the dependencies. That's why there suddenly is a need for a C/C++ compiler. The most pressing question here is why? Is there some incompatibility in how I specified dependency versions, maybe specific to python version and os version and type? In that case, the same problem could occur for non-development installs and should be fixed properly. I can't require normal users to install development tools for a standard installation.

Second, I really want to avoid installing development tools. I can mainly speak for Windows and somewhat for Linux here. But in my opinion, this is rarely a streamlined experienced, depending on your knowledge and also, you may run into compatibility issues with already installed compilers and development tools. Finally, telling people to just install any version of MSVC build tools for some dependency is somewhat hit or miss because these dependencies can require specific versions of those build tools. So overall, the suggestion to install build tools is a shot in the blue to maybe fix a problem where we don't know what the problem even really is.

You are talking about Windows and virtual environments. But then the screenshot shows you using WSL, meaning Linux, and from the looks of it there is no Python virtualenv activated?

I just tried to reproduce this in a fresh install of Ubuntu 22.04.03 LTS 64bit with WSL on Windows 10. The preinstalled version of Python was 3.10.12, almost matching your version of 3.10.15. Everything worked fine and no compiler/build tools installation was necessary to complete the development install.

Would it be possible to get the full log somehow? Can you go into more detail, what OS and Python version you are using?