简体   繁体   中英

Java Runtime Error python pip install package in big sur

i am trying to install cv2 package.

sudo apt install python-opencv

while run above line getting error below:

The operation couldn’t be completed. Unable to locate a Java Runtime that supports apt.
Please visit http://www.java.com for information on installing Java.

Note: the following answer assumes that you use MacOS, which I suspect you do. If you are not using this OS then this solution will not work.

Apparently, the error has nothing to do with installing the package. In the past Java used to ship with a tool called apt . To manage installations on Linux you need to use the Advanced Package Tool , which is probably what you tried to do. This won't work on MacOS however! You need to use the brew command, which is the apt equivalent for Mac.

apt is not supported on MacOS.

Please try again,

sudo brew install python-opencv

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM