Tag Archives: macOS

[Solved] Homebrew Error: xcrun: error: invalid active developer path

Recently, I found an error when installing things with homebrew. It turned out that homebrew was not adapted after my Mac updated maxos big sur11. In addition, the Xcode tool was deleted before, resulting in the following error:

Input directly at the terminal and xcrun will be installed

xcode-select --install

It can be used directly after installation

[Solved] Mac homebrew error: Error: homebrew-core is a shallow clone.

Mac command line execution:

brew update 

The following error is reported:

Error: 
  homebrew-core is a shallow clone.
To `brew update`, first run:
  git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow
This command may take a few minutes to run due to the large size of the repository.
This restriction has been made on GitHub's request because updating shallow
clones is an extremely expensive operation due to the tree layout and traffic of
Homebrew/homebrew-core and Homebrew/homebrew-cask. We don't do this for you
automatically to avoid repeatedly performing an expensive unshallow operation in
CI systems (which should instead be fixed to not use shallow clones). Sorry for
the inconvenience!

The cause of this problem is usually the problem caused by the system update.

Solution: delete the homebrew core and then update it

cd /usr/local/Homebrew/Library/Taps/homebrew
rm -rf homebrew-core
brew upgrade

MacOS rvictl -s Error: Starting device failed [How to Solve]

After mac os big sur, the security of Apple system is improved, which causes rvictl -s to fail to create a virtual network card.

Solution:

Restart the mac in recovery mode.
1. After booting, press and hold command + r until you enter the boot page
2. Select terminal in the upper left menu bar, type csrutil disable, and then select reboot in the upper left menu bar.
3. After rebooting, go to Security and Privacy, open the small lock in the lower left corner, there is an Apple. The computer will restart automatically.
3. Run rvictl -s device udid again and it will work.

MAC MYSQL Start Error: The server quit without updating PID

1. System configuration information:

System MacOS bigsur 11.6
MySQL 8.0.26

2. Start MySQL service:

sudo /usr/local/mysql/support-files/mysql. server start

The error message is as follows:

Starting MySQL
.. ERROR! The server quit without updating PID file (/usr/local/mysql/data/jinjideleishen.local.pid).

Solution commands
mac default user is _mysql, under linux the default user of mysql is mysql
Use chown to change the owner of the specified file to the specified user or group
-R : Process all files in the specified directory and its subdirectories

sudo chown -R _mysql:_mysql /usr/local/mysql/

Restart successful:

 sudo /usr/local/mysql/support-files/mysql.server restart
 ERROR! MySQL server PID file could not be found!
Starting MySQL
.................................................... SUCCESS!

3. Stop MySQL service

sudo /usr/local/mysql/support-files/mysql.server stop

4. Restart MySQL service

sudo /usr/local/mysql/support-files/mysql.server restart

How to Solve M1 chip import numpy Error

Error report of M1 chip import numpy

Environmental installation method:

miniforge – python3. 9 numpy 1.21.1

Operation error:

## terminal/pycharm error
import numpy
import pandas 

Error Messages:
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:

https://numpy.org/devdocs/user/troubleshooting-importerror.html

At the same time, the python version and numpy version are given, and many files in the miniforge folder no such file are mentioned repeatedly

Solution:

conda install openblas

Import again works normally

[Solved] electron-builder Package mac Error: panic: runtime error: index out of range

An error is reported in the packaging mac of electron builder. The detailed error information is as follows:

goroutine 1 [running]:
github.com/develar/app-builder/pkg/icons.ConvertIcnsToPng(0xc0000ca630, 0x2d, 0x7ffd9f40874a, 0x2e, 0x2, 0x2, 0xc0000ca630, 0x2d, 0xe53320)
	/Volumes/data/Documents/app-builder/pkg/icons/icns-to-png.go:60 +0x4ab
github.com/develar/app-builder/pkg/icons.doConvertIcon(0xc00012a400, 0x5, 0x8, 0xc00025ec20, 0x2, 0x2, 0x7ffd9f4086ec, 0x3, 0x7ffd9f40874a, 0x2e, ...)
	/Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:226 +0xa0d
github.com/develar/app-builder/pkg/icons.ConvertIcon(0xc0000ad3c0, 0x97, 0x0, 0xf6400f7800000000)
	/Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:56 +0xd6
github.com/develar/app-builder/pkg/icons.ConfigureCommand.func1(0xc0002375f0, 0x40b705, 0xc2b0e0)
	/Volumes/data/Documents/app-builder/pkg/icons/icon-converter.go:33 +0x7f
