pip install stanza报错Failed to build tokenizers

1.在安装text_mining_tools时候需要安装stanza模块时出现的问题

1.开始使用了python3.5,发现无法调用stanza,查阅得知,stanza不支持3.6以下版本(stanza无download模块)

2.使用python3.6进行安装

pip install stanza -i https://pypi.tuna.tsinghua.edu.cn/simple/

使用报错信息为:

  running build_rust
  error: can't find Rust compiler

  If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.

  To update pip, run:

      pip install --upgrade pip

  and then retry package installation.

  If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
  ----------------------------------------
  ERROR: Failed building wheel for tokenizers
Failed to build tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects

通过上面报错信息:给出了两条解决方案,
1.为安装rust
2.为更新pip
通过

easy_install pip

更新,发现pip版本已经最新,无法更新
则去重新安装rust,后发现cmd无法调用rust,不知道是配置原因还是啥

最后是更新了python版本更新为3.7解决了这个问题。

import stanza
stanza.download('en')

2.期间出现过的问题

Script file 'G:\Anaconda\envs\py36\Scripts\pip-script.py' is not present.

报错,我是用过curl

curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py

再更新pip解决的,其中-o xxx.py,为保存源文件

2.当python文件版本不对,可以直接使用anaconda构建虚拟环境

conda create -n xxx python=3.7
conda info --envs
activate xxx
##如果想升级anaconda原环境版本
conda install python=3.8

3.当安装pip时,出现多个版本pip
报错:

WARNING: Ignoring invalid distribution -ip(地址)

解决方案:删除地址中~开头的文件

https://blog.csdn.net/weixin_43848614/article/details/118426100

国内源:

清华:https://pypi.tuna.tsinghua.edu.cn/simple/
豆瓣:https://pypi.douban.com/simple
阿里:https://mirrors.aliyun.com/pypi/simple

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值