Skip to content

'Version' object has no attribute 'major' #509

Closed

Description

@FieeFlip

执行ltp.seg(["他叫汤姆去拿外衣。"])语句时:
if transformers_version.major >= 3 and transformers_version.major > 1:
247 kwargs = {'is_split_into_words': is_preseged}
248 else:

AttributeError: 'Version' object has no attribute 'major'

Activity

  1. zejunwang1 commented on May 4, 2021

    @zejunwang1

    +1

  2. AlongWY commented on May 7, 2021

    @AlongWY
    Contributor

    pip install -U pip 试一下? 

  3. zejunwang1 commented on May 9, 2021

    @zejunwang1

    还是报错,你这个pip install ltp一键安装后能跑通吗。。

  4. gongfeng98 commented on May 12, 2021

    @gongfeng98

    packaging这个包的问题,升级到20.0以上就行了 pip install packaging==20.0

  5. added a commit that references this issue on May 17, 2021
  6. Duncanswilson commented on Aug 30, 2021

    @Duncanswilson

    just to save someone else from having to google translate the above:

    For packaging problems, just upgrade to 20.0 or higher. pip install packaging==20.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions