Reply
Master
Posts: 326
Registered: ‎07-01-2015

pip install cm_api fails

Hi,

 installing the cm_api python package fails:

sudo pip install cm_api
Collecting cm_api
  Using cached https://files.pythonhosted.org/packages/ae/e3/c79c1c36309af73c77cd61157baa547a1d24edb5ca761a40909480785cd9/cm_api-20.0.0.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-install-5w10Wz/cm-api/setup.py", line 31, in <module>
        fobj = open(setup)
    IOError: [Errno 2] No such file or directory: '/tmp/pip-install-5w10Wz/cm-api/python/setup.py'
Master
Posts: 326
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 setup.py is in both:

 

 

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

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

 

 

 

# that "setup.py" 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", "setup.py")
  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"

Announcements