github.com/alecthomas/kingpin.(*actionMixin).applyActions(0xc000124d98, 0xc0002375f0, 0x0, 0x0)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/actions.go:28 +0x6d
github.com/alecthomas/kingpin.(*Application).applyActions(0xc0000e8780, 0xc0002375f0, 0x0, 0x0)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:557 +0xdc
github.com/alecthomas/kingpin.(*Application).execute(0xc0000e8780, 0xc0002375f0, 0xc00021b150, 0x1, 0x1, 0x0, 0x0, 0x0, 0x904545)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:390 +0x90
github.com/alecthomas/kingpin.(*Application).Parse(0xc0000e8780, 0xc0000ae010, 0xf, 0xf, 0xc0000e8780, 0xc00008a058, 0x0, 0x0)
	/Volumes/data/go/pkg/mod/github.com/alecthomas/[email protected]+incompatible/app.go:222 +0x213

Solution:
put 512×512 in the icons directory of the icon Png icon to complete packaging
for example:
dist/icons/512x512.png

[Solved] Mac starts redis error: there is no specified conf file

Errors are reported as follows:

Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf

The reason for the error is that the corresponding conf file needs to be specified during startup. The
startup command is as follows

redis-server /Absolute path/to/redis.conf

Find redis in this machine as shown below The conf path is then copied down

Start the MAC terminal CD to the redis path. Enter:

redis-server /Users/zhangheng/Desktop/Tools/Redis/redis-6.2.6/redis.conf

Press enter after input to start redis normally

mac brew install mysql ‘/tmp/mysql.sock’ (2) [How to Solve]

the reason for the error is very simple: MySQL should be used instead of MySQL when starting the command server

mac brew install mysql

Install MySQL with homebrew on Mac to perfectly solve error 2002 (HY000):

Can’t connect to local MySQL server through socket ‘/tmp/mysql.Sock ‘(2) error

1. Start the command mysql server

the startup method of using MySQL command directly is wrong

This problem occurs when you directly call the MySQL command. It is said on the Internet that it is because of MySQL Caused by CNF configuration file.

the correct startup method is mysql server

➜  support-files mysql
ERROR 2002 (HY000): Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)
➜  support-files pwd
/opt/homebrew/opt/mysql/support-files
➜  support-files ls
mysql-log-rotate    mysql.server        mysqld_multi.server

2. my.CNF file location

my.CNF file location

➜  homebrew cd etc
➜  etc ls
bash_completion.d   ca-certificates     dump.rdb            my.cnf              [email protected]         
redis-sentinel.conf redis.conf
➜  etc pwd
/opt/homebrew/etc

3. MySQL installation location

➜  homebrew cd opt
➜  opt ls
ca-certificates jasper          libevent        libpng          lz4             [email protected]     pzstd           six
devil           jpeg            libjpeg         libtiff         mysql           protobuf        redis           zlib
icu4c           lcms2           libjpg          little-cms2     [email protected]       [email protected]   [email protected]       zstd
➜  opt cd mysql
➜  mysql ls
INSTALL_RECEIPT.json      LICENSE.router            README.router             homebrew.mxcl.mysql.plist lib                       support-files
LICENSE                   README                    bin                       homebrew.mysql.service    mysqlrouter-log-rotate
LICENSE-test              README-test               docs                      include                   share
➜  mysql pwd
/opt/homebrew/opt/mysql
➜  mysql

Mac ERROR launching JD-GUI [How to Solve]

After updating the system, open JD GUI and report the following error:

ERROR launching 'JD-GUI'

No suitable Java version found on your system!
This program requires Java 1.8+
Make sure you install the required Java version.

Solution:
1. Right click JD_GUI icon showing package content

2. Locate the file Universal Java application stub file and open it with a text editor

3. Use https://raw.githubusercontent.com/tofi86/universalJavaApplicationStub/master/src/universalJavaApplicationStub Replace the content in the universal Java application stub with the content in

4. Reopen to use

MAC install lightgbm and xgboost Error [How to Solve]

MAC system + anaconda3 + Python 3 eight point eight

The two integrated learning algorithm packages lightgbm and xgboost were successfully installed
, but errors were always reported during import

---------------------------------------------------------------------------
OSError                                   Traceback (most recent call last)
<ipython-input-5-b18b3f8a6dc8> in <module>
----> 1 import lightgbm

dlopen(/Users/kumahiroshi/opt/anaconda3/lib/python3.8/site-packages/lightgbm/lib_lightgbm.so, 6): Library not loaded: /usr/local/opt/libomp/lib/libomp.dylib
  Referenced from: /Users/kumahiroshi/opt/anaconda3/lib/python3.8/site-packages/lightgbm/lib_lightgbm.so
  Reason: image not found

Always report: oserror reason: image not found

After consulting the data, it is found that you only need to re import this line of code after running on the terminal: brew install libomp


brew install libomp

Done!
Need to install: Homebrew,
Install commands:ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"