Trying to run Python 3.10 from Terminal after Homebrew install - homebrew

I used the Homebrew command brew install python#3.10 to install Python3.10 on my Mac.
However, when I'm in Terminal and type python and then press Tab, it is only giving me the option for the Python 3 that's located in my /usr/bin/
How do I enter the 3.10 interpreter that's located in /opt/homebrew/Cellar/

Running brew info python#3.10 will give you the solution to your problem:
If you need to have python#3.10 first in your PATH, run:
echo 'export PATH="/opt/homebrew/opt/python#3.10/bin:$PATH"' >> ~/.zshrc

Related

How to install wget with --debug option?

I try to install wget with the --debug option.
https://discourse.brew.sh/t/how-to-install-wget-with-debug-support/1672
But the following does not work. Does anybody know how to install wget with the --debug option of wget?
$ brew reinstall wget --with-debug
Usage: brew reinstall [options] formula
Uninstall and then install formula using the same options it was originally
installed with, plus any appended brew formula options.
Unless HOMEBREW_NO_INSTALL_CLEANUP is set, brew cleanup will then be run for
the reinstalled formulae or, every 30 days, for all formulae.
-d, --debug If brewing fails, open an interactive
debugging session with access to IRB or a
shell inside the temporary build directory.
-s, --build-from-source Compile formula from source even if a
bottle is available.
-i, --interactive Download and patch formula, then open a
shell. This allows the user to run
./configure --help and otherwise
determine how to turn the software package
into a Homebrew package.
--force-bottle Install from a bottle if it exists for the
current or newest version of macOS, even if
it would not normally be used for
installation.
--keep-tmp Retain the temporary files created during
installation.
-f, --force Install without checking for previously
installed keg-only or non-migrated
versions.
-v, --verbose Print the verification and postinstall
steps.
--display-times Print install times for each formula at the
end of the run.
-q, --quiet Suppress any warnings.
-h, --help Show this message.
Error: invalid option: --with-debug
Run brew edit wget and add there --enable-debug, save, then run brew install --build-from-source wget

Why can't I use "qmake" on mac after installing it?

I'm trying to compile a project, and I need to run "qmake" before "make".
I'm on a Mac, so I use homebrew to install dependencies.
brew install qt
It successfully installed. However, when I run qmake my Mac tells me:
-bash: qmake: command not found
I'm not sure what is wrong. Why is the command not found when brew successfully installed it?
You can type brew info qt to obtain the answer of your question:
This formula is keg-only, which means it was not symlinked into /usr/local,
because Qt 5 has CMake issues when linked.
If you need to have this software first in your PATH run:
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile
After adding the proposed line to your ~/.bash_profile with
echo 'export PATH="/usr/local/opt/qt/bin:$PATH"' >> ~/.bash_profile
and running it with:
. ~/.bash_profile
you will have qmake available to your command line but if you use it beware of interactions with cmake.

How to tell if homebrew is installed on Mac OS X

