astropy / astropy

Astronomy and astrophysics core library
https://www.astropy.org
BSD 3-Clause "New" or "Revised" License
4.31k stars 1.73k forks source link

Install error with recent commits: _wcs doesn't have WcsError #1280

Closed keflavich closed 10 years ago

keflavich commented 10 years ago

I've been seeing this error:

$ python setup.py develop
Freezing version number to astropy/version.py
Traceback (most recent call last):
  File "setup.py", line 82, in <module>
    package_dirs)
  File "/Volumes/disk5/Users/adam/repos/astropy/astropy/setup_helpers.py", line 1028, in update_package_files
    extensions.extend(setuppkg.get_extensions())
  File "astropy/wcs/setup_package.py", line 206, in get_extensions
    generate_c_docstrings()
  File "astropy/wcs/setup_package.py", line 122, in generate_c_docstrings
    from astropy.wcs import docstrings
  File "/Volumes/disk5/Users/adam/repos/astropy/astropy/wcs/__init__.py", line 27, in <module>
    from .wcs import *
  File "/Volumes/disk5/Users/adam/repos/astropy/astropy/wcs/wcs.py", line 82, in <module>
    WcsError = _wcs.WcsError
AttributeError: 'module' object has no attribute 'WcsError'

when trying to install from the latest astropy source. On one of my machines, I was able to get around the issue by doing rm -r build, but on my other, the problem persists.

keflavich commented 10 years ago

Sorry, I misreported the error. The issue actually comes from 9d982a3, and is absent in the prior commit, e3e3414. This is true on both machines.

mdboom commented 10 years ago

Have you at any time done a setup.py build --inplace or setup.py develop? That will leave an old version of the _wcs.so extension around, which doesn't have this new WcsError member. I that's what it is, I'll have to again unleash my recurring rant about why any tool that builds things "in place" is an abomination :wink:. If that's not what it is, I'm at a bit of a loss.

Try doing git clean -fxd to clean out your git working directory and see if it fixes things.

EDIT: I see setup.py develop at the top of the report. I just have to recommend not doing that, or become accustomed to git clean -fxd. I know that's a minority opinion around here...

keflavich commented 10 years ago

Brilliant, thanks. I personally prefer adding git clean -fxd to my workflow rather than avoiding python setup.py develop - I tend not to edit anything but .py files and prefer to have a shorter workflow for reloading python file changes.

That said, feel free to unleash the rant.

keflavich commented 10 years ago

FYI, note that this is causing problems on RTFD also: https://readthedocs.org/builds/astroquery/709230/

keflavich commented 10 years ago

On readthedocs, even using a wipe doesn't solve the issue. Any thoughts on that? I don't think you can pass any git commands directly to rtfd, and I guess they don't really delete the whole directory? That seems quite strange to me.

embray commented 10 years ago

Indeed, most of the time setup.py develop is fine--it only bugs out if changes can occur in extension modules. This happens to me most often when changing branches, so sometimes I either do git fresh (which is an alias I have for git clean -d -x -f -e .tox so that it doesn't wipe away my tox envs).

Sometimes if I suspect this is going to happen I just check out a branch into a separate working copy. Usually it's not an issue though.

I don't know why you would be having problems with this in RTD but I don't think that's really an Astropy issue.

keflavich commented 10 years ago

Thanks for those tips. However, the RTD issue is the exact same error message I reported above. @kbarbary reported a similar issue on another RTD build. There are other problems with that build, but I think the failure to build astropy is something we should be able to figure out?

kbarbary commented 10 years ago

@keflavich To me, it really looks like the problem is that the RTD "wipe" is not really deleting everything. Maybe we should ask the RTD guys what's going on. Off-topic for this PR though.

astrofrog commented 10 years ago

Try pressing the wipe button several times in a row - it sometimes goes through different paths.

keflavich commented 10 years ago

Tried that. I think contacting RTD is probably best.

keflavich commented 10 years ago

@cdeil posted the issue at RTD: https://github.com/rtfd/readthedocs.org/issues/422

While this is perhaps no longer an astropy issue, it is affecting a lot of astropy dependencies, so I think it's good to keep track of it here for a little while longer.

kbarbary commented 10 years ago

Thanks for filing the issue @cdeil!

cdeil commented 10 years ago

@erikholscher confirmed that this is an issue with wipe on readthedocs at https://github.com/rtfd/readthedocs.org/issues/422#issuecomment-21755288 and they are working on it:

This ticket will be kept open to fix the problem w/ wipe not working.

So IMO this astropy issue can be closed ... astropy affiliated package devs will still find it with the search button.