[Neuroimaging] nibabel / pkg_resources /setuptools question

Karl Helmer helmer at nmr.mgh.harvard.edu
Fri Jul 29 14:50:27 EDT 2016


Thanks Satra for the link, I'll reinstall using that to make sure.
regards,
Karl


> hi karl,
>
> if you are using conda through miniconda/anaconda, you may consider adding
> conda-forge channels.
>
> conda config --add channels conda-forge
>
> conda install nibabel # or nipype or dipy
>
> or any one of these packages:
> https://conda-forge.github.io/feedstocks.html
>
> it is a community supported package repository for conda.
>
> i agree with matthew that it would be good not to mix apt-get and
> anaconda.
>
> cheers,
>
> satra
>
> On Fri, Jul 29, 2016 at 12:37 PM, Matthew Brett <matthew.brett at gmail.com>
> wrote:
>
>> Hi,
>>
>> On Fri, Jul 29, 2016 at 5:24 PM, Karl Helmer
>> <helmer at nmr.mgh.harvard.edu>
>> wrote:
>> > Hi Everyone,
>> >
>> >    I've just started to get the error message below when I "import
>> > nibabel" in a piece of code. I've just updated my anaconda, but was
>> > getting the error before then, and also used apt-get to get the latest
>> > python-nipype (that apt-get has anyway). I'm using Lubuntu:
>> > DISTRIB_DESCRIPTION="Ubuntu 14.04.4 LTS"
>> > and this is what it installed:
>> > "Preparing to unpack .../python-nibabel_2.0.2-1~nd14.04+1_all.deb ...
>> > Unpacking python-nibabel (2.0.2-1~nd14.04+1) ..."
>> > ...
>> > Setting up python-nibabel (2.0.2-1~nd14.04+1) ...
>> >
>> > It looks like it's not nibabel it's unhappy with, it's the setuptools
>> > version or maybe the interaction between the two?  Has anyone seen
>> this
>> > and have a fix?
>> >
>> > thanks,
>> > Karl
>> > ---------------------------------------------------------
>> >
>> > Traceback (most recent call last):
>> >   File "edited_histograms.py", line 24, in <module>
>> >     import nibabel as nib
>> >   File
>> > "/home/karl/anaconda/lib/python2.7/site-packages/nibabel/__init__.py",
>> > line 45, in <module>
>> >     from .loadsave import load, save
>> >   File
>> > "/home/karl/anaconda/lib/python2.7/site-packages/nibabel/loadsave.py",
>> > line 21, in <module>
>> >     from .minc2 import Minc2Image
>> >   File
>> "/home/karl/anaconda/lib/python2.7/site-packages/nibabel/minc2.py",
>> > line 30, in <module>
>> >     from .optpkg import optional_package
>> >   File
>> > "/home/karl/anaconda/lib/python2.7/site-packages/nibabel/optpkg.py",
>> > line 4, in <module>
>> >     import nose
>> >   File
>> "/home/karl/anaconda/lib/python2.7/site-packages/nose/__init__.py",
>> > line 1, in <module>
>> >     from nose.core import collector, main, run, run_exit, runmodule
>> >   File "/home/karl/anaconda/lib/python2.7/site-packages/nose/core.py",
>> > line 11, in <module>
>> >     from nose.config import Config, all_config_files
>> >   File
>> "/home/karl/anaconda/lib/python2.7/site-packages/nose/config.py",
>> > line 9, in <module>
>> >     from nose.plugins.manager import NoPlugins
>> >   File
>> >
>> "/home/karl/anaconda/lib/python2.7/site-packages/nose/plugins/__init__.py",
>> > line 185, in <module>
>> >     from nose.plugins.manager import *
>> >   File
>> >
>> "/home/karl/anaconda/lib/python2.7/site-packages/nose/plugins/manager.py",
>> > line 418, in <module>
>> >     import pkg_resources
>> >   File
>> >
>> "/home/karl/anaconda/lib/python2.7/site-packages/distribute-0.6.17-py2.7.egg/pkg_resources.py",
>> > line 2729, in <module>
>> >     add_activation_listener(lambda dist: dist.activate())
>> >   File
>> >
>> "/home/karl/anaconda/lib/python2.7/site-packages/distribute-0.6.17-py2.7.egg/pkg_resources.py",
>> > line 700, in subscribe
>> >     callback(dist)
>> >   File
>> >
>> "/home/karl/anaconda/lib/python2.7/site-packages/distribute-0.6.17-py2.7.egg/pkg_resources.py",
>> > line 2729, in <lambda>
>> >     add_activation_listener(lambda dist: dist.activate())
>> >   File
>> >
>> "/home/karl/anaconda/lib/python2.7/site-packages/distribute-0.6.17-py2.7.egg/pkg_resources.py",
>> > line 2229, in activate
>> >     self.insert_on(path)
>> >   File
>> >
>> "/home/karl/anaconda/lib/python2.7/site-packages/distribute-0.6.17-py2.7.egg/pkg_resources.py",
>> > line 2330, in insert_on
>> >     "with distribute. Found one at %s" % str(self.location))
>> > ValueError: A 0.7-series setuptools cannot be installed with
>> distribute.
>> > Found one at
>> >
>> /home/karl/anaconda/lib/python2.7/site-packages/setuptools-20.7.0-py2.7.egg
>>
>> That's a frightening mix of apt-get, neurodebian and anaconda!
>>
>> Have you also been using easy_install by any chance?  I see that your
>> setuptools and distribute packages are in .egg directories.
>>
>> If it were me, I would start by clearing out the easy_install
>> installs, as these can make a real mess of your imports - does
>> https://matthew-brett.github.io/pydagogue/un_easy_install.html help?
>> (you need to look in your anaconda directory rather than the system
>> directories, I suspect).
>>
>> Do you need anaconda for anything specific, not covered by
>> neurodebian?  I suspect your life would be simpler if you could use
>> either `apt-get` or `conda` and not both.
>>
>> Cheers,
>>
>> Matthew
>> _______________________________________________
>> Neuroimaging mailing list
>> Neuroimaging at python.org
>> https://mail.python.org/mailman/listinfo/neuroimaging
>>
> _______________________________________________
> Neuroimaging mailing list
> Neuroimaging at python.org
> https://mail.python.org/mailman/listinfo/neuroimaging
>


-- 
Karl Helmer, PhD
Athinoula A Martinos Center
for Biomedical Imaging
Massachusetts General Hospital
149 - 13th St Room 2301
Charlestown, MA 02129
(p) 617.726.8636
(f) 617.726.7422
helmer at nmr.mgh.harvard.edu





The information in this e-mail is intended only for the person to whom it is
addressed. If you believe this e-mail was sent to you in error and the e-mail
contains patient information, please contact the Partners Compliance HelpLine at
http://www.partners.org/complianceline . If the e-mail was sent to you in error
but does not contain patient information, please contact the sender and properly
dispose of the e-mail.



More information about the Neuroimaging mailing list