2
votes

I've installed Anaconda on a Windows 7 machine using this installer: Anaconda3-2019.03-Windows-x86_64.exe. If I run '"C:/Program Files/InstallDir/Scripts/conda.exe" run --help' from a cmd window I get the help text for 'conda run' that shows the example usage:

Example usage:

$ conda create -y -n my-python-2-env python=2
$ conda run -n my-python-2-env python --version

However, if I try '"C:/Program Files/InstallDir/Scripts/conda.exe" run -n base python -c print('hi')' the executable just hangs with no output until I terminate it with Cntr-C.

What is the proper syntax to use 'conda run' from an Anaconda install without PATH modification on Windows?

1

1 Answers

3
votes

I discovered that the reason that I was unable to get "conda run" to work is because some temp file is created in the Anaconda installation directory when this command is run. Because I had installed Anaconda to a system folder (i.e. in C:\Program Files\InstallDir), when conda attempted to create the temp file it was not able to.

When I ran a console window as an administrator, I was able to use the following syntax successfully: "C:/Program Files/InstallDir/Scripts/conda" run -n base -v python "C:/Users/someuser/Desktop/somescript.py".

I'll consider this thread closed and post a related question about how to invoke "conda run" from an system directory without being an administrator.