Open2

Anacondaでの環境構築メモ

antyuntyunantyuntyun

Anaconda好きではないが、業務上触らなければいけない場面が多々あるのでメモ

antyuntyunantyuntyun

conda仮想環境構築と各種パッケージ導入

bottleneckがpip経由だとエラーになるので、こちらのみcondaで

conda create -n yasumura python=3.8 bottleneck
conda activate yasumura
pip install pycaret[full] psycopg2 plotly jupyter jupyterthemes jupyter-contrib-nbextensions

jupyter設定

condaのインストールパスのパーミッションだったり、condaのjupyterと競合してどうしようもない時は頑張っても大体報われないので潔くあきらめたほうが良い

python -m ipykernel install --user --name yasumura --display-name "yasumura-ipykernel"
jt -t monokai -f ubuntu -fs 120 -tfs 120 -ofs 120 -T -N -cellw 80%
jupyter contrib nbextension install --user
jupyter nbextensions_configurator enable --user
jupyter nbextension enable code_prettify/autopep8 
jupyter nbextension enable hinterland/hinterland
jupyter nbextension enable spellchecker/main
jupyter nbextension enable snippets_menu/main
jupyter nbextension enable toggle_all_line_numbers/main
jupyter nbextension enable execute_time/ExecuteTime
jupyter nbextension enable toc2/main
jupyter nbextension enable varInspector/main
jupyter nbextension enable code_font_size/code_font_size
jupyter nbextension enable highlighter/highlighter
jupyter nbextension enable table_beautifier/main

vscode設定

vscodeのsettings.jsonでターミナルをCondaPowerShellにする

    "terminal.integrated.shell.windows": "C:\\Windows\\System32\\WindowsPowerShell\\v1.0\\powershell.exe",
    "terminal.integrated.shellArgs.windows": [
        "-ExecutionPolicy",
        "ByPass",
        "-NoExit",
        "-Command",
        "C:\\ProgramData\\Anaconda3\\shell\\condabin\\conda-hook.ps1",
        "; conda activate yasumura",
    ],