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

Extension won't install ipykernel when it should be able to. #9133

Closed
greazer opened this issue Feb 27, 2022 · 6 comments · Fixed by #9228
Closed

Extension won't install ipykernel when it should be able to. #9133

greazer opened this issue Feb 27, 2022 · 6 comments · Fixed by #9228
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug important Issue identified as high-priority interactive-window Impacts interactive window notebook-getting-started notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) verified Verification succeeded
Milestone

Comments

@greazer
Copy link
Member

greazer commented Feb 27, 2022

VS Code Stable 1.64.2

  1. Create a new conda environment without installing ipykernel
  2. Try to run a cell in the new environment
  3. At the prompt allow the ipykernel install to be attempted.

On my machine it fails. The difference between success and failure seems to be related to which "conda" executable is being used. Here's a terminal log that replicates the problem as well as the solution. When I modify the command used to simply call "conda.bat" see the 'where' command output, everything works. Using C:/Users/jimg/anaconda3/Scripts/conda.exe does not.

(msaccess) C:\Users\jimg>C:/Users/jimg/anaconda3/Scripts/conda.exe install -c conda-forge --name msaccess --update-deps --force-reinstall ipykernel -y
Collecting package metadata (current_repodata.json): failed

CondaHTTPError: HTTP 000 CONNECTION FAILED for url https://repo.anaconda.com/pkgs/main/win-64/current_repodata.json
Elapsed: -

An HTTP error occurred when trying to retrieve this URL.
HTTP errors are often intermittent, and a simple retry will get you on your way.

If your current network has https://www.anaconda.com blocked, please file
a support request with your network engineering team.

'https://repo.anaconda.com/pkgs/main/win-64'

(msaccess) C:\Users\jimg>where conda
C:\Users\jimg\anaconda3\condabin\conda.bat

(msaccess) C:\Users\jimg>conda install -c conda-forge --name msaccess --update-deps --force-reinstall ipykernel -y
Collecting package metadata (current_repodata.json): done
Solving environment: \ Solving environmentdone
done

Package Plan

environment location: C:\Users\jimg\anaconda3\envs\msaccess

added / updated specs:
- asttokens
- backcall
- backports
- backports.functools_lru_cache
- black
- bzip2
- ca-certificates
- click
- colorama
- dataclasses
- debugpy
- decorator
- entrypoints
- executing
- ipykernel
- ipython
- jedi
- jupyter_client
- jupyter_core
- libffi
- libsodium
- libzlib
- matplotlib-inline
- mypy_extensions
- nest-asyncio
- openssl
- parso
- pathspec
- pickleshare
- pip
- platformdirs
- prompt-toolkit
- pure_eval
- pygments
- python-dateutil
- python=3.10
- python_abi
- pywin32
- pyzmq
- setuptools
- six
- sqlite
- stack_data
- tk
- tomli
- tornado
- traitlets
- typed-ast
- typing_extensions
- tzdata
- ucrt
- vc
- vs2015_runtime
- wcwidth
- wheel
- xz
- zeromq

The following packages will be downloaded:

package                    |            build
---------------------------|-----------------
click-8.0.4                |  py310h5588dad_0         150 KB  conda-forge
ipykernel-6.9.1            |  py310hbbfc1a7_0         184 KB  conda-forge
ipython-8.0.1              |  py310h5588dad_2         1.1 MB  conda-forge
jupyter_core-4.9.2         |  py310h5588dad_0         106 KB  conda-forge
typed-ast-1.5.2            |  py310he2412df_0         136 KB  conda-forge
------------------------------------------------------------
                                       Total:         1.7 MB

The following NEW packages will be INSTALLED:

asttokens conda-forge/noarch::asttokens-2.0.5-pyhd8ed1ab_0
backcall conda-forge/noarch::backcall-0.2.0-pyh9f0ad1d_0
backports conda-forge/noarch::backports-1.0-py_2
backports.functoo~ conda-forge/noarch::backports.functools_lru_cache-1.6.4-pyhd8ed1ab_0
black conda-forge/noarch::black-22.1.0-pyhd8ed1ab_0
click conda-forge/win-64::click-8.0.4-py310h5588dad_0
colorama conda-forge/noarch::colorama-0.4.4-pyh9f0ad1d_0
dataclasses conda-forge/noarch::dataclasses-0.8-pyhc8e2a94_3
debugpy conda-forge/win-64::debugpy-1.5.1-py310h8a704f9_0
decorator conda-forge/noarch::decorator-5.1.1-pyhd8ed1ab_0
entrypoints conda-forge/noarch::entrypoints-0.4-pyhd8ed1ab_0
executing conda-forge/noarch::executing-0.8.2-pyhd8ed1ab_0
ipykernel conda-forge/win-64::ipykernel-6.9.1-py310hbbfc1a7_0
ipython conda-forge/win-64::ipython-8.0.1-py310h5588dad_2
jedi conda-forge/win-64::jedi-0.18.1-py310h5588dad_0
jupyter_client conda-forge/noarch::jupyter_client-7.1.2-pyhd8ed1ab_0
jupyter_core conda-forge/win-64::jupyter_core-4.9.2-py310h5588dad_0
libsodium conda-forge/win-64::libsodium-1.0.18-h8d14728_1
matplotlib-inline conda-forge/noarch::matplotlib-inline-0.1.3-pyhd8ed1ab_0
mypy_extensions conda-forge/win-64::mypy_extensions-0.4.3-py310h5588dad_4
nest-asyncio conda-forge/noarch::nest-asyncio-1.5.4-pyhd8ed1ab_0
parso conda-forge/noarch::parso-0.8.3-pyhd8ed1ab_0
pathspec conda-forge/noarch::pathspec-0.9.0-pyhd8ed1ab_0
pickleshare conda-forge/noarch::pickleshare-0.7.5-py_1003
platformdirs conda-forge/noarch::platformdirs-2.5.1-pyhd8ed1ab_0
prompt-toolkit conda-forge/noarch::prompt-toolkit-3.0.27-pyha770c72_0
pure_eval conda-forge/noarch::pure_eval-0.2.2-pyhd8ed1ab_0
pygments conda-forge/noarch::pygments-2.11.2-pyhd8ed1ab_0
pywin32 conda-forge/win-64::pywin32-303-py310he2412df_0
pyzmq conda-forge/win-64::pyzmq-22.3.0-py310h73ada01_1
stack_data conda-forge/noarch::stack_data-0.2.0-pyhd8ed1ab_0
tomli conda-forge/noarch::tomli-2.0.1-pyhd8ed1ab_0
tornado conda-forge/win-64::tornado-6.1-py310he2412df_2
traitlets conda-forge/noarch::traitlets-5.1.1-pyhd8ed1ab_0
typed-ast conda-forge/win-64::typed-ast-1.5.2-py310he2412df_0
typing_extensions conda-forge/noarch::typing_extensions-4.1.1-pyha770c72_0
wcwidth conda-forge/noarch::wcwidth-0.2.5-pyh9f0ad1d_2
zeromq conda-forge/win-64::zeromq-4.3.4-h0e60522_1

