Truffle is installed but macOS cant find commands for any blockchain packages - installation

[I opened terminal, I ran touch ~/.zshrc, then I downloaded nvm curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.37.2/install.sh | bash
Once that was done, I chose nvm install 15.4.0 because it's the latest version. Woo whoo, it downloads. Everything is working great... I can even install truffle... I run that command. I type in truffle --version.. will you look at that.. it works... Okay, lets try running all of these same commands in a new Terminal. No. none of them work. Nothing works. I reinstall, over and over again. Still wont work. I touch the zshrc file and try doing it with bash instead, but why would I download truffle and nvm twice? why won't it run normally if I downloaded it without any issues. WHat's the problem here?
]1

Related

Mas OS Big Sur update - Python3 / conda / pip not found

Sorry if this is a stupid question. I use python/jupyter a lot and it's stopped working after updating from Mac OS High Sierra to Big Sur. I'm trying to figure out why, but I'm not great with command line stuff.
The problem. When I try python3, pip -v, conda, etc. it says "command not found". python still seems to run, but it's 2.7 and I know I had 3 (I probably had a few versions from untidy file systems). I want to avoid reinstalling all my packages and things again, because I know it's still there and I've done this a few times already.
Some clues. I know this OS upgrade moves me from bash to zsh. I've tried just switching back to bash with chsh -s /bin/zsh but it still says command not found. I also noticed the OS update creates a Mac HD (below System/Volumes) within my Mac HD, and in that second one seems to be still all my python3/conda/pip/etc. folders. Not sure if/how this matters. Or if this is just a path issue.
I just want to get Jupyter running again on my Mac without reinstalling all my myriad packages from square one. Any help appreciated!
After extreme toil and research, I finally found something that worked for me.
Find the location of your Anaconda3. For me it was in ~/opt/anaconda3
Open terminal and type source <location of anaconda3>/bin/activate and then in the next line, write conda init zsh
Close your terminal and open it again. You should see a prefix (base) when you open it again.
All in all, for me it was
rko3 ~ % source opt/anaconda3/bin/activate
rko3 ~ % conda init zsh
Let me know if this works for you!
PS. You may be tempted to change $PATH variables. Anaconda advises against that. Use this reference instead that suggests the above. https://docs.anaconda.com/anaconda/install/mac-os/
I've just resolved this exact issue on my machine after upgrading to Big Sur from Mojave.
The issue: MacOS, as of Catalina, no longer lets you use the system root folder. Anaconda used to install in this folder. After upgrading from Mojave to Big Sur, you'll likely find your anaconda3 folder, including all your environments and packages, located here: /System/Volumes/Data/anaconda3.
Here is what to do to fix it:
Open Terminal
Move the anaconda3 folder:
sudo mv /System/Volumes/Data/anaconda3 ~/
Download Anaconda's Conda Prefix Replacement (crp) tool:
curl -L https://repo.anaconda.com/pkgs/misc/cpr-exec/cpr-0.1.1-osx-64.exe -o cpr && chmod +x cpr
Run the CRP tool (this will take a few minutes):
./cpr rehome ~/anaconda3/
Source anacoda3
source ~/anaconda3/bin/activate
Initiate conda
conda init
Quit Terminal and open it again.
Edit: Someone didn't like that I ended this answer with "That's it! Enjoy". In the scenario described, the steps above were indeed all it took to resolve the issue. If you're experiencing the same issue, I hope this helps resolve it, so you can get back to enjoying your updated OS.
Seems like your environement is not activated. Zsh sources ~/.zshrc while bash sources ~/.bashrc.
You can copy lines related to conda from your ~/.bashrc to your ~/.zshrc.
AF
Open the Anaconda navigator and click on the Environments section. There you will see the base (root) and a green triangle next to it.
Click on the triangle and select Open Terminal.
Now, in the terminal you will be already in the necessary directory for anaconda and you can then update any packages.
For example, just by writing conda update --all you can update all packages available for updates.

Keep getting: No such File or directory when I open the Terminal

Every time I open the terminal I keep getting this:
bash: /usr/local/Cellar/nvm/0.33.0/nvm.sh: No such file or directory
I have tried reloading. No idea why all of a sudden this has come up. Any guesses guys?
You need to update your nvm via homebrew:
brew upgrade nvm
I was getting the same error after I installed another NVM version manually (forgetting that I have had installed an older version via homebrew).
That resulted in a wrong path within configuration in your .bash_profile, .bashrc or any other similar file which gets started each time you run a new terminal window.
According to https://github.com/creationix/nvm#installation, look for something like
export NVM_DIR=~/.nvm
[ -s $NVM_DIR/nvm.sh ] && . $NVM_DIR/nvm.sh
This configuration is normally set while installing of NVM. I have had a wrong path in it, die above will work when your NVM resides in ~/.nvm
Hope that helps you.

installing .net core on mac

