Environment: macOS Catalina 10.15.4
Python Version: 3.8.2 installed through pyenv
TL;DR solution:
You need to install libmemcached - brew install libmemcached if you are using homebrew. If not, first install homebrew using instructions on https://brew.sh and then execute brew install libmemcached
Exact error observed and Solution used is as posted on this StackOverflow question. Posting this here for ease of finding for new contributors (like myself )
If you encounter an error during the installation, your system might be missing a dependency for one or more of the Python packages. Consult the failing packageâs documentation or search the Web with the error message that you encounter.
I wonder if we should document these? I guess the problem is there are 17 main dependencies at the moment and that crossed with the various operating systems makes a lot of potential commands to run.
Hey @adamchainz, thanks for sharing context and link to documentation.
I agree, calling out every single command to run to install all the dependencies is probably not a maintainable approach, however I like the idea of just documenting these dependencies in the running-all-the-tests section so new contributors do not find it overwhelming when they see an unknown/unrelated issue pop up and do not feel discouraged in the newly started journey of contributing to Django.
This also aligns with the thought, calling out commands to run might require a lot of regular updates to the documentation since the commands might change or internal dependencies for packages might change as the dependencies themselves evolve however the fact that they are a dependency for Django tests to run, is under Djangoâs control hence just calling out the names of dependencies wonât be a too big off a task to achieve and maintain.
If you can make a documentation patch thatâs not too big, Iâd like to see it. I know at least the memcached headers thing has been the same for years since memcached is very stable.
I had a similar problem when I was following the PostGIS documentation for Windows. Itâd definitely be nice to have a clear idea of what the dependencies for each system are, not the exact commands or the steps to take.
Iâll start working on a documentation patch. Let me know what the exact dependencies for macOS are and Iâll add them.
Thanks @adamchainz I searched for libmemcached on Django Trac to ensure no one else is already working or has worked in the past and found this comment by Tim Graham:
Iâm not a mac OS user so I canât say for sure what the issue is here. What does âit always show problems in installing pylibmc and libmemcachedâ mean? My guess is that the equivalent of libmemcached-dev (Debian package) isnât installed. (ârelated StackOverflow). I think itâs not Djangoâs job to document the requirements of third-party packages. Iâd rather enhance âpylibmcâs install instructions if needed.
This was then again raised in May 2018 where Tim again mentioned that we wonât be documenting this as a dependency.
The issue has been raised before and the consensus is that itâs not Djangoâs job to document all the possibilities for various operating systems.
Now 2 years after that, I (and seems some others too) observed it again and we discussed through this forum.
I think given the recurrence of this issue (several times over half a decade), we should rethink our stance and call out them at least in the Troubleshooting section of the contributing guide. This only reduces the hurdle for new contributors.