Yum Install - Bahmni - Distribution Not Found: Click

Good day -

Have been following the documentation. Trying to install Bahmni 0.89. Fresh install of CentOS 6.8. After i do the yum install… and then try and confirm the Bahmni command… i continuously receive the following…

############### File “/usr/bin/bahmni”, line 5, in from pkg_resources import load_entry_point File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 2655, in working_set.require(requires) File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 648, in require needed = self.resolve(parse_requirements(requirements)) File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 546, in resolve raise DistributionNotFound(req) pkg_resources.DistributionNotFound: Click ###############

I have tried doing the ‘pip install click’, does not correct the error.

I’ve looked in each of the directories / files within the error message and cannot address the issue.

Thanks

@cyberlive, thanks for reporting this error. That is something that others have been reporting too.

A JIRA ticket has been created:

We are actively looking at it but there currently is no easy way to get around. We will keep you posted as soon as we find a solution.

Good morning –

I lined up a series of vms and worked away at the 0.89 install on fresh installs of CentOS 6.8.

For this particular error, this seems to address it;

(1) yum -y update

(2) yum install epel-release

(3) yum -y install python-pip

(4) pip install --upgrade setuptools

(5) yum install https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.89-193.noarch.rpm

1 Like

That works, thanks!

We are looking at updating the RPM in order to install setuptools using pip rather than yum. Yum seems to be provide a too old version.

I tried same steps but still getting the same error, help pls!

It worked for me after running this command

pip install --user setuptools

The error seems to still happen when using Bahmni with Docker. (see error log http://paste.ubuntu.com/26112686/)

sudo ./docker.sh
Traceback (most recent call last):
  File "/usr/bin/bahmni", line 11, in <module>
    load_entry_point('bahmni==0.1', 'console_scripts', 'bahmni')()
  File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 1066, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python2.6/site-packages/click-6.7-py2.6.egg/click/decorators.py", line 17, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "build/bdist.linux-x86_64/egg/bahmni.py", line 91, in install
  File "/usr/lib64/python2.6/subprocess.py", line 505, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'ansible-playbook -i /etc/bahmni-installer/local all.yml -vv  --extra-vars '@/etc/bahmni-installer/rpm_versions.yml' --extra-vars '@/etc/bahmni-installer/setup.yml'' returned non-zero exit status 4
The command '/bin/sh -c bahmni -i local install' returned a non-zero code: 1
f9ebe14460d04016db06c07fd4347b6f32c38fd27687213115e22de4ea10db5a

@angshuonline, do you confirm?

Had the same problem when installing bahmni 0.89 and 0.90

To solve the issue i did the following :

(1) yum -y update

(2) yum install epel-release

(3) yum -y install python-pip

(4) pip install --upgrade setuptools

(5) pip install click

(6) yum install https://dl.bintray.com/bahmni/rpm/rpms/bahmni-installer-0.89-193.noarch.rpm

(7) check if everything is OK in the ‘/etc/bahmni-installer/setup.yml’ according to your environment

(8) bahmni -i local install

I hope it will help somebody!!!

bahmni -i local install

bash :bahmni command not found

Hi Romain,

I am also having the similar issue running bahmni on docker. Could you please share how you have solved the issue? Thanks in advance.

Traceback (most recent call last): File “/usr/bin/bahmni”, line 9, in load_entry_point(‘bahmni==0.1’, ‘console_scripts’, ‘bahmni’)() File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 299, in load_entry_point return get_distribution(dist).load_entry_point(group, name) File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 2229, in load_entry_point return ep.load() File “/usr/lib/python2.6/site-packages/pkg_resources.py”, line 1948, in load entry = import(self.module_name, globals(),globals(), [‘name’]) File “/usr/lib/python2.6/site-packages/bahmni-0.1-py2.6.egg/bahmni.py”, line 1, in import click File “/usr/lib/python2.6/site-packages/click-7.1.2-py2.6.egg/click/init.py”, line 7, in from .core import Argument File “/usr/lib/python2.6/site-packages/click-7.1.2-py2.6.egg/click/core.py”, line 21, in from .formatting import HelpFormatter File “/usr/lib/python2.6/site-packages/click-7.1.2-py2.6.egg/click/formatting.py”, line 4, in from .parser import split_opt File “/usr/lib/python2.6/site-packages/click-7.1.2-py2.6.egg/click/parser.py”, line 228 self._opt_prefixes = {"-", “–”} ^ SyntaxError: invalid syntax

The issue is resolved in our implementation. It was related to the version of click. I am using the bahmni-installer-0.91-70. I have downgraded the click version from 7.1.2 to 7.0 and its working now.

The latest version of both setuptools(55.1.1) and click(8.1.1) no longer support python 2.7, so when you follow the instructions above pip throws a syntax error. In order to solve this issue, you need to install setuptools 44.1.1 and click 7.1.2, which are the latest versions of the modules that support python 2.7. In order to get this working on a vanilla Centos 7.6 installation, you can use these commands:

  1. yum -y update
  2. yum install epel-release
  3. yum -u install python-pip
  4. pip install setuptools==44.1.1
  5. pip install click==7.1.2
  6. yum install http://repo.mybahmni.org/releases/bahmni-installer-0.92-155.noarch.rpm
  7. bahmni --help // To verify
1 Like