ARTICLE DETAIL

建站实战干货

来自一线的建站与推广经验沉淀,每一条都经过真实交付验证。

有关python环境管理库Anaconda操作

2026/9/12 4:09:47 拓冰建站 浏览量
有关python环境管理库Anaconda操作 指定第三方库资源安装地址在windows中搜索 Anaconda Powershell Prompt 打开:当前是: CUDA Version: 12.2安装torch下载11.8的torchconda install pytorch torchvision torchaudio pytorch-cuda11.8 -c pytorch -c nvidia修改包和环境的地址这个是为了把下载地址从默认c盘改到其他盘conda config --show 查看conda配置信息conda config --add envs_dirs D:\swordTool\yoloTool\anaconda3\envsconda config --add pkgs_dirs D:\swordTool\yoloTool\anaconda3\pkgs# 删除某个虚拟环境路径conda config --remove envs_dirs 无效路径# 删除某个包缓存路径conda config --remove pkgs_dirs 无效路径例: conda config --remove pkgs_dirs E:\tool\anaconda3\pkgs--给文件添加权限 anaconda3\envs 和anaconda3\pkgs文件夹右键在安全中选择用户添加所有权限--创建python环境conda create --name kikiPython39 python3.9--查看python环境conda info --envs--查看python版本python --version--切换到环境conda activate python3115conda deactivate --退出当前环境--删除环境conda remove --name python27 --all--安装yolo依赖 在cmd端cd进python目录和环境安装txt文件依赖。conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/conda config --add channels https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/conda config --set show_channel_urls yes加速安装环境pip install -i https://pypi.tuna.tsinghua.edu.cn/simple xlwings-- 打包资源参考网址:https://cloud.tencent.com/developer/article/1779093心得:使用Anaconda创建新的纯净库减少冗余库节省打包时间Pyinstaller -F -w -i fox.ico py_word.py 打包指定exe图标打包--运行yolo切换好环境直接运行 labelimg重新激活虚拟环境运行手动安装指令指令格式为pip install 下载文件的完整路径 -i https://pypi.tuna.tsinghua.edu.cn/simple例如pip install F:\AI\torch-2.0.1cu118-cp38-cp38-win_amd64.whl -i https://pypi.tuna.tsinghua.edu.cn/simplepip install D:\swordTool\ai\aiEnvTool\torch-2.0.1cu118-cp310-cp310-win_amd64.whl -i https://pypi.tuna.tsinghua.edu.cn/simplepip install pdf2docx -i https://pypi.tuna.tsinghua.edu.cn/simplepip install pillow -i https://pypi.tuna.tsinghua.edu.cn/simplepip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simplepip install fitz -i https://pypi.tuna.tsinghua.edu.cn/simplepip install PyMuPDF -i https://pypi.tuna.tsinghua.edu.cn/simplepip install pytesseract -i https://pypi.tuna.tsinghua.edu.cn/simplepip install python-docx -i https://pypi.tuna.tsinghua.edu.cn/simplepip install pillowpip install opencv-pythonpip install fitzpip install PyMuPDFpip install pytesseractpip install python-docx