Skip to content

windows环境安装

zhifu gao edited this page Dec 12, 2023 · 19 revisions

conda环境安装

  1. anaconda历史版本下载地址,选择相应的版本安装:https://repo.anaconda.com/archive/

  2. 安装anaconda时注意勾选环境变量:

  1. 安装完成后,点击anaconda prompt命令窗口:
  • 运行命令: conda config --set show_channel_urls yes

  • 打开user下文件 .condarc,把里面的内容替换为清华源:

channels:
- [http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/](http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch/)
- [http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/](http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/menpo/)
- [http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/](http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/bioconda/)
- [http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/](http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/msys2/)
- [http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/](http://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/conda-forge/)
- [http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/](http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/)
- [http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/](http://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/)
show_channel_urls: true
  1. 生成虚拟环境:
conda create -n funasr python=3.7
conda activate funasr

pytorch安装(version >= 1.7.0)

conda install pytorch torchvision torchaudio cpuonly -c pytorch
  • GPU(请确认本地cuda版本):
conda install pytorch torchvision torchaudio pytorch-cuda=11.6 -c pytorch -c nvidia

git安装

modelscope安装

pip install -U modelscope

funasr安装:

git clone [https://github.com/alibaba/FunASR.git](https://github.com/alibaba/FunASR.git) && cd FunASR
pip install --editable ./
  • 可能的报错及解决方案:

ctc-segmentation (因为没有编译环境,所以编译失败)

Building wheel for ctc-segmentation (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for ctc-segmentation (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [12 lines of output]
running bdist_wheel
running build
running build_py 
creating build
creating build\lib.win-amd64-cpython-37
creating build\lib.win-amd64-cpython-37\ctc_segmentation
copying ctc_segmentation\ctc_segmentation.py -> build\lib.win-amd64-cpython-37\ctc_segmentation
copying ctc_segmentation\partitioning.py -> build\lib.win-amd64-cpython-37\ctc_segmentation
copying ctc_segmentation\__init__.py -> build\lib.win-amd64-cpython-37\ctc_segmentation
running build_ext
building 'ctc_segmentation.ctc_segmentation_dyn' extension
error: Microsoft Visual C++ 14.0 or greater is required. Get it with "Microsoft C++ Build Tools": [https://visualstudio.microsoft.com/visual-cpp-build-tools/](https://visualstudio.microsoft.com/visual-cpp-build-tools/)
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for ctc-segmentation

安装Microsoft Build Tools for Visual Studio,在 Build Tools 中,安装“使用C++的桌面开发”并确保安装详细信息的两项勾选:MSVC生成工具、windows SDK

Clone this wiki locally