diff --git a/HISTORY.rst b/HISTORY.rst
index b74b545..b94fed0 100644
--- a/HISTORY.rst
+++ b/HISTORY.rst
@@ -2,6 +2,14 @@
 History
 =======
 
+Next
+------------------
+
+* Obtain  ``envs_dir`` without using a subprocess (`#67`_).
+
+
+.. _`#67`: https://github.com/ESSS/conda-devenv/issues/67
+
 1.0.3 (2018-06-20)
 ------------------
 
diff --git a/conda_devenv/devenv.py b/conda_devenv/devenv.py
index c4d5973..ba0586b 100644
--- a/conda_devenv/devenv.py
+++ b/conda_devenv/devenv.py
@@ -451,12 +451,17 @@ def get_env_name(args, output_filename, conda_yaml_dict=None):
     return conda_yaml_dict['name']
 
 
+def _get_envs_dirs_from_conda():
+    from conda.base.context import context
+    return context.envs_dirs
+
+
 def get_env_directory(env_name):
-    import subprocess
-    import json
-    info = subprocess.check_output(["conda", "info", "--json"]).decode()
-    info = json.loads(info)
-    envs_dirs = info["envs_dirs"]
+    """
+    :rtype: Optional[str]
+    :return: The environment path if the enviromment exists.
+    """
+    envs_dirs = _get_envs_dirs_from_conda()
 
     for directory in envs_dirs:
         env = os.path.join(directory, env_name)

Call conda info directly istead of by subprocess
The method `get_env_directory` on line 457 should be calling the conda directly instead of by calling `subprocess`.

Maybe add a method `_call_conda_info` similar to the already created `_call_conda`
diff --git a/tests/test_main.py b/tests/test_main.py
index 8899d74..6fd6364 100644
--- a/tests/test_main.py
+++ b/tests/test_main.py
@@ -140,14 +140,14 @@ def test_get_env_directory(mocker, tmpdir):
     env_1 = tmpdir.join('1/envs/my_env').ensure(dir=1)
     conda_meta_env_1 = tmpdir.join('1/envs/my_env/conda-meta').ensure(dir=1)
 
-    # Replacing separators because of Windows
-    mock_output = '''
-        {{
-        "envs": ["{0}", "{1}"],
-        "envs_dirs": ["{2}"]
-        }}
-    '''.format(str(env_0), str(env_1), str(tmpdir.join('1/envs'))).replace('\\','\\\\').encode()
-    mocker.patch('subprocess.check_output', return_value=mock_output)
+    mocker.patch('subprocess.check_output', side_effect=AssertionError())
+    mocker.patch.object(
+        devenv, '_get_envs_dirs_from_conda',
+        return_value=[
+            str(tmpdir.join('0/envs')),
+            str(tmpdir.join('1/envs')),
+        ],
+    )
 
     obtained = devenv.get_env_directory('my_env')
     assert obtained == str(env_1)

pip install -e .
parse_log_pytest
requirements.txt
pytest
apt-get update apt-get install -y gcc
3.6
requirements_dev.txt
pytest --no-header -rA --tb=line --color=no -p no:cacheprovider -W ignore::DeprecationWarning
alabaster==0.7.13
attrs==22.2.0
Babel==2.11.0
bump2version==1.0.1
bumpversion==0.6.0
certifi==2021.5.30
cffi==1.15.1
charset-normalizer==2.0.12
-e git+https://github.com/ESSS/conda-devenv.git@22e0b1a2515f187a330acfcd99a920bcf2fd7795#egg=conda_devenv
coverage==6.2
cryptography==40.0.2
distlib==0.3.9
docutils==0.18.1
filelock==3.4.1
flake8==3.9.2
idna==3.10
imagesize==1.4.1
importlib-metadata==4.8.3
importlib-resources==5.4.0
iniconfig==1.1.1
Jinja2==3.0.3
MarkupSafe==2.0.1
mccabe==0.6.1
packaging==21.3
platformdirs==2.4.0
pluggy==1.0.0
py==1.11.0
pycodestyle==2.7.0
pycparser==2.21
pyflakes==2.3.1
Pygments==2.14.0
pyparsing==3.1.4
pytest==7.0.1
pytest-datadir==1.4.1
pytest-mock==3.6.1
pytz==2025.2
PyYAML==6.0.1
requests==2.27.1
six==1.17.0
snowballstemmer==2.2.0
Sphinx==5.3.0
sphinxcontrib-applehelp==1.0.2
sphinxcontrib-devhelp==1.0.2
sphinxcontrib-htmlhelp==2.0.0
sphinxcontrib-jsmath==1.0.1
sphinxcontrib-qthelp==1.0.3
sphinxcontrib-serializinghtml==1.1.5
toml==0.10.2
tomli==1.2.3
tox==3.28.0
typing_extensions==4.1.1
urllib3==1.26.20
virtualenv==20.17.1
watchdog==2.3.1
zipp==3.6.0

