ImportError: No module named py31compat

后端 未结 4 1803
深忆病人
深忆病人 2021-01-24 04:03

i am trying to install gensim using

sudo -H pip install --upgrade gensim

but it is giving me this error :

  File \"setup.py\",         


        
相关标签:
4条回答
  • 2021-01-24 04:20

    It looks like setuptoopls is missing. Try

    $sudo pip install setuptools
    
    0 讨论(0)
  • 2021-01-24 04:28

    Notice that setuptools come from /usr/local/lib whereas pkg_resources come from /usr/lib. You must likely have an older pkg_resources through the package system and then a newer setuptools installed by pip.

    Delete (or move away) the /usr/local/lib/python2.7/dist-packages/setuptools directory.

    0 讨论(0)
  • 2021-01-24 04:32

    In my case i have odoo v10 installed and for any weird reason update or installed a library that stuck my server and not longer to start with XOE.

    The error was:

    cannot import name py31compat

    After 1 hour trying many differents things i decide uninstall:

    sudo pip uninstall setuptools
    
    Uninstalling setuptools-40.8.0:   Would remove:
    /usr/local/bin/easy_install
    /usr/local/bin/easy_install-2.7
    /usr/local/lib/python2.7/dist-packages/easy_install.py
    /usr/local/lib/python2.7/dist-packages/pkg_resources/*
    /usr/local/lib/python2.7/dist-packages/setuptools-40.8.0.dist-info/**
    

    And my service odoo server starts and works fine again!

    0 讨论(0)
  • 2021-01-24 04:35

    I encountered a very similar error upon an Ansible run of a refactored OpenShift playbook. The error was discovered once all of the plays were parsed.

    "ERROR! Unexpected Exception, this is probably a bug: cannot import name py31compat"

    I am using ...

    • Ansible 2.5.3
    • Python2-2.7.15

    I ran the following command to list the location of all of the packages and libraries associated with Python 2. I checked available paths to ensure I had one version of Ansible and one copy of each package installed.

    $ python -c 'import sys; print sys.path'

    'py31compat' is not a separate module one can download. It is included with the Setuptools package. It was determined I had two packages installed of different versions, both out-of-date. I uninstalled both via pip and installed the latest setuptools version available. No luck.

    My solution was to uninstall Ansible and reinstall the same version. This resolved the issue.

    0 讨论(0)
提交回复
热议问题