Skip to content

Instantly share code, notes, and snippets.

@peace098beat
Last active October 2, 2021 06:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save peace098beat/cdc664bbf06e8a25b4622c88fcb13ae4 to your computer and use it in GitHub Desktop.
Save peace098beat/cdc664bbf06e8a25b4622c88fcb13ae4 to your computer and use it in GitHub Desktop.
[env setup] snippets #python #setup #pipenv #env

Install

$ brew install peco
$ fisher install oh-my-fish/plugin-peco

~/.config/fish/config.fish

#peco setting
set fish_plugins theme peco

function fish_user_key_bindings
  bind \cw peco_select_history
end
# M1
# pyenv
# (* brewはuser homeにインストールしてください)
brew install pyenv
# pipenv
pip3 install --user pipenv
pipenv --python 3
# jupyter
pipenv install jupyter
# Pandas
pipenv shell
pip install numpy cython
git clone -b 1.3.x git@github.com:pandas-dev/pandas.git
# git clone https://github.com/pandas-dev/pandas.git
cd pandas
python3 setup.py install
# そのたパッケージ
pip install sklearn seaborn
pip install matplotlib japanize-matplotlib
pip install tqdm

macのマルチユーザがめんどくさすぎる

zenn https://zenn.dev/fifi098/scraps/55f4976230a04d

Homebrew

ユーザ環境($HOME配下)にHomebrewをインストール

# 実行ファイルの解答
cd ~
mkdir homebrew && curl -L https://github.com/Homebrew/brew/tarball/master | tar xz --strip 1 -C homebrew

# PATH追加
PATH="$HOME/homebrew/bin:$PATH"
brew install tree bat fish starship tmux htop glances

terminal

fish

インストール

brew install fish
brew install starship

デフォルトシェルに設定

# change shecll
chsh -s $HOME/homebrew/bin/fish

# /etc/shellsに登録
echo $HOME/homebrew/bin/fish | sudo tee -a /etc/shells

~/.config/fish/config.fish


# Path
# Install to user
set PATH $PATH $HOME/homebrew/bin

# Prompt
# > brew install starship
starship init fish | source

# pyenv
# > brew install pyenv
set -Ux PYENV_ROOT $HOME/.pyenv
set -U fish_user_paths $PYENV_ROOT/bin $fish_user_paths
status is-interactive; and pyenv init --path | source

# pipenv
# > pip install --user pipenv
set -Ux PIPENV_VENV_IN_PROJECT 1
set PATH $PATH $HOME/.local/bin

# Alias
alias c="clear"

.zshrc

PATH="$HOME/homebrew/bin:$PATH"

export PIPENV_VENV_IN_PROJECT=true
# [Pipenvの進んだ使い方 — pipenv 2018.11.27.dev0 ドキュメント](https://pipenv-ja.readthedocs.io/ja/translate-ja/advanced.html#custom-virtual-environment-location)
# プロジェクトの直下に仮想環境を作る
export PIPENV_VENV_IN_PROJECT=1
echo 'export PIPENV_VENV_IN_PROJECT=true' >> ~/.zshrc
# setup
pyenv install 3.x.x
pyenv global 3.x.x
pip install pipenv --user # --userでいれること!
pipenv install python 3.8
# シェルの補完
eval (pipenv --completion)
# プラットフォームが提供するPythonコンポーネントを使っての作業
pipenv --three --site-packages
PIP_IGNORE_INSTALLED=1 pipenv install --dev
# pipenv-sublime plugin
[Zheaoli/pipenv-sublime: A Sublime Text 3 plugin for Pipenv projects!](https://github.com/Zheaoli/pipenv-sublime)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment