Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error importing Reorient2std #2505

Open
piyusharma95 opened this issue Mar 23, 2018 · 7 comments
Open

Error importing Reorient2std #2505

piyusharma95 opened this issue Mar 23, 2018 · 7 comments

Comments

@piyusharma95
Copy link

from nipype import Reorient2Std

ImportError Traceback (most recent call last)
in ()
----> 1 from nipype import Reorient2Std

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nipype/init.py in ()
49
50
---> 51 from .pipeline import Node, MapNode, JoinNode, Workflow
52 from .interfaces import (DataGrabber, DataSink, SelectFiles, IdentityInterface,
53 Rename, Function, Select, Merge)

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nipype/pipeline/init.py in ()
9 absolute_import)
10 docformat = 'restructuredtext'
---> 11 from .engine import Node, MapNode, JoinNode, Workflow

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nipype/pipeline/engine/init.py in ()
10 from future import absolute_import
11 docformat = 'restructuredtext'
---> 12 from .workflows import Workflow
13 from .nodes import Node, MapNode, JoinNode
14 from .utils import generate_expanded_graph

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nipype/pipeline/engine/workflows.py in ()
34 from ...utils.functions import (getsource, create_function_from_source)
35
---> 36 from ...interfaces.base import (traits, TraitedSpec, TraitDictObject,
37 TraitListObject)
38 from ...utils.filemanip import save_json, makedirs, to_str

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nipype/interfaces/init.py in ()
12
13 from .io import DataGrabber, DataSink, SelectFiles, BIDSDataGrabber
---> 14 from .utility import IdentityInterface, Rename, Function, Select, Merge

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nipype/interfaces/utility/init.py in ()
8 """
9
---> 10 from .base import (IdentityInterface, Rename, Select, Split, Merge,
11 AssertEqual)
12 from .csv import CSVReader

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nipype/interfaces/utility/base.py in ()
17 import re
18 import numpy as np
---> 19 import nibabel as nb
20
21 from ..base import (traits, TraitedSpec, DynamicTraitedSpec, File, Undefined,

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/nibabel/init.py in ()
36 """
37 # module imports
---> 38 from . import analyze as ana
39 from . import spm99analyze as spm99
40 from . import spm2analyze as spm2

ImportError: cannot import name analyze
HOW TO INSTALL "analyze", "spm99analyze", "spm2analyze" libraries?
pip install analyze doesn't work.

@effigies
Copy link
Member

analyze, spm99analyze and spm2analyze are modules in the nibabel package. It's odd that you're unable to load these, given that it seems to be installed. Can you try pip uninstall nibabel && pip install nibabel, to make sure that it's installed correctly?

@piyusharma95
Copy link
Author

_The issue still remains. I found out that the main issue remains in :

import nipype

I'm getting

anaconda2/lib/python2.7/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type.
from ._conv import register_converters as _register_converters

