Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"conda activate" called after process launch, when it should be prior to launch #6991

Closed
mind6 opened this issue Aug 16, 2019 · 1 comment
Closed
Labels
bug Issue identified by VS Code Team member as probable bug

Comments

@mind6
Copy link

mind6 commented Aug 16, 2019

Environment data

  • VS Code version: 1.37.1
  • Extension version (available under the Extensions sidebar): 2019.8.30787
  • OS and version: Windows 10
  • Python version (& distribution if applicable, e.g. Anaconda): 3.7.3, conda 4.7.10
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): conda

Expected behaviour

When pressing F5 or Ctrl-F5 opening a new integrated window, it should call conda activate then start the launcher process

Actual behaviour

The opposite order, causing libraries to not be found.

Steps to reproduce:

  1. install Anaconda 64-bit on windows
  2. create new python file with "import numpy"
  3. make sure there are no terminals in the panel
  4. press F5 or Ctrl-F5 to launch the file

Logs

Output in the terminal window

Microsoft Windows [Version 10.0.18362.295]
(c) 2019 Microsoft Corporation. All rights reserved.

c:\Users\Kirby\Documents\vs-test>C:\Users\Kirby\Anaconda3\python.exe c:\Users\Kirby\.vscode\extensions\ms-python.python-2019.8.30787\pythonFiles\ptvsd_launcher.py --default --nodebug --client --host localhost --port 63619 c:\Users\Kirby\Documents\vs-test\Untitled-1.py
Traceback (most recent call last):
  File "c:\Users\Kirby\.vscode\extensions\ms-python.python-2019.8.30787\pythonFiles\ptvsd_launcher.py", line 43, in <module>
    main(ptvsdArgs)
  File "c:\Users\Kirby\.vscode\extensions\ms-python.python-2019.8.30787\pythonFiles\lib\python\ptvsd\__main__.py", line 432, in main
    run()
  File "c:\Users\Kirby\.vscode\extensions\ms-python.python-2019.8.30787\pythonFiles\lib\python\ptvsd\__main__.py", line 316, in run_file
    runpy.run_path(target, run_name='__main__')
  File "C:\Users\Kirby\Anaconda3\lib\runpy.py", line 263, in run_path
    import numpy
  File "C:\Users\Kirby\Anaconda3\lib\site-packages\numpy\__init__.py", line 140, in <module>
    from . import _distributor_init
  File "C:\Users\Kirby\Anaconda3\lib\site-packages\numpy\_distributor_init.py", line 34, in <module>
    from . import _mklinit
ImportError: DLL load failed: The specified module could not be found.

c:\Users\Kirby\Documents\vs-test>C:/Users/Kirby/Anaconda3/Scripts/activate

(base) c:\Users\Kirby\Documents\vs-test>conda activate base

(base) c:\Users\Kirby\Documents\vs-test>

I think this is the same bug as #4462 but it was incorrectly closed.

Please note if you right click on the file, and select "Run Python File in Terminal", the activation comes first and the process runs correctly.

@mind6 mind6 added triage-needed Needs assignment to the proper sub-team bug Issue identified by VS Code Team member as probable bug labels Aug 16, 2019
@DonJayamanne
Copy link

Dup of #5559

@ghost ghost removed the triage-needed Needs assignment to the proper sub-team label Aug 16, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Aug 23, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Issue identified by VS Code Team member as probable bug
Projects
None yet
Development

No branches or pull requests

2 participants