zoukankan      html  css  js  c++  java
  • 搭建NLP相关的python环境

    ## conda环境:
    https://www.cnblogs.com/wxiaoli/p/8830989.html

    ## 镜像安装lib:python -m pip install -i https://pypi.tuna.tsinghua.edu.cn/simple [libname]

    必备lib:

    numpy  scipy  matplotlib  sklearn  pandas  spacy  gensim

    按需lib:

    tensorflow(2.1.0)  transformers

    ## 配置jupyter:
    https://www.cnblogs.com/wxiaoli/p/10648251.html


    安装过程中可能遇到一些问题及排错:(注:以下问题发生环境:ubuntu+miniconda)

    1. 添加conda镜像通道: conda config --add channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' 
    删除conda镜像通道: conda config --remove channels 'https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/free/' 
    另,中科大镜像:https://mirrors.ustc.edu.cn/anaconda/pkgs/free/

    2. 激活conda环境后,用pip3 install 安装jieba,并且提示“Successfully installed jieba-0.42.1”后,报错:No module named 'jieba'
    原因:ubuntu系统中直接使用pip命令时会默认使用系统环境中的python工具(偏偏ubuntu系统中内置了python2和python3,因此在安装时没有报错)
    解决:在conda中的python环境中安装包时用 python -m pip install,或者使用conda install
    另,使用pip其他功能时也应带 python -m 前缀

    3. conda install 一直报错:miniconda Segmentation fault (core dumped)
    解决:用conda clean -a删除缓存,重新安装

    4. 在环境中安装jupyter内核时报错:
    >>  python -m ipykernel install --name tf
    [Errno 13] Permission denied: '/usr/local/share/jupyter'
    解决: python -m ipykernel install --user --name tf

  • 相关阅读:
    Python安装appium 遇见的报错
    appium
    QQ邮箱/微信邮箱发送邮件
    Python-变量
    神秘的咒语
    宿命的PSS
    E. Congruence Equation
    D. Substring
    leetcode 761. Special Binary String
    F
  • 原文地址:https://www.cnblogs.com/wxiaoli/p/13094327.html
Copyright © 2011-2022 走看看