Pycharm
Anaconda
Conda
创建Conda虚拟环境
- 指定python版本和环境名称
- conda create -n env_name python=3.8
- 指定python版本, 环境名称, 环境安装路径
- conda create –prefix=C:/ProgramData/Anaconda3/envs/ENV_spider python=3.9
- 激活所安装的环境
- 在当前激活的环境里安装包
- conda install package_name
- 退出当前激活的环境
PIP
Jupyter
安装内核
- 激活/切换到要添加的虚拟环境, 确认是否安装 ipykernel
- python -m ipykernel –version
- 如果没有,则安装
- python -m pip install ipykernel
- 为 jupyter 添加内核
- python -m ipykernel install –name env_name
查看已安装内核
(ENV_machinelearning) λ jupyter kernelspec list
Available kernels:
%s %s python3 C:\ProgramData\Anaconda3\envs\ENV_machinelearning\share\jupyter\kernels\python3
%s %s pycharm-78712231 C:\Users\Jin\AppData\Roaming\jupyter\kernels\pycharm-78712231
%s %s pycharm-ae39b4c1 C:\Users\Jin\AppData\Roaming\jupyter\kernels\pycharm-ae39b4c1
%s %s env_machinelearning C:\ProgramData\jupyter\kernels\env_machinelearning
删除 jupyter 内核
- jupyter kernelspec remove kernelname