Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
671 views
in Technique[技术] by (71.8m points)

blockchain - How do I install the Rust crate in3?


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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:

  1. Run cargo init. This will create a new binary package
  2. Edit Cargo.toml and add the in3 dependency and version.
  3. Modify the main.rs file to use the in3 library.
  4. 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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...