-
Notifications
You must be signed in to change notification settings - Fork 348
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Cannot get guardrails working with given documentation #1214
Comments
@ta-dr0aid, just so I understand your local setup correctly, are you trying to run the code snippet in the same directory where you cloned/downloaded the guardrails-ai source code? |
Hi @CalebCourier, thanks for your prompt response. I think I got the snips messed up, I updated them. My path /guardrails-0.6.2 is the path where I can see the whole guardrails git repo. The call happens from within Pycharm with running "Current File" and the code snippet is activated as the current file. The current file is located under /guardrails-0.6.2/local_files/quickscript.py |
@ta-dr0aid, thanks for the clarification! This issue has to do with how python's module system resolves imports. Basically it doesn’t understand the difference between a pip installed module named guardrails and a directory or file named guardrails and will often try to use the closest one in the python path which can vary based on where the file you are running is located, where you start the process from, or sometimes even your operating system. For example, if I follow your setup method where the code snipped is located in The solution here is to install the downloaded version using pip in a directory separate from
You can create the virtual environment within |
@CalebCourier Yes, that works. No ImportErrors as of now anymore. Thanks a bunch for your help :) |
Describe the bug
I cannot successfully call guardrails with the given information to set them up.
To Reproduce
Steps to reproduce the behavior:
Using these commands to install the guardrails environment within a cloned repo version 0.6.2.
Using this code snippet:
gives
where
<snip>
is the correct folder, snipped for confidentiality reasons.System Metadata:
Expected behavior
From the readme I'd expect this output in the console:
Validation failed for field with errors: Result must match \(?\d{3}\)?-? *\d{3}-? *-?\d{4}
Library version:
Version 0.6.2, downloaded from the releases page
Additional context
So far, I have not been able to get any guardrails working. If I understand the console report correctly, the guardrails get installed correctly from the hub. I can verify that within the virtual environment,
pip list
returnsguardrails-grhub-regex-match
.where guardrails
does not return anything. Likewise,guardrails-0.6.2\guardrails\hub\__init__.py
is empty, inguardrails-0.6.2\venv\Lib\site-packages\guardrails\hub\__init__.py
, I seefrom guardrails_grhub_regex_match import RegexMatch
.The text was updated successfully, but these errors were encountered: