question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

missing dependency on `bs4`

See original GitHub issue
$ pip install soupsieve
Collecting soupsieve
  Downloading soupsieve-2.3.2.post1-py3-none-any.whl (37 kB)
Installing collected packages: soupsieve
Successfully installed soupsieve-2.3.2.post1
$ python3 -c 'import soupsieve'
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/tmp/y/venv/lib/python3.10/site-packages/soupsieve/__init__.py", line 29, in <module>
    from . import css_parser as cp
  File "/tmp/y/venv/lib/python3.10/site-packages/soupsieve/css_parser.py", line 5, in <module>
    from . import css_match as cm
  File "/tmp/y/venv/lib/python3.10/site-packages/soupsieve/css_match.py", line 7, in <module>
    import bs4  # type: ignore[import]

I understand soupsieve is intended to be used with beautifulsoup but it isn’t even importable without it installed – soupsieve should probably have an install_requires (or whatever the hatch-equivalent is) that include beautifulsoup4

Issue Analytics

  • State:closed
  • Created a year ago
  • Comments:7 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
facelessusercommented, Oct 19, 2022

As the conversation on this has died out, I will close this with the following comment:

Soup Sieve was originally created to accept BS4 objects/elements and to apply selectors, but the hope was always to replace the official CSS selectors in BS4. Since it has been accepted as the new official CSS selector support in BS4 and is a required dependency of BS4., Soup Sieve can really be viewed as a sub-module of Beautiful Soup as it is not optional and is not useful by itself.

Soup Sieve does offer some optional ways to apply selectors that are not built into Beautiful Soup such as closest, etc. These require you to explicitly import those methods, but Soup Sieve is still considered a part of Beautiful Soup at this point. If BS4 made CSS selectors optional, then, and only then, would we add the BS4 requirement to this package.

0reactions
facelessusercommented, Oct 19, 2022

Just as an FYI, some of the issues related to circular dependencies were installing packages manually: https://github.com/squidfunk/mkdocs-material/discussions/2591. Additionally, there are tools like Pyodide which have to install packages manually. SoupSieve is supported there as well: https://github.com/pyodide/pyodide/tree/main/packages/soupsieve. They would have to add special exceptions to handle this odd, two-way dependency.

I didn’t find the specific example of other package managers, I’m not sure where the original conversation was, but I’m still fairly certain it was an issue at some time in at least one of them.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Net Core template based on BS4 are missing core ... - GitHub
There is a problem with update in my opinion: the template authors use Ajax CDN for production (hosted) dependencies; the Ajax CDN is...
Read more >
1100496 – Missing dependency on python-beautifulsoup4
Description of problem: Various commands result in the following error: Error: No module named bs4 ERROR:root:Generic error catched: Traceback (most recent ...
Read more >
RPM Missing dependency - Stack Overflow
When I am trying to install the rpm it gives an error "Missing dependency: libexample.so" even though it is packaged as a link...
Read more >
Beautiful Soup 4.9.0 documentation - Crummy
Beautiful Soup will print out a report showing you how different parsers handle the document, and tell you if you're missing a parser...
Read more >
Third-party dependencies - Pants build
For Pants to know which dependencies each file uses, it must first know which specific dependencies are in your "universe", i.e. all the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found