'command not found: vcpkg after downloading it in macOS

I am trying to open an OpenCV project using Vscode in macOS. To run it, I need to download the OpenCV packages. [enter image description here][1] [1]: https://i.stack.imgur.com/bMl1N.png

Then I was led to the vcpkg web page and tried to install it following the instructions.

Step 1: Clone the vcpkg repo

git clone https://github.com/Microsoft/vcpkg.git

Step 2: Run the bootstrap script to build vcpkg

./vcpkg/bootstrap-vcpkg.sh

After Step 2, the following texts were showed in the terminal:

/vcpkg/bootstrap-vcpkg.sh
Downloading vcpkg-macos...
Telemetry
---------
vcpkg collects usage data in order to help us improve your experience.
The data collected by Microsoft is anonymous.
You can opt-out of telemetry by re-running the bootstrap-vcpkg script with -disableMetrics,
passing --disable-metrics to vcpkg on the command line,
or by setting the VCPKG_DISABLE_METRICS environment variable.

Read more about vcpkg telemetry at docs/about/privacy.md

I don't know if this means a successful installation. When I try to search or install a package, it says

vcpkg search [opencv2] command not found: vcpkg

How could I fix it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source