Skip to content

ModuleNotFoundError: No module named 'pathtools.patterns' #127

@prbarcelon

Description

@prbarcelon

When running the second cell of notebooks\02. Generation.ipynb in a Python 3.8.10 venv, I get the following error:

ModuleNotFoundError                       Traceback (most recent call last)
File c:\Users\prbar\source\repos\edu\llm-apps-course\venv\lib\site-packages\wandb\vendor\watchdog_0_9_0\wandb_watchdog\observers\__init__.py:90
     89 try:
---> 90     from .read_directory_changes import WindowsApiObserver as Observer
     91 except:

File c:\Users\prbar\source\repos\edu\llm-apps-course\venv\lib\site-packages\wandb\vendor\watchdog_0_9_0\wandb_watchdog\observers\read_directory_changes.py:26
     24 import time
---> 26 from wandb_watchdog.events import (
     27     DirCreatedEvent,
     28     DirMovedEvent,
     29     DirModifiedEvent,
     30     FileCreatedEvent,
     31     FileDeletedEvent,
     32     FileMovedEvent,
     33     FileModifiedEvent,
     34     generate_sub_moved_events,
     35     generate_sub_created_events,
     36 )
     38 from wandb_watchdog.observers.api import (
     39     EventEmitter,
     40     BaseObserver,
     41     DEFAULT_OBSERVER_TIMEOUT,
     42     DEFAULT_EMITTER_TIMEOUT
     43 )

File c:\Users\prbar\source\repos\edu\llm-apps-course\venv\lib\site-packages\wandb\vendor\watchdog_0_9_0\wandb_watchdog\events.py:91
     90 import re
---> 91 from pathtools.patterns import match_any_paths
     92 from wandb_watchdog.utils import has_attribute

ModuleNotFoundError: No module named 'pathtools.patterns'

It seems the error shows up when pathtools==0.1.2 is installed, but downgrading to pathtools==0.1.1 works. 0.1.0 is missing match_any_paths (ImportError: cannot import name 'match_any_paths' from 'pathtools.patterns' (c:\Users\prbar\source\repos\edu\llm-apps-course\venv\lib\site-packages\pathtools\patterns.py)).

I modified my requirements.txt file to the following (note the last line) and I'm good to go.

wandb>=0.15.3
openai==0.27.*
pandas==1.5.*
unstructured>=0.6.10
langchain>=0.0.188
gradio>=3.33.1
gradio_client>=0.2.5
tenacity>=8.2.2
tiktoken>=0.4.0
rich>=13.0.1
chromadb>=0.3.25
pdf2image>=1.16.3
tabulate>=0.9.0
pathtools==0.1.1

TL;DR - Fix
For Python 3.8.10, install pathtools==0.1.1 because the latest version (pathtools==0.1.2) doesn't seem to work.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions