My requirements file initially contained cyhunspell==2.0.2 but this isn’t available so I dropped the version part. And now I get this error:
RuntimeError: Package hunspell was not found in the pkg-config search path.
Perhaps you should add the directory containing `hunspell.pc’
to the PKG_CONFIG_PATH environment variable
Package ‘hunspell’, required by ‘virtual:world’, not found
I then added python_version: 3.9.13 to README.md and it still fails like before.
So I turned on debug mode and used the online VsCode to try to run commands in the terminal. The first thing I noticed is that python --version returns Python 3.10.13 but I’m expecting 3.9.13. I can’t install 3.9.13 in the terminal as I don’t have permission. I get the same errors in the terminal that I saw in the log files.
So I’m totally stuck. Please help!
I can’t be sure because I can’t see the source for Spaces, but I think you need to manually install the hunspell package using apt get.
You can use subprocess or Docker.
If it’s built into HF, you only need to write hunspell in packages.txt, but I think it’s probably not built in. This method is sufficient for major libraries like ffmpeg.
I think the reason Python 3.10 is returned is probably because dev mode is dedicated to Python 3.10.
The default for HF is 3.10, and Zero GPU space is basically dedicated to 3.10, but I think it is also possible that dev mode is the same.
Hi John,
Thanks a mill for that. I put hunspell in packages.txt and it seems it is built in. It was building fine until it gets to cyhunspell in requirements.txt, and then it fails again as per before. I also added other dependencies to pre-requirements.txt, and switched back to default python version. So I’m still stuck.
The odd thing is that I can create a subfolder with the files including requirements.txt and then use a debug online VsCode terminal to cd into ~/app/subfolder; I can then pip install the contents of pre-requirements.txt and then run
pip install --editable .
This then installs everything without errors. Hmmm, I’d love to know why is works in debug but not in the App environment???
I’m glad it was included. If it works in the debug environment (dev mode), it should probably work, but that’s strange.
You should think of the pre-requirements.txt file in HF as being effectively dedicated to upgrading pip.
The fact that it works when it’s in a subfolder is still strange. If there is a conflict with the default file in Spaces, etc., you may be able to get it to work by doing subprocess.run(“pip install cyhunspell”, shell=True) in app.py.