Skip to content

Commit

Permalink
fix: remove the missing datascience packages warning at python tool init
Browse files Browse the repository at this point in the history
  • Loading branch information
ErikBjare committed Sep 16, 2024
1 parent 7b82b03 commit 09f115f
Showing 1 changed file with 0 additions and 18 deletions.
18 changes: 0 additions & 18 deletions gptme/tools/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,6 @@
_ipython = None


def init_python():
check_available_packages()


registered_functions: dict[str, Callable] = {}

T = TypeVar("T", bound=Callable)
Expand Down Expand Up @@ -155,19 +151,6 @@ def get_installed_python_libraries() -> set[str]:
return installed


def check_available_packages():
"""Checks that essentials like numpy, pandas, matplotlib are available."""
expected = ["numpy", "pandas", "matplotlib"]
missing = []
for package in expected:
if package not in get_installed_python_libraries():
missing.append(package)
if missing:
logger.warning(
f"Missing packages: {', '.join(missing)}. Install them with `pip install gptme-python -E datascience`"
)


examples = """
#### Results of the last expression will be displayed, IPython-style:
User: What is 2 + 2?
Expand Down Expand Up @@ -202,7 +185,6 @@ def check_available_packages():
desc="Execute Python code",
instructions=instructions,
examples=examples,
init=init_python,
execute=execute_python,
block_types=[
"python",
Expand Down

0 comments on commit 09f115f

Please sign in to comment.