guardrails icon indicating copy to clipboard operation
guardrails copied to clipboard

[bug] Message: guardrails-cli[6204] , ERROR Failed to inspect

Open musharaf-iqeqdigital opened this issue 11 months ago • 12 comments

Describe the bug I successfully installed Guardrails version 0.4.1 using the following command: pip install "git+https://github.com/guardrails-ai/guardrails.git@main"

After configuring Guardrails, I attempted to install Guard PII with the following command:

guardrails hub install hub://guardrails/detect_pii However, I encountered the following error:

UnicodeEncodeError: 'charmap' codec can't encode character '\u2192' in position 3463: character maps to

Additionally, the Guardrails CLI reported:

guardrails-cli[6204] ERROR Failed to inspect

To Reproduce Steps to reproduce the behavior: 1- Install the guardrails <pip install "git+https://github.com/guardrails-ai/guardrails.git@main"> 2- configure guardrails 3- Install Detect PII <guardrails hub install hub://guardrails/detect_pii>

Library version: Version (0.4.1)

musharaf-iqeqdigital avatar Mar 15 '24 10:03 musharaf-iqeqdigital

@musharaf-iqeqdigital Thanks for raising this issue! We're still investigating, but from what we can tell, this is a Windows specific encoding issue. We're working on a fix and will update here once we have something.

CalebCourier avatar Mar 15 '24 18:03 CalebCourier

@CalebCourier Thanks for your response! We're currently using Guardrails for a proof of concept (POC) and are keen to continue. Understanding that the issue may be Windows-specific, we appreciate any updates on the fix. Your assistance is invaluable to us in moving forward with our evaluation.

musharaf-iqeqdigital avatar Mar 18 '24 06:03 musharaf-iqeqdigital

@musharaf-iqeqdigital I'm still trying to replicate this issue, but in the meantime I do have a work-in-progress branch where any changes for this issue will go. You can see those changes here: https://github.com/guardrails-ai/guardrails/pull/657

If you want to test out these changes as they're still under development you can install from this branch via pip install "git+https://github.com/guardrails-ai/guardrails.git@xplat-encoding"

I'll update here when I have any new findings. Thanks for your again patience!

CalebCourier avatar Mar 19 '24 18:03 CalebCourier

I was able to replicate this issue in a Windows environment. Going to test the above changes first, then move towards a solution.

CalebCourier avatar Mar 19 '24 19:03 CalebCourier

facing the same issue

RoshniRM avatar Mar 29 '24 11:03 RoshniRM

I had encountered part of this error guardrails-cli[6204] ERROR Failed to inspect and it was fixed by upgrading pip to the latest version (Infact any version > 22.2 should fix it). @musharaf-iqeqdigital @RoshniRM Please try this and see if it works.

vivek-athina avatar Mar 30 '24 08:03 vivek-athina

@musharaf-iqeqdigital @RoshniRM @vivek-athina We've found the underlying cause of this error when running on Windows. In some of our Validator's README's there is a character where it should be ->. The character-set that python uses internally on Windows does not have a mapping for this character hence the error. We're going through and updating the Validator README's to correct this. The RegexMatch and DetectPII validators have already been updated and we will continue to roll out updates to any validators with this issue.

CalebCourier avatar Apr 04 '24 17:04 CalebCourier

some fixes

https://github.com/guardrails-ai/competitor_check/pull/3#pullrequestreview-1986563679 https://github.com/guardrails-ai/nsfw_text/pull/1#pullrequestreview-1986564085 https://github.com/guardrails-ai/gibberish_text/pull/1

zsimjee avatar Apr 08 '24 14:04 zsimjee

I managed to fix it by enabling UTF-8 in Windows.

nicucalcea avatar May 05 '24 14:05 nicucalcea

guardrails hub install hub://guardrails/detect_pi

I'm facing the same error for this Validator - guardrails hub install hub://guardrails/toxic_language How should I fix it?

mdhuzaifapatel avatar May 09 '24 07:05 mdhuzaifapatel

@mdhuzaifapatel We are working on updates on our side to mitigate this issue across all validators.

In the meantime, you can work around this issue by enabling UTF-8 like @nicucalcea suggests.

CalebCourier avatar May 15 '24 16:05 CalebCourier

same issue i am facing in Ubuntu also

ashwinimiri avatar Jul 22 '24 10:07 ashwinimiri

This issue is stale because it has been open 30 days with no activity. Remove stale label or comment or this will be closed in 14 days.

github-actions[bot] avatar Aug 22 '24 03:08 github-actions[bot]

This issue was closed because it has been stalled for 14 days with no activity.

github-actions[bot] avatar Sep 05 '24 03:09 github-actions[bot]