Code Monkey home page Code Monkey logo

Comments (8)

fjaviersanchez avatar fjaviersanchez commented on September 11, 2024

Hi @brandonshensley,

I would say (but not 100% sure) that the C Healpix library shipped with MacPorts is not the same version that healpy is internally using (if you did pip install healpy I think that it pulls and installs a copy of libchealpix if it doesn't locate one) and when you try to import healpy it conflicts with the newly-loaded healpix library. If this is the case, you can set the environment variable export DYLD_LIBRARY_PATH='/opt/local/lib' and then reinstall healpy pip install --upgrade --force-reinstall healpy. If this doesn't work we'll need to check out the installing code.

from namaster.

brandonshensley avatar brandonshensley commented on September 11, 2024

Hi @fjaviersanchez, Thanks so much for the reply! I tried your suggestion, but the healpy installation fails (with a similar message as when I try to import it):

bhensley$ pip install --upgrade --force-reinstall healpy
Traceback (most recent call last):
File "/anaconda3/bin/pip", line 7, in
from pip._internal import main
File "/anaconda3/lib/python3.6/site-packages/pip/_internal/init.py", line 42, in
from pip._internal import cmdoptions
File "/anaconda3/lib/python3.6/site-packages/pip/_internal/cmdoptions.py", line 16, in
from pip._internal.index import (
File "/anaconda3/lib/python3.6/site-packages/pip/_internal/index.py", line 14, in
from pip._vendor import html5lib, requests, six
File "/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/init.py", line 28, in
from .serializer import serialize
File "/anaconda3/lib/python3.6/site-packages/pip/_vendor/html5lib/serializer.py", line 11, in
from xml.sax.saxutils import escape
File "/anaconda3/lib/python3.6/xml/sax/saxutils.py", line 6, in
import os, urllib.parse, urllib.request
File "/anaconda3/lib/python3.6/urllib/request.py", line 2585, in
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: dlopen(/anaconda3/lib/python3.6/lib-dynload/_scproxy.cpython-36m-darwin.so, 2): Symbol not found: _iconv
Referenced from: /usr/lib/libcups.2.dylib
Expected in: /opt/local/lib/libiconv.2.dylib
in /usr/lib/libcups.2.dylib

from namaster.

fjaviersanchez avatar fjaviersanchez commented on September 11, 2024

:( I think it's getting kind of confused between the system and the macports libraries, what if you try with export DYLD_LIBRARY_PATH='/opt/local/lib:/usr/lib:/usr/local/lib'? Does it still die?

from namaster.

brandonshensley avatar brandonshensley commented on September 11, 2024

Amazingly, that broke both pymaster and healpy! Just export DYLD_LIBRARY_PATH='/opt/local/lib:/usr/local/lib' returned pymaster to functionality but with healpy still unable to be imported. I am also kind of confused...

from namaster.

brandonshensley avatar brandonshensley commented on September 11, 2024

Progress! Setting instead export DYLD_FALLBACK_LIBRARY_PATH='/opt/local/lib' lets me import both. (I confess I don't really understand why) However, I am still failing three unit tests, unsure if it is related to the issues I've been having:

FAIL: test_mask_c1 (test.test_nmt_utils.TestUtilsMaskSph)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/bhensley/Software/NaMaster/test/test_nmt_utils.py", line 215, in test_mask_c1
    self.assertTrue((np.fabs(msk_apo[self.th<self.th0-np.radians(self.aposize)]-1.)<1E-10).all())
AssertionError: False is not true

======================================================================
FAIL: test_mask_c2 (test.test_nmt_utils.TestUtilsMaskSph)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/bhensley/Software/NaMaster/test/test_nmt_utils.py", line 227, in test_mask_c2
    self.assertTrue((np.fabs(msk_apo[self.th<self.th0-np.radians(self.aposize)]-1.)<1E-10).all())
AssertionError: False is not true

======================================================================
FAIL: test_synfast_flat_stats (test.test_nmt_utils.TestUtilsSynfastFsk)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/bhensley/Software/NaMaster/test/test_nmt_utils.py", line 114, in test_synfast_flat_stats
    self.assertTrue(get_diff(ctt1,self.cltt,self.cltt,self.cltt,self.cltt,nk).all())
AssertionError: False is not true

from namaster.

fjaviersanchez avatar fjaviersanchez commented on September 11, 2024

🎉 glad to hear! I think that it might be related.

I would try to reinstall healpy using the ports version of libchealpix (which I am not sure how to do because it seems that it can't find the _icov library... An option can be maybe creating a link in /usr/local/lib to /opt/local/lib/libcheakpix.dylib but I am not convinced that will work) or download HEALPix and compile from source:

wget https://sourceforge.net/projects/healpix/files/Healpix_3.11/autotools_packages/chealpix-3.11.4.tar.gz && tar xzf chealpix-3.11.4.tar.gz && cd chealpix-3.11.4 && ./configure --enable-shared && make && sudo make install && cd ..

And then: pip install --upgrade --force-reinstall healpy

Also, thanks a lot for your patience and for pointing out these issues!

from namaster.

brandonshensley avatar brandonshensley commented on September 11, 2024

Success! What finally worked was uninstalling my conda installation of healpy and reinstalling with the "--no-deps" flag. I was never able to get healpy to install properly via pip, but it seems like others are also having trouble on macOS 10.13. One lingering thing is a warning during the tests:

test_workspace_compute_coupled_cell (test.test_nmt_master.TestWorkspaceSph) ... /anaconda3/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)
/anaconda3/lib/python3.6/importlib/_bootstrap.py:219: ImportWarning: can't resolve package from __spec__ or __package__, falling back on __name__ and __path__
  return f(*args, **kwds)

but since all tests pass now I'll close the issue and report back if I experience any problems running the code. Thanks so much for all of the help!

from namaster.

fjaviersanchez avatar fjaviersanchez commented on September 11, 2024

I am glad it worked. Please, feel free to open this again if you experience any other related problems and thanks for reporting your solution.

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.