# Buggy code
def editable_add(self, path, reference, layout, cwd):
    # Retrieve conanfile.py from target_path
    target_path = _get_conanfile_path(path=path, cwd=cwd, py=True)

    # Check the conanfile is there, and name/version matches
    ref = ConanFileReference.loads(reference, validate=True)
    target_conanfile = self._graph_manager._loader.load_class(target_path)
    if (target_conanfile.name and target_conanfile.name != ref.name) or (
        target_conanfile.version and target_conanfile.version != ref.version
    ):
        raise ConanException(
            "Name and version from reference ({}) and target "
            "conanfile.py ({}/{}) must match".format(
                ref, target_conanfile.name, target_conanfile.version
            )
        )

    layout_abs_path = get_editable_abs_path(layout, cwd, self._cache.conan_folder)
    if layout_abs_path:
        self._user_io.out.success("Using layout file: %s" % layout_abs_path)
    self._cache.editable_packages.add(
        ref, os.path.dirname(target_path), layout_abs_path
    )


# Traceback (KeyError)
ERROR: Error loading conanfile at '/Users/xxx/Repos/NloSanbox/ProxyLib/conanfile.py': Unable to load conanfile in /Users/xxx/Repos/NloSanbox/ProxyLib/conanfile.py
KeyError: 'nlo-cmake-pythonlib/1.0@xxx/stable'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "/usr/local/lib/python3.7/site-packages/conans/client/loader.py", line 269, in _parse_conanfile
loaded = imp.load_source(module_id, conan_file_path)
File "/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/imp.py", line 171, in load_source
module = _load(spec)
File "<frozen importlib._bootstrap>", line 696, in _load
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/xxx/Repos/NloSanbox/ProxyLib/conanfile.py", line 2, in <module>
nlo = python_requires("nlo-cmake-pythonlib/1.0@xxx/stable")
File "/usr/local/lib/python3.7/site-packages/conans/client/graph/python_requires.py", line 75, in __call__
python_req = self._look_for_require(require)
File "/usr/local/lib/python3.7/site-packages/conans/client/graph/python_requires.py", line 49, in _look_for_require
remotes=self._remotes)
AttributeError: 'ConanPythonRequire' object has no attribute '_remotes'

# Fixed code
def editable_add(self, path, reference, layout, cwd):
    remotes = self._cache.registry.load_remotes()
    self.python_requires.enable_remotes(remotes=remotes)
    # Retrieve conanfile.py from target_path
    target_path = _get_conanfile_path(path=path, cwd=cwd, py=True)

    # Check the conanfile is there, and name/version matches
    ref = ConanFileReference.loads(reference, validate=True)
    target_conanfile = self._graph_manager._loader.load_class(target_path)
    if (target_conanfile.name and target_conanfile.name != ref.name) or (
        target_conanfile.version and target_conanfile.version != ref.version
    ):
        raise ConanException(
            "Name and version from reference ({}) and target "
            "conanfile.py ({}/{}) must match".format(
                ref, target_conanfile.name, target_conanfile.version
            )
        )

    layout_abs_path = get_editable_abs_path(layout, cwd, self._cache.conan_folder)
    if layout_abs_path:
        self._user_io.out.success("Using layout file: %s" % layout_abs_path)
    self._cache.editable_packages.add(
        ref, os.path.dirname(target_path), layout_abs_path
    )