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

BF: try and fix nibabel setup requirement #303

Merged
merged 6 commits into from Dec 31, 2013

Conversation

Projects
None yet
4 participants
@matthew-brett
Member

matthew-brett commented Dec 26, 2013

Use stackoverflow hack to try and allow pip to install nibabel for the
setup.py script.

BF: try and fix nibabel setup requirement
Use stackoverflow hack to try and allow pip to install nibabel for the
setup.py script.
@arokem

This comment has been minimized.

Member

arokem commented Dec 26, 2013

Looks promising. Should we tag this 0.7.1 and upload to pypi?

setup.py Outdated
@@ -53,6 +54,13 @@
# further down. Using distutils install command causes some confusion, due
# to the Pyrex / setuptools hack above (force_setuptools)
from setuptools.command import install
# If running setuptools and nibabel is not installed, we have to force
# setuptools to install nibabel locally for the script to contine. This

This comment has been minimized.

@samuelstjean

samuelstjean Dec 26, 2013

Contributor

to continue

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 26, 2013

Hi @matthew-brett,

Thank you for looking into this.
I fetched and checked out your branch and I still get this error in Ubuntu 13.10.

dipy (setup-requires-fix)]$ sudo python setup.py install
[sudo] password for eleftherios:
running install
Traceback (most recent call last):
File "setup.py", line 193, in
main(*_extra_setuptools_args)
File "setup.py", line 187, in main
*_extra_args
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 113, in run
package_check('numpy', NUMPY_MIN_VERSION)
NameError: global name 'package_check' is not defined

From my understanding nisext is part of nibabel. But I don't understand why I get this message when I have nibabel 1.4.0dev installed in my PYTHONPATH. Shouldn't this script not try to install nibabel if nibabel is already installed? And if nibabel is needed to be reinstalled shouldn't package_check run after nibabel is installed?

@arokem yes when this problem is solved we should make this part of 0.7.1. A maintenance branch is already created here. https://github.com/nipy/dipy/tree/maint/0.7.x

@arokem

This comment has been minimized.

Member

arokem commented Dec 26, 2013

I meant to ask: how would we know that this works with "pip install",
unless we upload it to the cheese-shop?

I am actually not seeing the issues that @Garyfallidis is seeing with this,
also with nibabel 1.4.0dev installed. First time in history that a mac user
has an easier time installing anything...

On Thu, Dec 26, 2013 at 2:54 PM, Eleftherios Garyfallidis <
notifications@github.com> wrote:

Hi @matthew-brett https://github.com/matthew-brett,

Thank you for looking into this.
I fetched and checked out your branch and I still get this error in Ubuntu
13.10.

dipy (setup-requires-fix)]$ sudo python setup.py install
[sudo] password for eleftherios:
running install
Traceback (most recent call last):
File "setup.py", line 193, in
main(*_extra_setuptools_args)
File "setup.py", line 187, in main
*_extra_args
File "/usr/lib/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "setup.py", line 113, in run
package_check('numpy', NUMPY_MIN_VERSION)
NameError: global name 'package_check' is not defined

From my understanding nisext is part of nibabel. But I don't understand
why I get this message when I have nibabel 1.4.0dev installed in my
PYTHONPATH. Shouldn't this script not try to install nibabel if nibabel is
already installed? And if nibabel is needed to be reinstalled shouldn't
package_check run after nibabel is installed?

@arokem https://github.com/arokem yes when this problem is solved we
should make this part of 0.7.1. A maintenance branch is already created
here. https://github.com/nipy/dipy/tree/maint/0.7.x


Reply to this email directly or view it on GitHubhttps://github.com//pull/303#issuecomment-31239291
.

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 26, 2013

Stay on hold Ariel. Maybe it works with you because you are in a different nibabel commit. I tried to run this in a different system and there it worked correctly.

This is nibabel in the Linux system with the problem (Ubuntu 13.10)

In [1]: import nibabel

In [2]: nibabel.version
Out[2]: '1.4.0dev'

