Djikii
Djikii

Reputation: 157

Why is Pathlib module not found in my venv?

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

Answers (2)

DanielBell99
DanielBell99

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

pjk
pjk

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

Related Questions