I am installing .net core on a mac and hoping to play around with it a bit on vs code. I am following the steps from
https://www.microsoft.com/net/core#macosx.
However, when I run
dotnet new
I get command not found on bash.
I have followed these previous steps
brew update
brew install openssl
brew link --force openssl
I have also downloaded the core package (installed successfully). I do not see any other steps. Wondering if I am missing a step or how to identify what is missing?
Sometimes I am not sure why the installer doesn't add the PATH to your environment.
Run below in terminal and reopen the terminal:
echo 'export PATH="$PATH:/usr/local/share/dotnet"' >> ~/.bashrc
(Note: If you are using zsh or other shells, please change the above ~/.bashrc to the initialize script of your shell, e.g. ~/.zshrc)
I ran into this same problem earlier today. The fix for me was to close out all Terminal windows, open a new one, then re-run the command.

change bash_profile not working

I am working on Mac El Capitan. I have MAMP Pro installed. I am attempting to install composer. Part of the process is making it accessible globally. I have gone in and done vim ~/.bash_profile and added: export PATH=/Applications/MAMP/bin/php/php7.0.0/bin:$PATH
I am using PHP 7.0.0. However when I save and exit (escape :wq) and then run which PHP it is still pointing to the original folder. I have exited out of the terminal window and come back in. I have also run source ~/.bash_profile. Still the which php version points to /usr/bin/php
Any suggestions for what to try next?
This solution worked for me except I ended up putting composer in an apps folder rather than in my usr/bin.
telliott.io/node/969

How to put psql on the path when using Postgres.app on OS X?

I've installed Postgres93 on my Mac. I can open the application, and "Open psql" through the app which opens up a command line interface with psql.
However, when I type $ which psql nothing is returned. The installation path is /Applications/Postgres93.app. How do I make $ which psql show the correct result?
Mac OS X - Mavericks
PostgreSQL package, I'm not as sure about. I went here and downloaded it - http://postgresapp.com/
I just had postgres installed and was not able to run the psql command until I ran the following command in my terminal:
export PATH="/Applications/Postgres.app/Contents/Versions/9.5/bin:$PATH"
Now the terminal knows where to find postgres when I use the psql command.
Remember to replace the version number '9.5' with your current version.
I had the same problem with nothing showing for the which psql command till I run the command below to resolve it. The command provided below is just a little tweak of what has already been provided by others here. The only difference is, instead of providing a specific postgres version number in the command, you can simply tell postgres to use the latest postgres version by simply running the following command:
export
PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:$PATH"
And now my terminal was able to find the path to postgres when I run which psql.
Hope this helps.
On macOS Mojave these instructions work well:
If your Postgres has not been installed yet, I suggest you use the great "brew" package manager from here https://brew.sh/ :
$ brew cask install postgres
or you can install it usual way from the website
Put this to the bottom of your ~/.bash_profile file:
export PATH="/Applications/Postgres.app/Contents/Versions/latest/bin:${PATH}"
Restart your terminal or restart your ~/.bash_profile directly with the command:
$ . ~/.bash_profile
Verify your installation:
$ psql --version
** Edited: to include a permanent fix, not just during your current session. **
I had this same problem, and also found a clear answer lacking in the docs.
To fix:
Download the new app, and follow the instructions to move it to the Applications folder
Add the new bundle to your path by typing the following in your Terminal (version number specific - mine is 9.4):
PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
To fix the issue on a permanent basis, run the same line but with export in front:
export PATH="/Applications/Postgres.app/Contents/Versions/9.4/bin:$PATH"
It appears that you installed Heroku's Postgres.app, which is a tool intended for throw-away testing and development. Add the contents of the bundle to your PATH by following the instructions in the Postgres.app documentation - see "command line tools".
On macos mojave i've added the following line on my ~/.profile :
export PATH=$PATH:/Library/PostgreSQL/10/bin
the psql command line client lies into this folder. i've used the enterprisedb installer.
I just experienced the same problem, and solved it by adding export PATH=$PATH:/Applications/Postgres.app/Contents/Versions/9.4/bin to .bash_profile. Note that this line is version-specific, so be sure to check this line against your current version of Postgres.app.
Using Mac OS Monterey, the latest Homebrew (3.4.0) and postgres#13.
I was able to add psql to the path by using -
export PATH="/opt/homebrew/Cellar/postgresql#13/13.6/bin:$PATH"
Replace #13 and 13.6 with your version.
The latest homebrew install location seems to be /opt/homebrew/*
I'm using catalina 10.15.3 and I had the same issue after installing psql using homebrew. Then I noticed, homebrew mentioned
==> libpq
libpq is keg-only, which means it was not symlinked into /usr/local,
because conflicts with postgres formula.
If you need to have libpq first in your PATH run:
echo 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile
So, I ran 'export PATH="/usr/local/opt/libpq/bin:$PATH"' >> ~/.bash_profile and psql was added to my path
In Mac, there is a SQL Shell application already under /Applications/PostgresSQL
try that
Also, you can run /Library/PostgreSQL/11/scripts/runpsql.sh
In my case, I installed Postgres12 and had the same issue. I had to look out for the location of my bin folder. It happened to be in /Applications/2ndQuadrant/PostgreSQL/12/bin. So I had to run export PATH="/Applications/2ndQuadrant/PostgreSQL/12/bin:$PATH" in my terminal and restart the terminal. That solved it.

Resources