guardrails-ai / guardrails

Adding guardrails to large language models.

Home Page:https://www.guardrailsai.com/docs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug] Hub install regex_match throwing error in python3.11

faizan1041 opened this issue · comments

Using guardrails-ai==0.4.3
Python 3.11.7 installed on Ubuntu 22.04

guardrails hub install hub://guardrails/regex_match

Gives following error:

Installing hub://guardrails/regex_match...

[   =] Downloading dependenciesWARNING: Target directory env/lib/python3.11/site-packages/guardrails/hub/guardrails/regex_match/validator already exists. Specify --upgrade to force replacement.
WARNING: Target directory env/lib/python3.11/site-packages/guardrails/hub/guardrails/regex_match/regex_match-0.0.0.dist-info already exists. Specify --upgrade to force replacement.
[=== ] Downloading dependenciesERROR: unknown command "inspect"
Failed to inspect 
Exit code: 1
stdout: b''

Hello @faizan1041, looking at this now. Did you already install this validator sometime before? If yes, can you please try running a fresh virtual environment?

I've seen this before! pip inspect was only released in a recent-ish (1-2yr old) version of pip. Please confirm your pip version and try agian

If upgrading pip resolves this error for you, let's keep this issue open and use it to track the addition of a feature where we

  1. match on this error
  2. check the pip version on the client
  3. throw a better error that includes the pip version context

Hi @faizan1041 - were you able to try this out?

Closing for now in favor of #735. Feel free to reopen if this pops up again!

I also faced a similar issue. As mentioned above, upgrading pip version = 24 resolved the issue.

I also faced a similar issue. As mentioned above, upgrading pip version = 24 resolved the issue.

yes, It works