ctreffe / alfred

Alfred - A library for rapid experiment development
MIT License
10 stars 1 forks source link

Dependency Error When Installing alfred3 With Python 3.10 on Windows #161

Closed ctreffe closed 2 years ago

ctreffe commented 2 years ago

Currently, the alfred3 installation via pip on Windows may throw the following error message:

error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": https://visualstudio.microsoft.com/visual-cpp-build-tools/

The message is caused by a failed compilation of the cmarkgfm dependency when the Microsoft C++ Build Tools are not installed (which is the case for many systems I suppose). Since the Installation of the required components may require up to 6gb worth of downloads and components (e.g., the windows sdk), we need a better solution.

One workaround is to install the dependency from binaries via a .whl file. For example, such binaries can be downloaded from this unofficial source and the required download only has 135kb.

After downloading the binaries, the installation is done via pip:

# change to the directory to which you downloaded the binaries first

C:\Path-to-File> pip install cmarkgfm-0.6.0-cp310-cp310-win_amd64.whl

After installing _cmarkgfm separately, the alfred3 installation can be completed without error.

After establishing an adequate workaround for the current situation, I created this issue to find a more sustainable solution. Currently, I see two options: We could either find a new dependency to replace cmarkgfm, or we could try to automate the download and installation via binaries in case of packages that need local compilation on Windows in the future. I think we should investigate the second option to account for the possibility of other dependencies requiring this workaround in the future (seems to me that these problems may arise again for specific combinations of Python 3 and an alfred3 dependency).

What do you think, @jobrachem?

ctreffe commented 2 years ago

This was a temporary error caused by dependencies for which pip could not fetch binaries, but instead wanted to compile a package.