name: conda-devenv
channels:
  - defaults
  - https://repo.anaconda.com/pkgs/main
  - https://repo.anaconda.com/pkgs/r
  - conda-forge
dependencies:
  - _libgcc_mutex=0.1=main
  - _openmp_mutex=5.1=1_gnu
  - ca-certificates=2025.2.25=h06a4308_0
  - certifi=2021.5.30=py36h06a4308_0
  - ld_impl_linux-64=2.40=h12ee557_0
  - libffi=3.3=he6710b0_2
  - libgcc-ng=11.2.0=h1234567_1
  - libgomp=11.2.0=h1234567_1
  - libstdcxx-ng=11.2.0=h1234567_1
  - ncurses=6.4=h6a678d5_0
  - openssl=1.1.1w=h7f8727e_0
  - pip=21.2.2=py36h06a4308_0
  - python=3.6.13=h12debd9_1
  - readline=8.2=h5eee18b_0
  - setuptools=58.0.4=py36h06a4308_0
  - sqlite=3.45.3=h5eee18b_0
  - tk=8.6.14=h39e8969_0
  - wheel=0.37.1=pyhd3eb1b0_0
  - xz=5.6.4=h5eee18b_1
  - zlib=1.2.13=h5eee18b_1
  - pip:
      - alabaster==0.7.13
      - attrs==22.2.0
      - babel==2.11.0
      - bump2version==1.0.1
      - bumpversion==0.6.0
      - cffi==1.15.1
      - charset-normalizer==2.0.12
      - coverage==6.2
      - cryptography==40.0.2
      - distlib==0.3.9
      - docutils==0.18.1
      - filelock==3.4.1
      - flake8==3.9.2
      - idna==3.10
      - imagesize==1.4.1
      - importlib-metadata==4.8.3
      - importlib-resources==5.4.0
      - iniconfig==1.1.1
      - jinja2==3.0.3
      - markupsafe==2.0.1
      - mccabe==0.6.1
      - packaging==21.3
      - platformdirs==2.4.0
      - pluggy==1.0.0
      - py==1.11.0
      - pycodestyle==2.7.0
      - pycparser==2.21
      - pyflakes==2.3.1
      - pygments==2.14.0
      - pyparsing==3.1.4
      - pytest==7.0.1
      - pytest-datadir==1.4.1
      - pytest-mock==3.6.1
      - pytz==2025.2
      - pyyaml==6.0.1
      - requests==2.27.1
      - six==1.17.0
      - snowballstemmer==2.2.0
      - sphinx==5.3.0
      - sphinxcontrib-applehelp==1.0.2
      - sphinxcontrib-devhelp==1.0.2
      - sphinxcontrib-htmlhelp==2.0.0
      - sphinxcontrib-jsmath==1.0.1
      - sphinxcontrib-qthelp==1.0.3
      - sphinxcontrib-serializinghtml==1.1.5
      - toml==0.10.2
      - tomli==1.2.3
      - tox==3.28.0
      - typing-extensions==4.1.1
      - urllib3==1.26.20
      - virtualenv==20.17.1
      - watchdog==2.3.1
      - zipp==3.6.0
prefix: /opt/conda/envs/conda-devenv

tests/test_main.py::test_get_env_directory
tests/test_main.py::test_handle_input_file[True-0-True-environment.devenv.yml-1] tests/test_main.py::test_handle_input_file[True-0-False-environment.devenv.yml-1] tests/test_main.py::test_handle_input_file[False-1-True-environment.devenv.yml-1] tests/test_main.py::test_handle_input_file[False-1-False-environment.devenv.yml-1] tests/test_main.py::test_print[environment.devenv.yml] tests/test_main.py::test_print_full
tests/test_main.py::test_handle_input_file[True-0-True-environment.yml-0] tests/test_main.py::test_handle_input_file[True-0-False-environment.yml-0] tests/test_main.py::test_handle_input_file[False-1-True-environment.yml-0] tests/test_main.py::test_handle_input_file[False-1-False-environment.yml-0] tests/test_main.py::test_print[environment.yml] tests/test_main.py::test_version tests/test_main.py::test_error_message_environment_file_not_found[True] tests/test_main.py::test_error_message_environment_file_not_found[False]
HISTORY.rst conda_devenv/devenv.py
HISTORY.rst conda_devenv/devenv.py