I think you may have misunderstood package management with cargo.
Since in3
is a library and not a binary crate, you cannot install it.
cargo install
does not install dependencies like npm install
or pip install
does. cargo install
will install binaries into your local filesystem (typically $HOME/.cargo/bin) for you to run.
Cargo will resolve dependencies for you when you cargo run/check/build
. You do not need to install dependencies.
You may want to start a new folder structure and try the following:
- Run
cargo init
. This will create a new binary package
- Edit
Cargo.toml
and add the in3
dependency and version.
- Modify the
main.rs
file to use the in3
library.
- Run the program with
cargo run
. You will notice that cargo is resolving various dependencies while compiling your program.
For more info on Cargo, here is the getting started guide.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…