For more details see: ’go help gopath’ - macos

I'm learning Go and I have some problem.
I following
go install
But an error:
no install location for directory /Users/skan/documents/study/golang/src/section1 outside GOPATH
For more details see: ’go help gopath’
so I return to my .bash/profile
this is my .bash/profile
# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by ’conda init’ !!
__conda_setup=”$(CONDA_REPORT_ERRORS=false ’/anaconda3/bin/conda’ shell.bash hook 2> /dev/null)”
if [ $? -eq 0 ]; then
\eval ”$__conda_setup”
else
if [ -f ”/anaconda3/etc/profile.d/conda.sh” ]; then
. ”/anaconda3/etc/profile.d/conda.sh”
CONDA_CHANGEPS1=false conda activate base
else
\export PATH=”/anaconda3/bin:$PATH:$GOPATH:$GOBIN”
fi
fi
unset __conda_setup
# <<< conda init <<<
export GOPATH="/Users/skan/Documetns/study/golang"
export GOBIN=$GOPATH/bin

Try:
mkdir -p $GOPATH/bin
The error you're seeing is the installation directory doesn't exist, so install can't do anything.
Also, there's a typo here:
export GOPATH="/Users/skan/Documetns/study/golang"
So, same reasoning, but, try Documents

Related

Having trouble installing Rspec

So this is my first time asking a question here, so please bear with me. For the past few DAYS I've been trying to install rspec onto my system. After an introductory project a couple of months ago I became familiar with the fact that my Mac has ruby installed and it won't let me really install any gems as it would reply with a permissions denied notice. So I installed ruby from homebrew and went about my coding. Now present day I want to install rspec following a walkthrough I'm working on but the system won't let me. I've looked online and I thought it was my PATH and even tried changing it multiple times and it wouldn't work. At one point my terminal wouldn't even read the entirety of my bash_profile even though I source'd the file more than once. I've since updated to zsh and it's the exact same thing.
export PATH="/usr/local/opt:${PATH}"
export PATH="/usr/bin:/bin:/sbin:/sbin"
PATH="/usr/local/Cellar/ruby/2.7.2/bin:${PATH}" export PATH
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# Setting PATH for Python 3.7
# The original version is saved in .bash_profile.pysave
PATH="/Library/Frameworks/Python.framework/Versions/3.7/bin:${PATH}"
export PATH
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/name/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/name/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/name/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/name/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/name/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/name/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
echo "Hello World"
export PATH="/usr/local/opt/ruby/bin:$PATH"
export PATH="/usr/local/bin:$PATH"

how to fix .bash_profile? pip3 is not installing packages to Anaconda Python (Mac OS 10.15.4)

After installing new packages using pip3 in my Conda env, I am not able to importing them in jupyter.
(base) MacBook-Air:~ johnsmith$ which python
/usr/bin/python
Looking at other posts, I understand this means that my default python is not the condo python install so I'm not getting the packages installed to the correct location. Also looking at other posts, I think I might need to fix my .bash_profile file to point pip3 to the right python version. Unfortunately, the file looks messy with several conda initializations. Maybe these are leftovers from previous condo installs. How do I fix this bash file? (I changed the user name but otherwise the file is identical).
export LD_LIBRARY_PATH=/Users/johnsmith/homework/mjpro131/bin
export PATH="$LD_LIBRARY_PATH:$PATH"
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/opt/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/Users/johnsmith/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/Users/johnsmith/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/johnsmith/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/Users/johnsmith/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<

Anaconda to Miniconda and $PATH