I am doing some Rails programming and I consistently see Homebrew referenced in solutions around the web but have never used it.
I also notice Homebrew in the terminal version 2.9 as an option next to "Shell -> New" from the terminal drop down but when I select homebrew and issue commands, they fail.
Usually with the "command not found" error.
Strangely enough I have been unable to locate a simple command to determine whether brew is installed or not.
How do I check to see if Homebrew is already installed on my Mac?
brew help. If brew is there, you get output. If not, you get 'command not found'. If you need to check in a script, you can work out how to redirect output and check $?.
I use this to perform update or install:
which -s brew
if [[ $? != 0 ]] ; then
# Install Homebrew
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
brew update
fi
The standard way of figuring out if something is installed is to use which.
If Brew is installed.
>>> which brew
/usr/local/bin/brew
If Brew is not installed.
>>> which brew
brew not found
Note: The "not installed" message depends on your shell. zsh is shown above. bash will just not print anything. csh will say brew: Command not found. In the "installed" case, all shells will print the path.)
It works with all command line programs. Try which grep or which python. Since it tells you the program that you're running, it's helpful when debugging as well.
While which is the most common way of checking if a program is installed, it will tell you a program is installed ONLY if it's in the $PATH. So if your program is installed, but the $PATH wasn't updated for whatever reason*, which will tell you the program isn't installed.
(*One example scenario is changing from Bash to Zshell and ~/.zshrc not having the old $PATH from ~/.bash_profile)
command -v foo is a better alternative to which foo. command -v brew will output nothing if Homebrew is not installed
command -v brew
Here's a sample script to check if Homebrew is installed, install it if it isn't, update if it is.
if [[ $(command -v brew) == "" ]]; then
echo "Installing Hombrew"
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
else
echo "Updating Homebrew"
brew update
fi
brew -v or brew --version does the trick!
I just type brew -v in terminal if you have it it will respond with the version number installed.
Location of the brew where it installed
which brew
version of home brew install
brew --version
[ ! -f "`which brew`" ] && echo "not installed"
Explaination: If brew is not installed run command after &&
brew doctor checks if Homebrew is installed and working properly.
use either the which or type built-in tools.
i.e.: which brew or type brew
Maybe your mac don't received the path
enter image description here
Run command below
eval "$(/opt/homebrew/bin/brew shellenv)"
And run to check that work
brew help
Beginners normally do, the homebrew --version which is wrong.
Do instead, brew --version. brew help works also. If these two commands are not executed, you don't have homebrew installed.
Another one possible way:
# Check if Ninja is installed
if ! which ninja > /dev/null
then
echo 'Ninja installation...'
brew install ninja
fi
In my case Mac OS High Sierra 10.13.6
brew -v
OutPut-
Homebrew 2.2.2
Homebrew/homebrew-core (git revision 71aa; last commit 2020-01-07)
Homebrew/homebrew-cask (git revision 84f00; last commit 2020-01-07)
Yes you can run which brew, but you may have it installed and it says it is not found if you are using zsh. You will need to add it to your .zshrc file.
I find it simple to use brew help command to find it is installed or not. There was a user guide on the homebrew download page.
If it is not installed then it will show 'command not found'
If you need to install homebrew then paste this on terminal:
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
jest write brew -v in terminal and if you have it , you will see there version number and the install date .
like this :
Homebrew 3.3.12
Homebrew/homebrew-core (git revision c3cacc9cd1d; last commit 2022-01-31)
Homebrew/homebrew-cask (git revision fb6ec06d8b; last commit 2022-01-31)
Once you install Homebrew, type command brew doctor in terminal.
If you get the following message:
Your system is ready to brew
then you are good to go and you have successfully installed homebrew.
If you get any warnings, you can try fixing it.
Another way to do it is using the "command" builtin tool
if [ "$(command -v brew)" ]; then
echo "command \"brew\" exists on system"
fi
in your terminal, do which brew and itll tell you where it was installed at within your computer, but itll only work in zsh not in bash.
Running Catalina 10.15.4 I ran the permissions command below to get brew to install
sudo chown -R $(whoami):admin /usr/local/* && sudo chmod -R g+rwx /usr/local/*

Jekyll watch not working with

I am trying to use Jekyll with Vagrant and for some reason when I try to use the jekyll serve -w command it will start the server and build everything fine, but when I try and edit a file it will not rebuild.
Since version 2.0.0 [1] of Jekyll you can use --force_polling with --watch in order for Jekyll to pick up changes outside of Vagrant.
[1] https://github.com/jekyll/jekyll/blob/master/History.markdown
If you're on OS X with python v2.7.6 (check with python -V) you need to downgrade to 2.7:
brew update
brew install pyenv
echo 'if which pyenv > /dev/null; then eval "$(pyenv init -)"; fi' >> ~/.bashrc
source ~/.bashrc
pyenv install 2.7
pyenv global 2.7

What is required and how to install zucchini framework on Mac OSX?

Zucchini framework seems a promising candidate for quality assurance of iOS user interfaces.
However, the installation steps provided on their website assume that most of the prerequisites already exist OR that one is already familiar with the intricacies of command line.
I would like to know what requires to be installed before I can successfully install and use zucchini framework on Mac OSX.
Requirements
Zucchini framework has the following requirements:
Ruby >= 1.9.3
Xcode >= 4.2 (for this installation process we require Xcode >= 4.6.2)
Xcode command line tools
Nodejs
Coffee script (node module)
How to install
Install Homebrew
$> ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
Update Homebrew
$> brew update
Install imagemagick and nodejs
$> brew install imagemagick node
Install coffee script module for nodejs
i. Install coffee script
$> npm install coffee-script
ii. Add coffee bin to your PATH environment variable
$> cd ~
$> sudo vim .bash_profile
Press i, to switch into insert mode then add following line
PATH=$PATH:$HOME/node_modules/coffee-script/bin
Press :w to save and
Press :q to quit vim
Now relaunch the terminal.
iii. Verify that coffee script is successfully installed.
At the prompt
$> coffee
To exit from coffee script type following at the coffee> prompt:
process.exit()
Install command line tools for Xcode
Install and/or update ruby (if its less than 1.9.3)
i. ruby is installed on Mac OSX by default, verify using the following command:
$> ruby -v
ii. Install rvm (Ruby version manager)
$> \curl -L https://get.rvm.io | bash -s stable --rails
--autolibs=enabled
iii. Add rvm bin directory to path variable
$> sudo vim .bash_profile
Insert the following line, save and quit
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm"
Relaunch the terminal.
iv. Update ruby to 1.9.3 or later
$> rvm install 1.9.3
Install zucchini
$> gem install zucchini-ios
NOTE: I have included the reference for each step from where I got help during installation.

Resources