2

I just deiscover CKAn and I am trying to install it on a Ubuntu 14.04. I install it from source.

AT a step we have to install the Python module that CKAn requires.

pip install -r /usr/lib/ckan/default/src/ckan/requirements.txt

I first got an error

Command python setup.py egg_info failed with error code 1 in /usr/lib/ckan/default/build/html5lib

I solved it by upgrading setuptools

pip install --upgrade setuptools

But now I got a new error with pbr and I do not know what to do

Command python setup.py egg_info failed with error code 1 in /usr/lib/ckan/default/build/pbr

Before ending the installation and displaying that error, I got that message:

Downloading/unpacking pbr==0.11.0 (from -r /usr/lib/ckan/default/src/ckan/requirements.txt (line 27)) Running setup.py egg_info for package pbr Traceback (most recent call last): File "", line 14, in File "/usr/lib/ckan/default/build/pbr/setup.py", line 22, in **util.cfg_to_args()) File "pbr/util.py", line 261, in cfg_to_args wrap_commands(kwargs) File "pbr/util.py", line 482, in wrap_commands for cmd, _ in dist.get_command_list(): File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/dist.py", line 528, in get_command_list cmdclass = ep.resolve() File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2255, in resolve module = import(self.module_name, fromlist=['name'], level=0) File "pbr/testr_command.py", line 47, in from testrepository import commands ImportError: No module named testrepository Complete output from command python setup.py egg_info: Traceback (most recent call last):

File "", line 14, in

File "/usr/lib/ckan/default/build/pbr/setup.py", line 22, in

**util.cfg_to_args())

File "pbr/util.py", line 261, in cfg_to_args

wrap_commands(kwargs)

File "pbr/util.py", line 482, in wrap_commands

for cmd, _ in dist.get_command_list():

File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/setuptools/dist.py", line 528, in get_command_list

cmdclass = ep.resolve()

File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/init.py", line 2255, in resolve

module = __import__(self.module_name, fromlist=['__name__'], level=0)

File "pbr/testr_command.py", line 47, in

from testrepository import commands

ImportError: No module named testrepository

Someone can help me to complete the installation? Many thank for your help

sorin
  • 161,544
  • 178
  • 535
  • 806
pierrot10
  • 129
  • 4
  • 13
  • Any reason why you install from source when package install is available for UBUNTU 14.04? – Mat K. Witts Aug 31 '16 at 19:47
  • In the doc, it writen this : "This is the quickest and easiest way to install CKAN, but it requires Ubuntu 14.04 64-bit or Ubuntu 12.04 64-bit. If you’re not using Ubuntu 14.04 64-bit or Ubuntu 12.04 64-bit, or if you’re installing CKAN for development, you should follow Installing CKAN from source instead." I am agree that I do not have 16.04, but as I will migrate to 16.04; I choose to not use the package – pierrot10 Sep 01 '16 at 07:11
  • So, not wanting to sound rude - would a useful solution be to install as package under 14.04 and resist the urge to go for 16.04 until such time the documentation and packages have been tested? What I am asking is 16.04 really worth it? – Mat K. Witts Sep 08 '16 at 12:28

4 Answers4

1

This worked for me:

  1. Uninstall the previous pbr version via pip uninstall pbr.

  2. Removed the version from the requirements file: /usr/lib/ckan/default/src/ckan/requirements.txt this line pbr==0.11.0 by this line pbr

  3. Install the requirements again pip install -r /usr/lib/ckan/default/src/ckan/requirements.txt

1

I came across something similar on OSX. The troublesome package was pbr, but the greater context was a failed installation of virtualenvwrapper with pip, that had strangely stopped being sourced from within my ~/.bash_profile

Error upon simply pip install --upgrade virtualenvwrapper

Collecting virtualenvwrapper
  Using cached virtualenvwrapper-4.7.2.tar.gz
    Complete output from command python setup.py egg_info:
    ERROR:root:Error parsing
    Traceback (most recent call last):
      File "/usr/local/lib/python2.7/site-packages/pbr/core.py", line 104, in pbr
        attrs = util.cfg_to_args(path)
      File "/usr/local/lib/python2.7/site-packages/pbr/util.py", line 256, in cfg_to_args
        wrap_commands(kwargs)
      File "/usr/local/lib/python2.7/site-packages/pbr/util.py", line 477, in wrap_commands
        for cmd, _ in dist.get_command_list():
      File "/usr/local/lib/python2.7/site-packages/setuptools/dist.py", line 447, in get_command_list
        cmdclass = ep.resolve()
      File "/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 2235, in resolve
        module = __import__(self.module_name, fromlist=['__name__'], level=0)
      File "/usr/local/lib/python2.7/site-packages/pbr/testr_command.py", line 47, in <module>
        from testrepository import commands
    ImportError: No module named testrepository
    error in setup command: Error parsing /private/var/folders/ct/qsr62p3s14l_dpy_1gkqbgj00000gn/T/pip-build-5qI5wq/virtualenvwrapper/setup.cfg: ImportError: No module named testrepository

    ----------------------------------------

I uninstalled pbr: pip uninstall pbr then immediately reinstalled it, thinking I would update to most current version this way and got a message indicating the requirement had already been satisfied Requirement already satisfied: pbr in /usr/local/Cellar/matplotlib/1.5.1/libexec/lib/python2.7/site-packages.

I didn't really need matplotlib outside the scope of a virtualenv anyway, so I uninstalled it: brew uninstall --force matplotlib (--force to uninstall all versions)

I was then able to pip install virtualenvwrapper successfully, with pip satisfying the dependency of pbr as expected.

I'm not sure if my previous install of virtualenvwrapper was piggybacking off this matplotlib pbr package, or if, upon my pip uninstall pbr and immediate pip install pbr, it fell to the matplotlib install, since it was the only one found? I guess it doesn't matter though, it fixed my problem.

woodstock
  • 29
  • 4
  • I believe this succeeded for you simply because `pip install pbr` will give you the latest version, rather than the troublesome one ckan 2.5.x specifies in its requirements.txt. – D Read Oct 06 '17 at 17:16
1

To fix this problem, first install this little dependency, which will get pbr's setup working:

pip install testrepository

Now when you install ckan's requirements it will be successful:

pip install -r requirements.txt

Explanation:

There is a bug with pbr 0.11.0, which is seen when you pip install sqlalchemy-migrate (for some reason). This is an issue only affecting CKAN 2.5.x, I believe.

An alternative solution is to use pbr version 0.11.1 instead. However this is not as neat, since it means changing your requirements.txt, which is a checked-in file.

D Read
  • 3,175
  • 1
  • 15
  • 25
0

I ran into this same error trying to install something else with pip (httplib2.ca_certs_locater-0.2.0 IIRC).

My issue turned out to be caused by a really old version of pbr, which happened to be the same as the one that's blowing up for you - 0.11.0. In my case, I had what I can only assume was garbage left over from an old installation of something: /usr/local/lib/python2.7/dist-packages/pbr-0.11.0-py2.7.egg.

In my case, since it was my application's requirements.txt file that was blowing up, I just added pbr==1.10.0 as a dependency and that fixed the problem. Running pip install pbr would also work.

Also, I'm always in the habit of keeping pip itself up to date, so that might be worth trying too, though it wasn't able to prevent the error for me this time.

killthrush
  • 4,859
  • 3
  • 35
  • 38