Exception Traceback (most recent call last)
in ()
----> 1 import nipype

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nipype/init.py in ()
49
50
---> 51 from .pipeline import Node, MapNode, JoinNode, Workflow
52 from .interfaces import (DataGrabber, DataSink, SelectFiles, IdentityInterface,
53 Rename, Function, Select, Merge)

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nipype/pipeline/init.py in ()
9 absolute_import)
10 docformat = 'restructuredtext'
---> 11 from .engine import Node, MapNode, JoinNode, Workflow

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nipype/pipeline/engine/init.py in ()
10 from future import absolute_import
11 docformat = 'restructuredtext'
---> 12 from .workflows import Workflow
13 from .nodes import Node, MapNode, JoinNode
14 from .utils import generate_expanded_graph

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nipype/pipeline/engine/workflows.py in ()
34 from ...utils.functions import (getsource, create_function_from_source)
35
---> 36 from ...interfaces.base import (traits, TraitedSpec, TraitDictObject,
37 TraitListObject)
38 from ...utils.filemanip import save_json, makedirs, to_str

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nipype/interfaces/init.py in ()
12
13 from .io import DataGrabber, DataSink, SelectFiles, BIDSDataGrabber
---> 14 from .utility import IdentityInterface, Rename, Function, Select, Merge

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nipype/interfaces/utility/init.py in ()
8 """
9
---> 10 from .base import (IdentityInterface, Rename, Select, Split, Merge,
11 AssertEqual)
12 from .csv import CSVReader

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nipype/interfaces/utility/base.py in ()
17 import re
18 import numpy as np
---> 19 import nibabel as nb
20
21 from ..base import (traits, TraitedSpec, DynamicTraitedSpec, File, Undefined,

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/nibabel/init.pyc in ()
72 # Note test requirement for "mock". Requirement for "nose" tested by numpy.
73 try:
---> 74 import mock
75 except ImportError:
76 def test(*args, **kwargs):

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/mock/init.py in ()
1 from future import absolute_import
----> 2 import mock.mock as _mock
3 from mock.mock import *
4 all = _mock.all
5 #import mock.mock as _mock

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/mock/mock.py in ()
69 from pbr.version import VersionInfo
70
---> 71 _v = VersionInfo('mock').semantic_version()
72 version = _v.release_string()
73 version_info = _v.version_tuple()

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/pbr/version.pyc in semantic_version(self)
459 """Return the SemanticVersion object for this version."""
460 if self._semantic is None:
--> 461 self._semantic = self._get_version_from_pkg_resources()
462 return self._semantic
463

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/pbr/version.pyc in _get_version_from_pkg_resources(self)
446 # installed into anything. Revert to setup-time logic.
447 from pbr import packaging
--> 448 result_string = packaging.get_version(self.package)
449 return SemanticVersion.from_pip_string(result_string)
450

/Users/doxbin/.virtualenvs/test2/lib/python2.7/site-packages/pbr/packaging.pyc in get_version(package_name, pre_version)
753 " to pbr.version.VersionInfo. Project name {name} was"
754 " given, but was not able to be found.".format(
--> 755 name=package_name))
756
757

Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.

@effigies
Copy link
Member

You may want to do the same thing for mock.

@piyusharma95
Copy link
Author

piyusharma95 commented Mar 23, 2018

The error persists.
testing-cabal/mock#383

@effigies
Copy link
Member

effigies commented Mar 23, 2018

What version of setuptools are you using?

python -c 'import setuptools; print(setuptools.__version__)'

Edit: Just going by that issue, it may be possible to upgrade setuptools to a more recent version (>=17.1) with pip install --upgrade setuptools and then re-install mock.

@piyusharma95
Copy link
Author

Ran the following commands:

python -c 'import setuptools; print(setuptools.version)'
39.0.1
pip uninstall mock
pip uninstall setuptools
pip install --upgrade setuptools
pip install mock
ipython
In [1]: import mock


Exception Traceback (most recent call last)
in ()
----> 1 import mock

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/mock/init.py in ()
1 from future import absolute_import
----> 2 import mock.mock as _mock
3 from mock.mock import *
4 all = _mock.all
5 #import mock.mock as _mock

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/mock/mock.py in ()
69 from pbr.version import VersionInfo
70
---> 71 _v = VersionInfo('mock').semantic_version()
72 version = _v.release_string()
73 version_info = _v.version_tuple()

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/pbr/version.pyc in semantic_version(self)
459 """Return the SemanticVersion object for this version."""
460 if self._semantic is None:
--> 461 self._semantic = self._get_version_from_pkg_resources()
462 return self._semantic
463

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/pbr/version.pyc in _get_version_from_pkg_resources(self)
446 # installed into anything. Revert to setup-time logic.
447 from pbr import packaging
--> 448 result_string = packaging.get_version(self.package)
449 return SemanticVersion.from_pip_string(result_string)
450

/Users/doxbin/.virtualenvs/SMH/lib/python2.7/site-packages/pbr/packaging.pyc in get_version(package_name, pre_version)
753 " to pbr.version.VersionInfo. Project name {name} was"
754 " given, but was not able to be found.".format(
--> 755 name=package_name))
756
757

Exception: Versioning for this project requires either an sdist tarball, or access to an upstream git repository. It's also possible that there is a mismatch between the package name in setup.cfg and the argument given to pbr.version.VersionInfo. Project name mock was given, but was not able to be found.

Still the problems persists

@effigies
Copy link
Member

I might suggest opening an issue at the mock page to see what they recommend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants