Reputation: 157
I tried
>>> import Pathlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'Pathlib'
I checked from shell
pip install Pathlib
Requirement already satisfied: Pathlib in /Users/milenko/mario/venv/lib/python3.8/site-packages (1.0.1)
How it comes that I can not import this module?
Upvotes: 2
Views: 1371
Reputation: 1927
pathlib
is part of the standard library for Python 3.4+
.
In my case, I was using the old import line
from Pathlib import Path
Solution
from pathlib import Path
Upvotes: 0
Reputation: 556
Python considers Pathlib
and pathlib
differently.try: pip install pathlib
and import pathlib
if it doesn't work then try
pip3 install pathlib
Upvotes: 2