I am completely new to python and bash. I uninstalled Anaconda using conda clean and deleted the .anaconda_backup in my home directory. I opened the .bash_profile and did see
export PATH="/Users/XXXXX/anaconda3/bin:$PATH" and few other instances of $PATH appended.
My .bash_profile
# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/XXXXXXXXXX/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/XXXXXXXXXX/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/Users/XXXXXXXXXX/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/XXXXXXXXXX/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
##
# Your previous /Users/XXXXXXXXXX/.bash_profile file was backed up as /Users/XXXXXXXXXX/.bash_profile.macports-saved_2019-01-19_at_19:04:16
##
# MacPorts Installer addition on 2019-01-19_at_19:04:16: adding an appropriate PATH variable for use with MacPorts.
export PATH="/opt/local/bin:/opt/local/sbin:$PATH"
# Finished adapting your PATH environment variable for use with MacPorts.
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/XXXXXXXXXX/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/XXXXXXXXXX/opt/anaconda3/etc/profile.d/conda.sh" ]; then
# . "/Users/XXXXXXXXXX/opt/anaconda3/etc/profile.d/conda.sh" # commented out by conda initialize
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/XXXXXXXXXX/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# >>> conda initialize >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$('/opt/anaconda3/bin/conda' 'shell.bash' 'hook' 2> /dev/null)"
if [ $? -eq 0 ]; then
eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda3/etc/profile.d/conda.sh"
else
export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda initialize <<<
However, I didn't actually understood the part related to removing the Anaconda path from .bash_profile given in the manual. I ran echo $PATH again after uninstalling Anaconda and it looks exactly like before when i had Anaconda.
/opt/anaconda3/bin:/Users/XXXXX/opt/anaconda3/bin:/opt/local/bin:/opt/local/sbin:/Users/XXXXX/anaconda3/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin
I plan to install miniconda and create an environment for learning data science. I am trying to force myself to get more and more acquainted to terminal
Is it still safe to go ahead and install the Miniconda? How do I remove Anaconda path from .bash_profile? Will I be still able to open python by just typing the python command? or I would need to add a different path to access python after installing python through miniconda?

What are the bash commands to setup or recognize a MySQL installation on a Mac?

first post on so; let me know any advice on better asking
Anyways, my current bash profile is:
# added by Anaconda3 2019.10 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/opt/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/opt/anaconda3/etc/profile.d/conda.sh" ]; then
. "/opt/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/opt/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
‘export PATH=/usr/local/mysql/bin:$PATH'
I was getting this info from the tutorial, https://www.youtube.com/watch?v=HXV3zeQKqGY , ~1 hour 7 mins in.
I don't have a conda env activated right now. Anyone have an idea why when I type "mysql" into my bash terminal I am returned "command not found"?
There may be a problem with you $PATH.
Open .bash_profile. and then Place export PATH=${PATH}:/usr/local/mysql/bin in it.

zsh: command not found: react-native - MacOS

I am trying to start react-native but I get the following error zsh: command not found: react-native when I write react-native init firstApp
.
I tried the following guide: react-native: command not found
But I have two main issue:
First
I do not understand which path to use/export
React-native has been installed here:
/Users/cisco/.npm-packages/bin/react-native -> /Users/cisco/.npm-packages/lib/node_modules/react-native/local-cli/wrong-react-native.js
Second
In the guide it is written to run:
export PATH="/usr/local/Cellar/node/6.1.0/libexec/npm/bin:$PATH"
react-native init appName
cd appName
react-native run-ios
I do not get how to:
1) What to write after export PATH=
2) Should I add my path somewhere? If yes, how can I do so?
I tried running touch ~/.bash_profile; open ~/.bash_profile to add my path.
Inside it I have:
# added by Anaconda3 5.3.1 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/anaconda3/etc/profile.d/conda.sh" ]; then
. "/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
# added by Anaconda3 2018.12 installer
# >>> conda init >>>
# !! Contents within this block are managed by 'conda init' !!
__conda_setup="$(CONDA_REPORT_ERRORS=false '/Users/cisco/anaconda3/bin/conda' shell.bash hook 2> /dev/null)"
if [ $? -eq 0 ]; then
\eval "$__conda_setup"
else
if [ -f "/Users/cisco/anaconda3/etc/profile.d/conda.sh" ]; then
. "/Users/cisco/anaconda3/etc/profile.d/conda.sh"
CONDA_CHANGEPS1=false conda activate base
else
\export PATH="/Users/cisco/anaconda3/bin:$PATH"
fi
fi
unset __conda_setup
# <<< conda init <<<
Once you help me in finidng out the right path do add, can I simply add it in the file below the line # <<< conda init <<<?
Solved it!
Steps:
Run npm list -g | head -n 1
It will give you a path like/similar to the following: /Users/{YOUR_USER_NAME}/.npm-packages/lib
Change that path by substituting /lib with /bin:$PATH so that you get: /Users/cisco/.npm-packages/bin:$PATH
Run export PATH="/Users/{YOUR_USER_NAME}/.npm-packages/bin:$PATH"
Since you are using zsh. You can add export PATH=/Users/cisco/.npm-packages/bin/react-native:$PATH in ~/.zshrc
This operation work for me very well. Just follow the instruction below.
The default interactive shell is now zsh.
To update your account to use zsh, please run
chsh -s /bin/zsh

Resources