Downloading and Extracting Packages
click-8.0.4 | 150 KB | ############################################################################ | 100%
ipykernel-6.9.1 | 184 KB | ############################################################################ | 100%
ipython-8.0.1 | 1.1 MB | ############################################################################ | 100%
jupyter_core-4.9.2 | 106 KB | ############################################################################ | 100%
typed-ast-1.5.2 | 136 KB | ############################################################################ | 100%
Preparing transaction: done
Verifying transaction: done
Executing transaction: /

@greazer greazer added bug Issue identified by VS Code Team member as probable bug notebook-regression notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) notebook-getting-started labels Feb 27, 2022
@greazer greazer added this to the March 2022 milestone Feb 27, 2022
@greazer greazer added the interactive-window Impacts interactive window label Feb 27, 2022
@greazer greazer modified the milestones: March 2022, February 2022 Recovery Feb 27, 2022
@greazer
Copy link
Member Author

greazer commented Feb 27, 2022

Not sure if this is a regression from January. If it is, we should fix it in a recovery build.

@DonJayamanne
Copy link
Contributor

i think we shouldn't use the fully qualified path to conda if it's in the user current path. basically use conda install instead of xyz/conda.exe install

@DonJayamanne DonJayamanne self-assigned this Feb 27, 2022
@DonJayamanne
Copy link
Contributor

@greazer

  • What's the version of conda you have installed conda --version
  • Do you have conda in your path?
    • Open a normal terminal (NOT anaconda command prompt)
    • Check if conda works?
  • What's the value for the env variable PATH on your machine
  • Open a terminal, run conda.bat and then print the env variable PATH and provide that as well

Notes:

  • I think conda.bat updates the PATH variable, hence the need to use conda.bat.
  • We should be able to fix this easily now that we're bringing in installation of packages into the Jupyter extension
    • Basically find and run conda.bat instead of conda.exe

@DonJayamanne
Copy link
Contributor

DonJayamanne commented Feb 28, 2022

@greazer not sure why this is a regression? Can you confirm this works with older versions of the extension.
Did you mean to apply the label to increase the priority of this issue?
Also, I don't think this needs to go into Feb recovery release either, as its not a regression.

@greazer greazer added nb-golden important Issue identified as high-priority and removed notebook-regression labels Feb 28, 2022
@greazer
Copy link
Member Author

greazer commented Mar 4, 2022

  • OS: Windows (in case that matters. Seems like it might.)
  • conda 4.1.1
  • anaconda is not in my system path in any form.
  • Running conda.bat does not change my system path, but it does for other processes it spawns while running. After it exits, it reverts back to the original. As it should.
  • Running an anaconda terminal does use an updated path. It has the active environment pre-pended.

And finally...

No, I didn't add a regression label to increase the priority. I just had a hard time believing that such a seemingly straightforward scenario couldn't be working. I have verified that this same problem happens in the November build of VS Code (1.63), so it is indeed not a recent regression at least.

That being said, this seems like it would be a major blocker for new users who are using anaconda and don't have any version of it on their system path. I assume we run conda.exe using an absolute path because of this. But that seems questionable alone since conda.bat could do all sorts of things before running anaconda exe. Clearly it has an effect in this scenario.

@rchiodo rchiodo assigned rchiodo and unassigned DonJayamanne Mar 4, 2022
@greazer greazer modified the milestones: February 2022 Recovery, March 2022 Mar 4, 2022
@rchiodo
Copy link
Contributor

rchiodo commented Mar 25, 2022

Jim isn't here but he did verify this for me.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 26, 2023
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 important Issue identified as high-priority interactive-window Impacts interactive window notebook-getting-started notebook-kernel Kernels issues (start/restart/switch/execution, install ipykernel) verified Verification succeeded
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants