You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Kindly need your help. In my crew, I am using allow_code_execution tool to generate my images by one of my agent to write a python code and run it but somehow in my docker environment not able to install matplotlib which is necessary to visiualize my data and then generate images. Thanks.
Error message: ## Tool Output: Something went wrong while running the code: Traceback (most recent call last): File "", line 2, in ModuleNotFoundError: No module named 'matplotlib'
Some extra infos:
Mac, my python version in .venv: 3.11.5
The text was updated successfully, but these errors were encountered:
The following script is generated by AI Agent to help reproduce the issue:
# crewAI-tools/reproduce.pyimportunittestimportsysimportosos.environ['OPENAI_API_KEY'] ='mock_openai_api_key'fromunittest.mockimportMagicMocksys.modules['weaviate'] =MagicMock()
sys.modules['weaviate.classes'] =MagicMock()
sys.modules['weaviate.classes.config'] =MagicMock()
sys.modules['weaviate.classes.init'] =MagicMock()
fromcrewai_tools.tools.code_interpreter_tool.code_interpreter_toolimportCodeInterpreterToolclassTestMatplotlibImport(unittest.TestCase):
deftest_matplotlib_import(self):
tool=CodeInterpreterTool()
code="import matplotlib.pyplot as plt; plt.plot([1, 2, 3], [4, 5, 6]); plt.show()"libraries_used= ["matplotlib"]
try:
result=tool.run_code_in_docker(code, libraries_used)
print("Test passed successfully with no errors!")
exceptExceptionase:
raiseAssertionError("Test failed as expected with error: "+str(e))
if__name__=="__main__":
unittest.main()
How to run:
python3 crewAI-tools/reproduce.py
Thank you for your valuable contribution to this project and we appreciate your feedback! Please respond with an emoji if you find this script helpful. Feel free to comment below if any improvements are needed.
Hi there,
Kindly need your help. In my crew, I am using allow_code_execution tool to generate my images by one of my agent to write a python code and run it but somehow in my docker environment not able to install matplotlib which is necessary to visiualize my data and then generate images. Thanks.
Error message: ## Tool Output: Something went wrong while running the code: Traceback (most recent call last): File "", line 2, in ModuleNotFoundError: No module named 'matplotlib'
Some extra infos:
Mac, my python version in .venv: 3.11.5
The text was updated successfully, but these errors were encountered: