Skip to content

Subprocess for 'conda run [' ......']' command failed. #9507

Closed

Description

@Edge4711

vscode 1.41.1
Latest version of ms-python.python 2020.1.57204
python 3.7.5, Mac OSX Catalina

I am running miniconda and have selected my env Python 3.7.5 64-bit ('octant':conda)
(which is displayed in lower left of window)

The run button outputs the following

source /Users/paulyoung/miniconda3/bin/activate
conda activate octant
➜  DataPrep source /Users/paulyoung/miniconda3/bin/activate
conda activate octant
conda run -n octant python /Users/paulyoung/MyData/Code/DataPrep/Prepare_Dataset.py
(base) ➜  DataPrep conda activate octant
(octant) ➜  DataPrep conda run -n octant python /Users/paulyoung/MyData/Code/DataPrep/Prepare_Dataset.py
ERROR conda.cli.main_run:execute(30): Subprocess for 'conda run ['python', '/Users/paulyoung/MyData/Code/DataPrep/Prepare_Dataset.py']' command failed.  (See above for error)
Traceback (most recent call last):
  File "/Users/paulyoung/MyData/Code/DataPrep/Prepare_Dataset.py", line 1, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

However from within the terminal I can run the file with python Prepare_Dataset.py with no issues (the terminal has a prompt showing me that I am within my virtualenv)

BTW have run conda list at the terminal
and numpy is in the environment

Activity

  1. ghost added
    triage-needed
    on Jan 10, 2020
  2. Kallsup commented on Jan 10, 2020

    @Kallsup

    Hi, I just had a similar problem. I solved it by downgrading to the previous version of ms-python.python. (2019.11.50794)

    I'm not knowledgeable enough about why this worked, I just found the connection in time of when my programs stopped working and the time of the extension update.
    EDIT: they seem to be on to something here.

  3. dev-mbusch commented on Jan 10, 2020

    @dev-mbusch

    Had the same problem. The Januar Update seems to have broken the integration with conda. I wasn't able to select other environments than the conda base interpreter which was possible before. So if you need a quick fix just downgrade the Python extension and go back to the November 2019 Version. Solved all issues for me.

  4. kimadeline commented on Jan 10, 2020

    @kimadeline

    Hi everyone 👋

    We started using conda run in the latest release, however due to problems with this command (as you noticed) we're removing its use in the extension for now (#9490), aiming for a hotfix release next week.

    The fix is now merged in master, so if you're interested in trying it out before the release you are welcome to download our Insiders build (Settings -> "python.insidersChannel": "daily").

    Thank you for your patience!

  5. ghost removed
    triage-needed
    on Jan 10, 2020
  6. HyphonGuo commented on Jan 11, 2020

    @HyphonGuo

    You can set "python.terminal.activateEnvironment" to false in your user settings and restart your termial to work around the problem temporarily. conda run command works well in the default base environment, but conda run -n ENV_NAME will crash if you have activated the ENV_NAME environment already.

  7. kimadeline commented on Jan 14, 2020

    @kimadeline

    Closing since the conda run work has been reverted in the latest release (2020.1.58038)

  8. ghost removed on Jan 14, 2020
  9. locked as resolved and limited conversation to collaborators on Jan 24, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions