Tag Archives: mac

MacOS Catalina (system): xcrun: error: invalid active developer path(), missing xcrun at / Library

Question why
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
A scenario
git
SVN is not working properly
Idea suggests that the SVN path is not correct
The solution
Open the command terminal to run

xcode-select --install

After entering, the system will pop up and download the Xcode component. Click “Ok” and the download will be completed.
xcode-select: note: install requested for command line developer tools
Problem analysis
At first, I thought the SVN path was incorrect, but it was correct after repeated confirmation.
If you think SVN is gone, consider the MAC’s own Subversion can’t go wrong.
Finally, In SVN — Version, I was given an error notification prompt:
xcrun: error: invalid active developer path (/Library/Developer/CommandLineTools), missing xcrun at: /Library/Developer/CommandLineTools/usr/bin/xcrun
And Then I Command C, Command V, and I open Baidu, and I do it all at once.
The problem summary
A lot of Mac software relies on xcode’s precursors.

Easyconnect MAC ultimate solution

EasyConnect often has problems after installation on MAC, and the most common problem should be “initialization failed, please reinstall “.
Here’s my solution:
1. Use the uninstall tool to check which files are there. I used Lemon, please have a look at my screenshot

 
2. If you look at the daemons for EasyConnect, you can see that there are two daemons here

 
3. The most important step is to add these two daemons to your boot.
Well, why don’t you come and try it

Mac installation software, error permission denied @ unlink_ internal

Problem 1.
On the MAC, I install Ansible with the following commands

# brew install Ansible

abnormal

Pouring gdbm-1.15.high_sierra.bottle.tar.gz
Error: An unexpected error occurred during the `brew link` step
The formula built, but is not symlinked into /usr/local
Permission denied @ unlink_internal - /usr/local/bin/gdbm_dump
Error: Permission denied @ unlink_internal - /usr/local/bin/gdbm_dump

2. Solutions

# sudo chown -R $(whoami):admin /usr/local

# brew update

# brew link gdb

# brew install Ansible

Mac brew fails to work and an error is reported

The BREW operation reported an error similar to the following:

brew install coreutils

Error: coreutils: /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:73: syntax error, unexpected << def caveats; <<~EOS

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:77: syntax error, unexpected tIDENTIFIER, expecting keyword_end
can add a "gnubin" directory to your PATH from your bashrc like:

/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:77: syntax error, unexpected ':', expecting keyword_end
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:79: dynamic constant assignment
    PATH="#{opt_libexec}/gnubin:$PATH"
         ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:81: dynamic constant assignment
Additionally, you can access their man pag...
             ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:81: syntax error, unexpected tIDENTIFIER, expecting keyword_do or '{' or '('
Additionally, you can access their man pages with ...
                     ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:82: syntax error, unexpected tIDENTIFIER, expecting keyword_end
