Code Monkey home page Code Monkey logo

Comments (29)

NiallJeffrey avatar NiallJeffrey commented on September 11, 2024 2

Ah great. I reordered my channels and updated and now this all works fine. I ran a quick test with cut sky and namaster returns the correct power spectrum.

from namaster.

beckermr avatar beckermr commented on September 11, 2024 1

great! once you update your env again after the rebuild is done (~2 hours or so), you should get a new build of namaster and cfitsio that work together just fine.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

This doesn't help yet, but this will be on conda soon!

conda-forge/staged-recipes#7194

from namaster.

damonge avatar damonge commented on September 11, 2024

@NiallJeffrey sorry for the delay. Have you managed to sort this out yet?
It is very strange that the C tests pass but not the python ones, since most of the latter are almost copies of the former. If the problem is still there, I'd suggest to first try installing it again with the latest version on master.

If the problem persists, let me know and we can run a couple of quick tests to see if things are actually working.

Note that if you're computing power spectra on a cut sky, you would not expect namaster and anafast to return the same answer (you probably know this, but just in case).

from namaster.

NiallJeffrey avatar NiallJeffrey commented on September 11, 2024

@damonge I didn't need the code urgently, so I decided to wait for the conda version.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Ahhhh sorry! The conda version is done!

conda install -c conda-forge namaster

should do the trick!

from namaster.

beckermr avatar beckermr commented on September 11, 2024

This will give you the C version and the python package.

from namaster.

damonge avatar damonge commented on September 11, 2024

@NiallJeffrey can you confirm if this solved your issue?

from namaster.

NiallJeffrey avatar NiallJeffrey commented on September 11, 2024

I am afraid not. I admit not spending a great deal of time trying to solve it, but using the conda version I get "ImportError: No module named '_nmtlib'" and "Reason: image not found".

conda install -c conda-forge namaster
Collecting package metadata: done
Solving environment: done

## Package Plan ##
environment location: /Users/ucapnje/anaconda3
added / updated specs:
- namaster

The following NEW packages will be INSTALLED:

namaster conda-forge/osx-64::namaster-0.9-py36h94a39f0_1001
Proceed ([y]/n)? y

