I installed Python on my macOS using Homebrew. Now, I'm attempting to use BeautifulSoup, so I executed the following command: brew install python-beautifulsoup4. However, I encountered a message stating, 'Warning: No available formula with the name python-beautifulsoup4.
What could be the issue here? How should I properly install and use this Python package?
All forms of python3 -m pip install beautifulsoup4 or pip3 install beautifulsoup4 gave me the same error which the OP got as they mentioned in the comments:
error: externally-managed-environment × This environment is externally managed ╰─> To install Python packages system-wide, try brew install xyz, where xyz is the package you are trying to install
I finally successfully installed it using this rather scary-looking argument:
pip3 install beautifulsoup4 --break-system-packages
Caution: I got this solution from Alok's answer ('How do I solve "error: externally-managed-environment" every time I use pip 3?') which says it shouldn't be overused. maciek97x's accepted answer over there explains it in detail.
You should use pip to install BeautifulSoup4 with pip install beautifulsoup4 or pip3 install beautifulsoup4.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With