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

Unable to start OCAML kernel in WSL, Mac, Linux #8897

Closed
DonJayamanne opened this issue Feb 1, 2022 · 9 comments
Closed

Unable to start OCAML kernel in WSL, Mac, Linux #8897

DonJayamanne opened this issue Feb 1, 2022 · 9 comments
Assignees
Labels
bug Issue identified by VS Code Team member as probable bug notebook-kernel Kernels issues (start/restart/switch, install ipykernel) verified Verification succeeded
Milestone

Comments

@DonJayamanne
Copy link
Contributor

Environment data

  • VS Code version: 1.64
  • Jupyter Extension version (available under the Extensions sidebar): Latest
  • Python Extension version (available under the Extensions sidebar): Latest
  • OS (Windows | Mac | Linux distro) and version: WSL (Ubuntu)
  • Python and/or Anaconda version: 3.8
  • Type of virtual environment used (N/A | venv | virtualenv | conda | ...): Venv
  • Jupyter server running: Local

Expected behaviour

Able to run ocaml kernel

Actual behaviour

Does not run

Steps to reproduce:

[NOTE: Self-contained, minimal reproducing code samples are extremely helpful and will expedite addressing your issue]

  1. Install ocaml as per instructions here https://akabe.github.io/ocaml-jupyter/
  2. Run Jupyter in terminal and ocaml will work
  3. Run OCAML kernel in VS Code and it will not work.
@DonJayamanne DonJayamanne added the bug Issue identified by VS Code Team member as probable bug label Feb 1, 2022
@DonJayamanne
Copy link
Contributor Author

It doesn't seem to work as opam hasn't been initialized. When launched from the shell we have shell initialization scripts, hence opam is initialized. However in VS Code inside WSL there's no such thing, hence env variables are not as expected.

@DonJayamanne
Copy link
Contributor Author

DonJayamanne commented Feb 1, 2022

TODO

  • [No] Does this work on Windows?
    • Not officially supported, hence not looking into windows.
  • Does this work on linux/mac desktop?
    • no, same problem

@greazer greazer added notebook-kernel Kernels issues (start/restart/switch, install ipykernel) and removed needs-triage labels Feb 3, 2022
@greazer greazer added this to the February 2022 milestone Feb 3, 2022
@greazer greazer modified the milestones: February 2022, March 2022 Feb 24, 2022
@IanMatthewHuff
Copy link
Member

Reporting back on Mac.

Also doesn't work here, and I see the same basic symptom (I believe) as Don regarding shell initialization. Same kernel worked ok for me launching from shell with jupyter notebook.

Info 11:34:05: Process Execution: > /bin/sh -c "eval $(opam env --switch=default --shell=sh) && /Users/ianhuff/.opam/default/bin/ocaml-jupyter-kernel "$@"" ocaml-jupyter-kernel -init ~/.ocamlinit --merlin ~/.opam/default/bin/ocamlmerlin --verbosity app --connection-file /var/folders/q7/cn8fg6s94fgdcl0h7rbxldf00000gn/T/tmp-9387031XBpCbVv4Yg.json
> /bin/sh -c "eval $(opam env --switch=default --shell=sh) && /Users/ianhuff/.opam/default/bin/ocaml-jupyter-kernel "$@"" ocaml-jupyter-kernel -init ~/.ocamlinit --merlin ~/.opam/default/bin/ocamlmerlin --verbosity app --connection-file /var/folders/q7/cn8fg6s94fgdcl0h7rbxldf00000gn/T/tmp-9387031XBpCbVv4Yg.json
Info 11:34:05: Process Execution: cwd: ~/Documents/DataScience/Languages/OCAML
cwd: ~/Documents/DataScience/Languages/OCAML
Verbose 11:34:05: Launching kernel in kernelProcess.ts, Class name = x, completed in 3ms, has a truthy return value, Arg 1: "~/Documents/DataScience/Languages/OCAML", Arg 2: ""
Verbose 11:34:05: KernelProcess error: ocaml-jupyter-kernel: eval OPAM_SWITCH_PREFIX='/Users/ianhuff/.opam/default'; export OPAM_SWITCH_PREFIX;
CAML_LD_LIBRARY_PATH='/Users/ianhuff/.opam/default/lib/stublibs:/Users/ianhuff/.opam/default/lib/ocaml/stublibs:/Users/ianhuff/.opam/default/lib/ocaml'; export CAML_LD_LIBRARY_PATH;
OCAML_TOPLEVEL_PATH='/Users/ianhuff/.opam/default/lib/toplevel'; export OCAML_TOPLEVEL_PATH;
PKG_CONFIG_PATH='/Users/ianhuff/.opam/default/lib/pkgconfig'; export PKG_CONFIG_PATH;
PATH='/Users/ianhuff/.opam/default/bin:/Users/ianhuff/Documents/DataScience/Languages/OCAML/.venv/bin:/Users/ianhuff/.nvm/versions/node/v14.17.1/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/texlive/2020:/Users/ianhuff/opt/miniconda3/condabin:/Library/Frameworks/Python.framework/Versions/3.7/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/Library/TeX/texbin:/usr/local/share/dotnet:~/.dotnet/tools'; export PATH; && /Users/ianhuff/.opam/default/bin/ocaml-jupyter-kernel -init: No such file or directory

@IanMatthewHuff IanMatthewHuff removed their assignment Mar 2, 2022
@rchiodo rchiodo modified the milestones: March 2022, April 2022 Mar 23, 2022
@rchiodo rchiodo modified the milestones: April 2022, May 2022 Apr 27, 2022
@TimMcGilly

This comment was marked as duplicate.

@DonJayamanne

This comment was marked as resolved.

@TimMcGilly

This comment was marked as duplicate.

@rchiodo rchiodo modified the milestones: May 2022, June 2022 Jun 1, 2022
@DonJayamanne DonJayamanne changed the title Unable to start OCAML kernel in WSL Unable to start OCAML kernel in WSL, Mac, Linux Jun 6, 2022
@DonJayamanne
Copy link
Contributor Author

@TimMcGilly thanks for the confirmation, basically its installed in WSL, not windows. Thanks,
I believe I have a fix for this, once I have something ready for testing, i'll ping you.

@IanMatthewHuff
Copy link
Member

LGTM on Mac
image

@github-actions github-actions bot added the triage-needed Issue needs to be triaged label Jun 22, 2022
@rchiodo rchiodo removed the triage-needed Issue needs to be triaged label Jun 23, 2022
@DonJayamanne
Copy link
Contributor Author

Solution - Exit VS Code completely & then reload VS Code.

@connor4312 connor4312 added the verified Verification succeeded label Jul 1, 2022
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 2, 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 notebook-kernel Kernels issues (start/restart/switch, install ipykernel) verified Verification succeeded
Projects
None yet
Development

No branches or pull requests

6 participants