I have installed Anaconda 3 and VS Code on Windows 10. I am interested in running Rust in a notebook, and I found CodeBook which seemed to fit the bill. I installed Rust using conda in an environment conda create -n rust_env -c conda-forge rust
, and then installed the rust-analyzer
extension in VS Code and created a markup document which I opened in CodeBook.
However, when I try to run a cell, I find that rust-analyzer
has scanned 0 of 0 roots and "failed to load workspace 'cargo' - program not found".
If I activate the rustenv
using conda in the terminal I can run cargo --version
, but it seems that CodeBook is not running Rust in the right environment. Any idea how I can set this?
I cannot find any help in the rust-analyzer manual: https://rust-analyzer.github.io/manual.html
VS Code showing conda environment in terminal
UPDATE: I have added the rust executables to the path:
C:\ProgramData\Anaconda3\envs\rustenv\Library\bin
Now there are server errors...
[Info - 2:10:43 pm] Connection to server got closed. Server will restart.
[Error - 2:10:43 pm] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 2:10:43 pm] Rust Analyzer Language Server client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 2:10:43 pm] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
[Info - 2:10:45 pm] Connection to server got closed. Server will restart.
[Error - 2:10:45 pm] Server initialization failed.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 2:10:45 pm] Rust Analyzer Language Server client: couldn't create connection to server.
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 2:10:45 pm] Restarting server failed
Message: Pending response rejected since connection got disposed
Code: -32097
[Error - 2:10:45 pm] The Rust Analyzer Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.
I don't understand what this means...