MCPcopy Index your code
hub / github.com/ipython/ipython / wrapper

Function wrapper

IPython/core/magics/packaging.py:23–31  ·  view source on GitHub ↗

Return True if the current Python executable is in a conda env

(*args, **kwargs)

Source from the content-addressed store, hash-verified

21def is_conda_environment(func):
22 @functools.wraps(func)
23 def wrapper(*args, **kwargs):
24 """Return True if the current Python executable is in a conda env"""
25 # TODO: does this need to change on windows?
26 if not Path(sys.prefix, "conda-meta", "history").exists():
27 raise ValueError(
28 "The python kernel does not appear to be a conda environment. "
29 "Please use ``%pip install`` instead."
30 )
31 return func(*args, **kwargs)
32
33 return wrapper
34

Callers

nothing calls this directly

Calls 1

funcFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…