the "gnuman" directory to your MANPATH from your bashrc as well:
                      ^
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:82: syntax error, unexpected ':', expecting keyword_end
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/coreutils.rb:84: dynamic constant assignment
    MANPATH="#{opt_libexec}/gnuman:$MANPATH"`

Solutions:

rm -rf /usr/local/Homebrew/.git
brew update
brew config

https://github.com/Homebrew/brew/issues/3353

macos LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

The following error occurred while submitting Git today:

LibreSSL SSL_connect: SSL_ERROR_SYSCALL in connection to github.com:443

Then I tried git clone other repositories, also reporting this error.
The proxy is used, but the solutions given by others, such as restart and reset commands, do not work.
Finally, a solution was found:

vim ~/.gitconfig

Delete the HTTPS configuration and you’re done. The proxy configuration was written to a file, so it’s no wonder Git doesn’t work.
reference
[1]. SSL_connect: SSL_ERROR_SYSCALL in connection to github.com: 443. https://stackoverflow.com/questions/48987512/ssl-connect-ssl-error-syscall-in-connection-to-github-com443
 

Error in sitecustomize set PYTHONVERBOSE for traceback KeyError: ‘PYTHONPATH’

Error in sitecustomize; Set PYTHONVERBOSE for traceback: KeyError: ‘PYTHONPATH’
1. Background of the problem
Python2.7 comes with Mac, and python3.6 comes with your own Anaconda installation. After the opencv installation, the following prompts

after the following installation steps are prompted, open Spyder to run the program again or use python3 on the terminal will be prompted as the question error
Reason 2.
Sys. path adds the site-package of Python27. conflict
3. Solve
To “…/local/lib/python3.6/site-packages/ “under directory (directory only for people)
execute $vim homebrew. PTH
remove the path inside
4. Exit terminal/restart Spyder without error

Mac reports an error zsh: fork failed: resource temporarily unavailable (reasons and solutions)

Mac report ZSH: fork failed: Resource Permanently (reason and solution)
MacOS version: 10.15.3 (19D76)
why
A few days ago, I used django-crontab to do the timing task and forgot to delete the task, which led to the continuous creation of processes in the background, and finally the terminal kept reporting errors, and the new browser and files could not be opened.
Check the following command to see that there are 1000+ processes in the background

 ps -ef | grep cron | wc -l

The solution
During this period, try to close crontab directly, but cannot close it all the time

sudo /usr/sbin/cron stop # 关闭命令
cron: cron already running, pid: 177

Final solution
First of all, empty the crontab task, delete what was created by what, for example, I passed django-crontab
So the command to remove the task is python manager.py crontab remove
Then batch delete the cron process

ps -ef | grep /usr/sbin/cron |grep -v grep | cut -c 9-15 | xargs sudo kill -9

Solve it!!
conclusion
The Mac exception occurs because the thread or open file exceeds the system limit. If such an exception is reported as an error and is frequent, and the restart does not work, you need to consider whether there is some program frantically starting the process in the background. Don’t go to modify the Mac thread/file limit, to find the root cause, if indeed because development demand process, then can consider to modify the Mac itself limits, otherwise just solve the abnormal surface, but the process is still on your background, constantly eat your system resources.

Mac installation opencv brew tap homebrew / Science

MAC use brew to install opencv, look up information when a blog said the need to add the command:

brew tap homebrew/science

always gives an error when trying:

Error: homebrew/science was deprecated. This tap is now empty as all its formulae were migrated.

, meaning homebrew/science has been removed, meaning that the brew tap step is not required.


solution: remove this step, directly brew install xx, xx refers to your package.

above.

Failed to set up listener: socketexception: address already in use

error log

2018-06-08T22:25:09.118+0800 E STORAGE  [initandlisten] Failed to set up listener: SocketException: Address already in use
2018-06-08T22:25:09.118+0800 I CONTROL  [initandlisten] now exiting
2018-06-08T22:25:09.118+0800 I CONTROL  [initandlisten] shutting down with code:48

error cause

error, error log has been clear, ‘Address already in use’ has a process has been running in the port. So we’re going to find this process and turn it off.

PID(Process Identification) operating system refers to the Process Identification number. Each time the operating system opens a program, it creates a process ID, or PID. Each process has a unique PID number, which is assigned by the process runtime system and does not represent a dedicated process. The PID does not change the identifier at run time, but after the process terminates the PID identifier is retrieved by the system and may be assigned to the newly run program.

solution

find the PID number that was run before mongo, turn it off, and re-enter the start command

songrenqingdeMacBook-Pro:bin songrenqing$ lsof -i :27017
COMMAND   PID        USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
mongod  61316 songrenqing   11u  IPv4 0xacda8b230bc07883      0t0  TCP localhost:27017 (LISTEN)
songrenqingdeMacBook-Pro:bin songrenqing$ kill -9 61316

or use another process ID, previously 27017, now specify 27018, so there will be no conflict

mongod --port 27018

iOS Xcode:Failed to create provisioning profile.

compile error:

Failed to create provisioning profile. The app ID “com.aaa.bbb.demo” cannot be registered to your development team. Change your bundle identifier to a unique string to try again.

fix: open Build Settings, search for “bundle”, change the Product bundle Identifier option, change it to an unused package name, problem solved.