1

I tried to set up a virtualenv and I have setuptools (39.0.1). And I got

In [1]: import pkg_resources.py31compat
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
<ipython-input-1-136e80f945a9> in <module>()
----> 1 import pkg_resources.py31compat

ImportError: No module named py31compat

I read elsewhere that installing the latest setuptools should fix this. But apparently, it didn't work.

Please help.

(additional info in comments)

kawingkelvin
  • 3,649
  • 2
  • 30
  • 50
  • Possible duplicate of [ImportError: No module named py31compat](https://stackoverflow.com/questions/46998858/importerror-no-module-named-py31compat) – phd Mar 31 '18 at 21:58
  • I tried upgrading setuptools but the problem still persists. I think something is wrong from "virtualenv --system-site-packages", I am able to locate py31compat.py under the virtualenv directory: ./lib/python2.7/site-packages/pkg_resources/py31compat.py, ./lib/python2.7/site-packages/setuptools/py31compat.py, but importing it like above will fail. – kawingkelvin Apr 01 '18 at 22:18

0 Answers0