"pre-commit" command is not found by bash but is installed on macOS - bash

Problem Description
I'm having trouble making commits, when I try to make a commit with the command, for example:
$ git commit -m "add readme"
pre-commit not found. Install pre-commit with the command pip3 install --user pre-commit or follow the steps on official documentation: https://pre-commit.com /#install
Following the steps described in the pre-commit installation documentation I installed by the command:
$ pip install pre-commit
However when I trigger the command the following error occurs:
$ pre-commit --version
bash: pre-commit: command not found
My attempt fails
I've tried some other solutions for this but they didn't work:
Export bash
I already tried this solution described that would be to export my ~./bashrc with the command: source ~/.profile but the following error happens:
bash:/Users/pvieira/.profile: No such file or directory
Install using homebrew
Doing so the same error that occurs when installing by pip appears here.

I was able to solve the problem by simply restarting the terminal.

I solved this problem by restarting my ubuntu system

Related

execute GitHub installation via bash on Colab

I am trying to install from a GitHub repo with bash code (the pip installation doesn't work).
I'm trying the following code (s. here for reference):
https://github.com/vi3k6i5/GuidedLDA
cd GuidedLDA
sh build_dist.sh
python setup.py sdist
pip install -e .
which I adapted for Colab to
!https://github.com/vi3k6i5/GuidedLDA
!cd GuidedLDA
!sh build_dist.sh
!python setup.py sdist
!pip install -e .
However, already the first line throws an Error: /bin/bash: https://github.com/vi3k6i5/GuidedLDA: No such file or directory
I am very new to bash, so apologies for rookie mistakes! I tried also
!"https://github.com/vi3k6i5/GuidedLDA"
!github.com/vi3k6i5/GuidedLDA
!"github.com/vi3k6i5/GuidedLDA"
Then I tried using xdg-open with
!xdg-open https://github.com/vi3k6i5/GuidedLDA
and
!apt-get install xdg-open
!xdg-open https://github.com/vi3k6i5/GuidedLDA
all to no avail.
Can someone point me in the right direction?
Previously I used the git throw command.
it was difficult for me.
Now I use GitHub desktop.
it is too easy to handle everything.
you can check this playlist ->
https://www.youtube.com/playlist?list=PLcL8q_TiioW0JLk03hM3cu_Nb5DRwBHa1

Attempting to use Sanity.io CLI results in 'zsh: command not found'

I am having a problem running Sanity's CLI. I have installed the CLI with npm install -g #sanity/cli which works without a problem, and everything is installed correctly (as far as I can tell).
However, trying to use any of their CLI instructions, such as sanity init, I get this error message:
zsh: command not found: sanity
I am using npm version 6.14.11 and node version v14.16.0.
I've also been noticing a few random commands return the same zsh: command not found for various packages.
with npx it works
npx #sanity/cli init
#user1934428 is right.
I just change in the command "sanity ..." to "usr/local/Cellar/node/16.3.0/lib/node_modules/#sanity/cli/bin/sanity ..." and it worked
I had a similar problem on my mac which was caused by not installing sanity globally.
Go to your terminal and enter:
sudo chown -R $(whoami) $(npm config get prefix)/{lib/node_modules,bin,share}
Enter your password then install sanity globally
npm install -g ng
This should solve the issue and sanity commands should work too.

Problem installing git subrepo on MacOs bash 5

I was trying to install git subrepo on MacOs with bash 5.0.18 installed. When I source .bashrc, I get error message :
The git-subrepo command requires that 'Bash 4+' is installed. It
doesn't need to be your shell, but it must be in your PATH. You appear
to be on macOS. Try: 'brew install bash'. This will not change your
user shell, it just installs 'Bash 5.x'.
Is git subrepo not compatible with bash 5 or is there any solution to make it work?
https://github.com/ingydotnet/git-subrepo
apparently, I can install it using brew with less hassle:
brew install git-subrepo
It should be a PATH issue, as illustrated by ingydotnet/git-subrepo issue 463
I realized there was a part of my path not being specified which caused this issue.

What is this error `make.exe": no_c_compiler: Command not found`

I'm trying to build grpc from source on Windows 2012 Server edition. I downloaded and installed Python 3.5 from the Python website and installed the entire MinGW package as well as git along with git bash. Following the instructions for building from source:
$ git clone https://github.com/grpc/grpc.git
$ cd grpc
$ git submodule update --init
$ make
$ [sudo] make install
I get the aforementioned error after executing make. Here's the shell output for your perusal.
PS C:\Users\thunderboltsid\grpc> make
[MAKE] Generating /c/Users/thunderboltsid/grpc/libs/opt/pkgconfig/grpc.pc
[MAKE] Generating /c/Users/thunderboltsid/grpc/libs/opt/pkgconfig/grpc_unsecure.pc
[MAKE] Generating cache.mk
[C] Compiling third_party/zlib/adler32.c
make.exe": no_c_compiler: Command not found
make.exe": *** [/c/Users/thunderboltsid/grpc/objs/opt/third_party/zlib/adler32.o] Error 127
I really can't understand what is this error supposed to be. Tried googling but that didn't help. Any input will be appreciated.
you may need run apt-get install which
install build-base in your system, example:
apt-get install build-base
You may simply have no C compiler installed, not even gcc. If that's the reason then installing gcc resolves the issue:
apt get install gcc

Updated Git but still showing old version

I downloaded and installed Git 1.8.4.2 from this link: http://git-scm.com/downloads. However, when I run git --version from the Terminal I get:
[~/workspace/ruby]: git --version
git version 1.7.4.4
I've tried restarting the terminal and my computer. I then tried using the info at https://code.google.com/p/git-osx-installer/wiki/Uninstall. I did the following in the terminal from within /usr:
sudo rm -rf /usr/local/git
sudo rm /etc/paths.d/git
sudo rm /etc/manpaths.d/git
I then ran the new git .dmg file again but am still getting 1.7.4.4 when I run git --version. I suppose there's something going on here with the Mac filesystem that I don't understand. Any help would be greatly appreciated!
Run the command:
which git
You'll probably see /usr/bin/git -- the Apple supplied version. This will be because /usr/bin appears in your PATH environment variable before /usr/local/git/bin. You can verify this by running the command:
echo $PATH
If that is the case then run this command:
export PATH=/usr/local/git/bin:$PATH
and then try git --version again. You should now get 1.8.4.2. This hasn't fixed it permanently yet though. You'll need to add the export PATH=... line to your ~/.bashrc so that it gets set for every shell.

Resources