0%

python conda 环境安装配置

conda安装配置

官网下载合适版本
‘’’
https://repo.anaconda.com/archive/
‘’’
配置环境变量后,conda init
每次打开终端不默认激活conda: conda config --set auto_activate_base False
conda list 查看base环境中的所有包
pip升级最新版本:
python -m pip install –upgrade pip
换源:
pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple

conda相关命令

创建新环境命名python311

1
conda create -n python311 python=3.11

配置jupyter notebook 远程访问

生成配置文件:

1
jupyter notebook --generate-config 

一般保存在~/.jupyter/jupyter_notebook_config.py
可用 jupyter notebook password 设置密码
设置notebook自动补全

1
2
3
4
5
6
pip3 install jupyter-tabnine
conda install -c conda-forge jupyter_contrib_nbextensions
jupyter contrib nbextension install --user
jupyter nbextension install --py jupyter_tabnine
jupyter nbextension enable jupyter_tabnine --py
jupyter serverextension enable --py jupyter_tabnine

运行图片相关代码报错:tesseract not found

1
apt install tesseract-ocr