Skip to content
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

Fix conda executable not found (conda 4.4+) #79

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion nb_conda_kernels/manager.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# -*- coding: utf-8 -*-
import json
import os
import re
import subprocess
import sys
Expand All @@ -16,6 +17,8 @@

CACHE_TIMEOUT = 60

CONDA_EXE = os.environ.get("CONDA_EXE", "conda")


class CondaKernelSpecManager(KernelSpecManager):
""" A custom KernelSpecManager able to search for conda environments and
Expand Down Expand Up @@ -52,7 +55,7 @@ def _conda_info(self):
if expiry is None or expiry < time.time():
self.log.debug("[nb_conda_kernels] refreshing conda info")
try:
p = subprocess.check_output(["conda", "info", "--json"]
p = subprocess.check_output([CONDA_EXE, "info", "--json"]
).decode("utf-8")
conda_info = json.loads(p)
except Exception as err:
Expand Down