i am trying to install gensim using
sudo -H pip install --upgrade gensim
but it is giving me this error :
File \"setup.py\",
It looks like setuptoopls is missing. Try
$sudo pip install setuptools
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.
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!
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 ...
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.