Expert Contributor
Posts: 192
Registered: ‎07-01-2015

pip install cm_api fails


 installing the cm_api python package fails:

sudo pip install cm_api
Collecting cm_api
  Using cached
    Complete output from command python egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-5w10Wz/cm-api/", line 31, in <module>
        fobj = open(setup)
    IOError: [Errno 2] No such file or directory: '/tmp/pip-install-5w10Wz/cm-api/python/'
Expert Contributor
Posts: 192
Registered: ‎07-01-2015

Re: pip install cm_api fails

Find out, that the problem is in the latest version (20) of the package. Compared the content of those two packages, the is in both:



[centos@ip-10-0-1-51 ~]$ find cm_api-20.0.0 | grep setup
[centos@ip-10-0-1-51 ~]$ find cm_api-19.0.0 | grep setup

But the new version of tries to execute non-existing python/




# that "" is at the root.

  import os.path
  import imp

  base_dir = os.path.split(os.path.abspath(__file__))[0]

  setup = os.path.join(base_dir, "python", "")
  fobj = open(setup)
  suffixes = [x for x in imp.get_suffixes() if x[0] == ".py"]

  imp.load_module("__setup2__", fobj, setup, suffixes[0])

Workaround solution for me is:

sudo pip install "cm_api<20"