Skip to content

python -m build No module named 'packaging.requirements' #3676

Answered by wb8tyw
wb8tyw asked this question in Q&A
Discussion options

You must be logged in to vote

Found the issue.

I had created a packaging directory with an init.py in it in my project.
Once I deleted the init.py from the directory, the python -m build started working.

The python -m build importing that directory instead of the Pypi packaging module.

$ python
Python 3.9.2 (default, Feb 28 2021, 17:03:44) 
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import packaging.requirements
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'packaging.requirements'
>>> import packaging
>>> dir(packaging)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__na…

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@webknjaz
Comment options

@wb8tyw
Comment options

@webknjaz
Comment options

Answer selected by wb8tyw
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants