pythonの最初の環境構築メモ
conda init zsh sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" # conda create (GUIで操作しても良い) conda create --name [環境名] python=3.7 --prefix=[prefix] -y conda activate [環境名] jupyter kernelspec list ipython kernel install --user --name=[環境名] --display-name=[環境名] setting.json(remote) { "remote.autoForwardPortsSource": "output" } setting.json(workspace) { "remote.autoForwardPortsSource": "output", "python.pythonPath": "/root/anaconda3/bin/python(pyenv path)" } # kedro new kedro new cd [project名] git init … git push -u origin main conda env update --file environment.yml pip list --format freeze
name: [環境名] channels: - conda-forge - anaconda - default dependencies: - kedro - pre-commit - pytest - pytest-cov - tox - black - yapf - pylint - mypy - pip
絶対パスに変更(zsh)
- reorder-python-imports **/*.py
- absolufy-imports src/**/*.py --application-directories src/