In [3]: nibabel.get_info()
Out[3]:
{'commit_hash': 'ff2b545',
'commit_source': 'repository',
'np_version': '1.7.1',
'pkg_path': '/home/eleftherios/Devel/nibabel/nibabel',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.7.5+ (default, Sep 19 2013, 13:48:49) \n[GCC 4.8.1]'}

This is nibabel in the Linux system (Ubuntu 13.04) that works without problems

In [1]: import nibabel

In [2]: nibabel.get_info()
Out[2]:
{'commit_hash': '5704885',
'commit_source': 'repository',
'np_version': '1.7.1',
'pkg_path': '/home/eg309/Devel/nibabel/nibabel',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.7.4 (default, Sep 26 2013, 03:20:26) \n[GCC 4.7.3]'}

In [3]: nibabel.version
Out[3]: '1.4.0dev'

I hope this information helps.

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 26, 2013

Unfortunately, when I switched to the "good" commit in the machine with the problem, the problem didn't disappear.

@arokem

This comment has been minimized.

Member

arokem commented Dec 26, 2013

Yeah. I just pulled from git today and installed that, so:

In [4]: nibabel.get_info()
Out[4]:
{'commit_hash': 'f486687',
'commit_source': 'installation',
'np_version': '1.8.0',
'pkg_path': '/Users/arokem/tmp/junk/lib/python2.7/site-packages/nibabel',
'sys_executable':
'/Users/arokem/Library/Enthought/Canopy_64bit/User/bin/python',
'sys_platform': 'darwin',
'sys_version': '2.7.3 | 64-bit | (default, Jun 14 2013, 18:17:36) \n[GCC
4.2.1 (Apple Inc. build 5666) (dot 3)]'}

In [5]: nibabel.version

AttributeError Traceback (most recent call last)
in ()
----> 1 nibabel.version

AttributeError: 'module' object has no attribute 'version'

OTOH:

In [6]: nibabel.version
Out[6]: '1.4.0dev'

:-)

On Thu, Dec 26, 2013 at 3:31 PM, Eleftherios Garyfallidis <
notifications@github.com> wrote:

Stay on hold Ariel. Maybe it works with you because you are in a different
nibabel commit. I tried to run this in a different system and there it
worked correctly.

This is nibabel in the Linux system with the problem (Ubuntu 13.10)

In [1]: import nibabel

In [2]: nibabel.version
Out[2]: '1.4.0dev'

In [3]: nibabel.get_info()
Out[3]:
{'commit_hash': 'ff2b545',
'commit_source': 'repository',
'np_version': '1.7.1',
'pkg_path': '/home/eleftherios/Devel/nibabel/nibabel',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.7.5+ (default, Sep 19 2013, 13:48:49) \n[GCC 4.8.1]'}

This nibabel in the system (Ubuntu 13.04) that works without problems

In [1]: import nibabel

In [2]: nibabel.get_info()
Out[2]:
{'commit_hash': '5704885',
'commit_source': 'repository',
'np_version': '1.7.1',
'pkg_path': '/home/eg309/Devel/nibabel/nibabel',
'sys_executable': '/usr/bin/python',
'sys_platform': 'linux2',
'sys_version': '2.7.4 (default, Sep 26 2013, 03:20:26) \n[GCC 4.7.3]'}

In [3]: nibabel.version
Out[3]: '1.4.0dev'

I hope this information helps.


Reply to this email directly or view it on GitHubhttps://github.com//pull/303#issuecomment-31240273
.

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Dec 27, 2013

Sorry - I will add a little bit to the commit, but:

python setup.py install

will fail without nibabel / nisext installed - with the package_check error message.

However:

python setup_egg.py install
pip install dipy 

should both work (where pip finds a fixed version of dipy... - maybe with --find-links - I hope)

RF: more informative message for no setuptools
When not running via setuptools, and no nibabel / nisext, we were giving
an undefined name error, which is confusing. Give a better error.
@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 27, 2013

@matthew-brett your final suggestion worked for me. But with this way it downloads nibabel 1.3.0 locally although I have already nibabel 1.4.0dev installed in my system. Is this desirable?

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Dec 27, 2013

It will certainly download nibabel to the dipy source directory - but that shouldn't be a problem - it's only for the install. Does it also download a version of nibabel on the system python path?

I see that there are still problems installing dipy from pip with something like:

python setup.py sdist

then

workon clean-virtualenv
pip install /path/to/dipy/dist/dipy-0.8.0.dev.tar.gz

where the pip install doesn't agree that the c files match the pip files for some reason. I'll keep looking into it.

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 27, 2013

No, I don't think that it installs nibabel on the system path too. But still I don't understand why it needs to install nibabel even if nibabel is already available. Okay let's use this opportunity to review our setup method and make dipy easy to install. Dipy 0.7.0 is a major release and we have to make sure that we deliver nicely all the new algorithms that we implemented.

We can hangout any time if you think that I could help somehow.

@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Dec 27, 2013

Hi,

I wonder if you have the 'nisext' package also installed? It will get
installed by a nibabel install, but if you symlink the development paths
into the python path, you'd have to remember to symlink 'nisext' as well as
'nibabe'

On Fri, Dec 27, 2013 at 10:22 PM, Eleftherios Garyfallidis <
notifications@github.com> wrote:

No, I don't think that it installs nibabel on the system path too. But
still I don't understand why it needs to install nibabel even if nibabel is
already available. Okay let's use this opportunity to review our setup
method and make dipy easy to install. Dipy 0.7.0 is a major release and we
have to make sure that we deliver nicely all the new algorithms that we
implemented.

We can hangout any time if you think that I could help somehow.


Reply to this email directly or view it on GitHubhttps://github.com//pull/303#issuecomment-31282811
.

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 29, 2013

Hi Matthew,

I only add in my PYTHONPATH the initial nibabel source directory (/home/user/Devel/nibabel which contains subfolders nibabel and nisext) and then I can do in python or ipython
from nisext.sexts import package_check
without a problem.

matthew-brett added some commits Dec 30, 2013

RF: more informative cython error messages
Say when we can't import cython, and when we have the wrong version.
BF: add fake_pyrex hack to MANIFEST.in
We need the `fake_pyrex` directory for setuptools install, but I hadn't
included it in the MANIFEST.in, so setuptools-based installation failed
from a source tarball - and therefore pip.
RF: add bdist_wheel as setuptools command
bdist_wheel is a setuptools extension.
BF: always use fake_pyrex fix for setuptools
I was only using fake_pyrex fix in case where I was forcing setuptools,
not the case where something else (like pip) had already imported
setuptools.
@matthew-brett

This comment has been minimized.

Member

matthew-brett commented Dec 30, 2013

I think I found the pip problem, and pip will now install with something like pip install ~/dev_trees/dipy/dist/dipy-0.8.0.dev.tar.gz after building the sdist from this branch.

I don't know how to fix the double install problem, because setuptools has it's own way of finding if you have the package installed, using (I think) the <package>.info directories from setuptools installs. If it doesn't find one of those, I believe it will assume the package is not installed to it's specification, and reinstall...

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 30, 2013

Thx, will have a look shortly.

@Garyfallidis

This comment has been minimized.

Member

Garyfallidis commented Dec 31, 2013

Cool, it works much more smoothly now. @arokem and @matthew-brett should we tag this as 0.7.1 ? or Re-tag the 0.7 release? We haven't announce the 0.7.0 release yet. What do you think is best?

Garyfallidis added a commit that referenced this pull request Dec 31, 2013

Merge pull request #303 from matthew-brett/setup-requires-fix
BF: try and fix nibabel setup requirement

@Garyfallidis Garyfallidis merged commit 7c0b2e3 into nipy:master Dec 31, 2013

1 check passed

default The Travis CI build passed
Details
@arokem

This comment has been minimized.

Member

arokem commented Dec 31, 2013

I say tag this as 0.7.1 and upload it to pypi. Let us all run another whirl
on pip installation, just to be sure that it works and then announce the
birth of the child.

On Tue, Dec 31, 2013 at 4:13 AM, Eleftherios Garyfallidis <
notifications@github.com> wrote:

Merged #303 #303.


Reply to this email directly or view it on GitHubhttps://github.com//pull/303
.

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