Preparing transaction: done Verifying transaction: done Executing transaction: done
(base) eduroam-int-dhcp-97-155-200:namaster_test ucapnje$ python
Python 3.6.8 |Anaconda, Inc.| (default, Dec 29 2018, 19:04:46)
[GCC 4.2.1 Compatible Clang 4.0.1 (tags/RELEASE_401/final)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymaster
Traceback (most recent call last):
File "/Users/ucapnje/anaconda3/lib/python3.6/site-packages/pymaster/nmtlib.py", line 18, in swig_import_helper
fp, pathname, description = imp.find_module('_nmtlib', [dirname(__file__)])
File "/Users/ucapnje/anaconda3/lib/python3.6/imp.py", line 297, in find_module
raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_nmtlib'

During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/ucapnje/anaconda3/lib/python3.6/site-packages/pymaster/__init__.py", line 40, in <module>
from pymaster import nmtlib as lib
File "/Users/ucapnje/anaconda3/lib/python3.6/site-packages/pymaster/nmtlib.py", line 28, in <module>
_nmtlib = swig_import_helper()
File "/Users/ucapnje/anaconda3/lib/python3.6/site-packages/pymaster/nmtlib.py", line 20, in swig_import_helper
import _nmtlib
ImportError: dlopen(/Users/ucapnje/anaconda3/lib/python3.6/site-packages/_nmtlib.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libssl.1.0.0.dylib
Referenced from: /Users/ucapnje/anaconda3/lib/libssh2.1.dylib
Reason: image not found

from namaster.

beckermr avatar beckermr commented on September 11, 2024

I think you need to make sure conda-forge is first in your channels as opposed to the anaconda defaults. The error here is not the namaster package. The relevant bit is here

`ImportError: dlopen(/Users/ucapnje/anaconda3/lib/python3.6/site-packages/_nmtlib.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libssl.1.0.0.dylib`
` Referenced from: /Users/ucapnje/anaconda3/lib/libssh2.1.dylib`
` Reason: image not found

which is related to something in your conda env.

from namaster.

damonge avatar damonge commented on September 11, 2024

Great! Thanks a lot for reporting this.

from namaster.

humnaawan avatar humnaawan commented on September 11, 2024

@damonge @beckermr Hi, so it appears that I'm running into the same issue noted above:

>>> import pymaster
Traceback (most recent call last):
  File "/Users/humnaawan/anaconda3/lib/python3.6/site-packages/pymaster/nmtlib.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_nmtlib', [dirname(__file__)])
  File "/Users/humnaawan/anaconda3/lib/python3.6/imp.py", line 297, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_nmtlib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/humnaawan/anaconda3/lib/python3.6/site-packages/pymaster/__init__.py", line 49, in <module>
    from pymaster import nmtlib as lib
  File "/Users/humnaawan/anaconda3/lib/python3.6/site-packages/pymaster/nmtlib.py", line 28, in <module>
    _nmtlib = swig_import_helper()
  File "/Users/humnaawan/anaconda3/lib/python3.6/site-packages/pymaster/nmtlib.py", line 20, in swig_import_helper
    import _nmtlib
ImportError: dlopen(/Users/humnaawan/anaconda3/lib/python3.6/site-packages/_nmtlib.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libcfitsio.5.dylib
  Referenced from: /Users/humnaawan/anaconda3/lib/libnmt.0.dylib
  Reason: image not found

I tried the solution noted above re conda channels, so that this is what my ~/.condarc looks like

channels:
  - conda-forge
  - defaults

but I am still getting the same error. I have reinstalled the package (using conda install -c conda-forge namaster) but I am still having the same issue.

As a reference, here's the install summary:

(base) humnaawan:~: conda install -c conda-forge namaster
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/humnaawan/anaconda3

  added / updated specs:
    - namaster


The following NEW packages will be INSTALLED:

  cfitsio            conda-forge/osx-64::cfitsio-3.470-h389770f_1
  chealpix           conda-forge/osx-64::chealpix-3.30.0-h01d97ff_1001
  fftw               conda-forge/osx-64::fftw-3.3.8-nompi_h5c49c53_1106
  gsl                conda-forge/osx-64::gsl-2.5-ha2d443c_0
  krb5               conda-forge/osx-64::krb5-1.16.3-hcfa6398_1001
  libcurl            conda-forge/osx-64::libcurl-7.64.1-h16faf7d_0
  libedit            conda-forge/osx-64::libedit-3.1.20170329-hcfe32e1_1001
  libsharp           conda-forge/osx-64::libsharp-1.0.0-h1de35cc_1000
  libssh2            conda-forge/osx-64::libssh2-1.8.2-hcdc9a53_2
  namaster           conda-forge/osx-64::namaster-1.0-py36h1c7146f_1


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

I'd really appreciate some help.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Well cfitsio bumped the version of their library from 5 to 8. What I don't get is why conda is insisting on linking to the actual file and not the symlink that should prevent this error.

@damonge do you understand how namaster is linking here?

from namaster.

beckermr avatar beckermr commented on September 11, 2024

in the mean time you can install one version back of cfitsio and that will fix it

from namaster.

beckermr avatar beckermr commented on September 11, 2024

This PR should fix the issue. The new package will be live in a few hours.

conda-forge/namaster-feedstock#6

from namaster.

humnaawan avatar humnaawan commented on September 11, 2024

Okay, I downgraded cfitsio to 3.410 and things work. Thanks so much!

from namaster.

damonge avatar damonge commented on September 11, 2024

Sorry I was offline @beckermr , and thanks a lot for fixing this one. Can I check that this is now fixed?

from namaster.

stevecunnington avatar stevecunnington commented on September 11, 2024

Hi @damonge @beckermr - it looks like I'm getting a related error on this. Having just updated to macOS Catalina I've had to reinstall anaconda and some other packages. I'm reinstalling namaster and install seems to work:

(base) Steves-MBP:~ stevecunnington$ conda install -c conda-forge namaster
Collecting package metadata (current_repodata.json): done
Solving environment: done

## Package Plan ##

  environment location: /Users/stevecunnington/opt/anaconda3

  added / updated specs:
    - namaster


The following NEW packages will be INSTALLED:

  cfitsio            conda-forge/osx-64::cfitsio-3.470-h389770f_2
  chealpix           conda-forge/osx-64::chealpix-3.30.0-ha7c7693_1002
  fftw               conda-forge/osx-64::fftw-3.3.8-nompi_h5c49c53_1106
  libsharp           conda-forge/osx-64::libsharp-1.0.0-h1de35cc_1000
  namaster           conda-forge/osx-64::namaster-1.0-py37he2b8767_0


Proceed ([y]/n)? y

Preparing transaction: done
Verifying transaction: done
Executing transaction: done

But importing pymaster gives a similar error as above

(base) Steves-MBP:~ stevecunnington$ python 
Python 3.7.4 (default, Aug 13 2019, 15:17:50) 
[Clang 4.0.1 (tags/RELEASE_401/final)] :: Anaconda, Inc. on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import pymaster
Traceback (most recent call last):
  File "/Users/stevecunnington/opt/anaconda3/lib/python3.7/site-packages/pymaster/nmtlib.py", line 18, in swig_import_helper
    fp, pathname, description = imp.find_module('_nmtlib', [dirname(__file__)])
  File "/Users/stevecunnington/opt/anaconda3/lib/python3.7/imp.py", line 296, in find_module
    raise ImportError(_ERR_MSG.format(name), name=name)
ImportError: No module named '_nmtlib'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/Users/stevecunnington/opt/anaconda3/lib/python3.7/site-packages/pymaster/__init__.py", line 49, in <module>
    from pymaster import nmtlib as lib
  File "/Users/stevecunnington/opt/anaconda3/lib/python3.7/site-packages/pymaster/nmtlib.py", line 28, in <module>
    _nmtlib = swig_import_helper()
  File "/Users/stevecunnington/opt/anaconda3/lib/python3.7/site-packages/pymaster/nmtlib.py", line 20, in swig_import_helper
    import _nmtlib
ImportError: dlopen(/Users/stevecunnington/opt/anaconda3/lib/python3.7/site-packages/_nmtlib.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libcfitsio.5.dylib
  Referenced from: /Users/stevecunnington/opt/anaconda3/lib/libnmt.0.dylib
  Reason: image not found

The channels in my .condarc seem to be as suggested above

channels:
  - conda-forge
  - defaults

Has the issue with cfitsio been solved yet or do I need to downgrade this to make things work?

Any help would be great.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Unclear. Plus the os upgrade is in the mix. Did you reinstall the Xcode command line tools?

from namaster.

stevecunnington avatar stevecunnington commented on September 11, 2024

I've just opened Xcode and updated that and this didn't solve the problem

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Awesome thanks for checking! Try downgrading cfitsio and lets see if that helps.

from namaster.

stevecunnington avatar stevecunnington commented on September 11, 2024

What's the easiest way to do this? And what version should I downgrade to?

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Try something like conda install cfitsio==3.430.

from namaster.

stevecunnington avatar stevecunnington commented on September 11, 2024

Yep, that worked :) thanks @beckermr !

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Of course! So looking at your install above, you have one of the oldest versions of namaster on conda, conda-forge/osx-64::namaster-1.0-py37he2b8767_0

The latest build should have build number (the single int at the end) of 4. See this page here: https://anaconda.org/conda-forge/namaster/files

I don't get how the solver decided on that.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

You might also try forcing the entire env to upgrade if you want.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

Did you change the labels in your channels or something globally in conda?

from namaster.

stevecunnington avatar stevecunnington commented on September 11, 2024

No, I've made no changes to my channels. Because of the macOS upgrade, my anaconda should just be the latest default installed one using the graphical install - with no changes made.

from namaster.

beckermr avatar beckermr commented on September 11, 2024

hmmmm ok - well let's keep moving then. I might try and get the old packages marked as broken

from namaster.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.