'[email protected] not getting linked with Homebrew - trying to install postgresql

My system is OS Mojave 10.14.6, when I try to install postgresql I have this error:

Error: An exception occurred within a child process:
  RuntimeError: /usr/local/opt/[email protected] not present or broken
Please reinstall [email protected]. Sorry :(

When I try to install [email protected] I have this message:

brew install [email protected]
Running `brew update --preinstall`...
==> Auto-updated Homebrew!
Updated 1 tap (homebrew/cask).
==> Updated Casks
Updated 8 casks.

Warning: [email protected] 1.1.1n is already installed, it's just not linked.
To link this version, run:
  brew link [email protected]
➜  / brew link [email protected]
Warning: Refusing to link macOS provided/shadowed software: [email protected]
If you need to have [email protected] first in your PATH, run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

For pkg-config to find [email protected] you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

And then when I try to force hombrew link openssl, I get this message

Warning: Refusing to link macOS provided/shadowed software: [email protected]
If you need to have [email protected] first in your PATH, run:
  echo 'export PATH="/usr/local/opt/[email protected]/bin:$PATH"' >> ~/.zshrc

For compilers to find [email protected] you may need to set:
  export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
  export CPPFLAGS="-I/usr/local/opt/[email protected]/include"

For pkg-config to find [email protected] you may need to set:
  export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

I added the lines to .zshrc file like suggested:

export PATH="/usr/local/opt/[email protected]/bin:$PATH"
export LDFLAGS="-L/usr/local/opt/[email protected]/lib"
export CPPFLAGS="-I/usr/local/opt/[email protected]/include"
export PKG_CONFIG_PATH="/usr/local/opt/[email protected]/lib/pkgconfig"

But I kept on having the message when retrying to intall postgresql

Error: An exception occurred within a child process:
  RuntimeError: /usr/local/opt/[email protected] not present or broken

I have read and try everything I found on the net regarding this question. I don't find any solution, any help would be very useful thanks!

UPDATE: I got homebrew from this command :

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"

and The pg version in my rails gemfile is gem "pg", "1.3.5" but I just tried brew install pg, and bundle install fails also

UPDATE 2 when trying to

brew reinstall openssl

openssl@3 is installed and I get this message:

openssl@3 is keg-only, which means it was not symlinked into /usr/local,
because macOS provides LibreSSL.

and then when I try to

brew install postgresql

I have the same error: Error: An exception occurred within a child process: RuntimeError: /usr/local/opt/[email protected] not present or broken Please reinstall [email protected].



Solution 1:[1]

I am having this same issue and did much of what cecileRx did as well to no avail. I am getting this issue as part of the 'brew install px4-sim-jmavsim' step in this PX4-Autopilot setup. https://docs.px4.io/master/en/dev_setup/dev_env_mac.html

UPDATE: I think I got around this by uninstalling openssl and then installing [email protected]

brew uninstall openssl
brew install [email protected]

Running those two commands resolved the errors I was getting that matched those described in the questions.

Solution 2:[2]

What works for me is: df[df["ticket_status"]== 'PENDING'].value_counts().count() This will give the number of tickets that have a ticket_status of 'PENDING'.

Solution 3:[3]

If your goal is to count all distinct instances in a column you can use df['ticket_status'].value_counts()

For counting values with conditional you can use df.where(df['ticket_status'] == 'myvalue').count()

A helpful guide for you to compare your queries from SQL to pandas would be https://pandas.pydata.org/docs/getting_started/comparison/comparison_with_sql.html

Solution 4:[4]

Try this:

df.ticket_status.value_counts()

Sources

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

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Kylian
Solution 3 glory9211
Solution 4 AnalyticSolutions