EDM: "ERROR: The environment hasn't been activated correctly"

A few users have reported seeing an error like the following when using the edm shell command to activate a Python environment:

!!! ERROR: The environment hasn't been activated correctly. !!!
Please check the contents of your $PATH. You might be adding new directories to it from inside your shell's configuration file. Expected common prefix : [...] Detected Python prefix : [...] Detected EDM prefix : [...] If you cannot make `edm shell` work, you may consider using the `edm-activate` script instead. Starting new shell in EDM environment '[...]'. Type 'exit' to return.


While there could be other possible causes, the most likely ones on Windows seem to be:

  • Running the edm shell command from the edm installation directory or one of its subdirectories, or from the Scripts subdirectory of an edm-managed Python environment. If you are doing either of these things, that should be easy to correct.
  • An edm-managed Python environment having been moved or copied between directories or systems, resulting in the environment's Scripts\edm-script.py not referencing the same environment's python.exe. If you are using some non-standard (unsupported) method of installing EDM or your environments, this could be the culprit.


Please do not enter support requests in article comments

Please use article comments for suggestions to improve the article. For individual support requests, please follow these guidelines.

Have more questions? Submit a request


Powered by Zendesk