Comments (8)
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.
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.
:( 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.
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.
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.
🎉 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.
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.
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)
- nan's with map read from fits file HOT 2
- random seed in synfast_flat
- I am not seeing a real improvement in performance, but it might be my own compiler being a bit outdated. Still worth merging, since libsharp2 is the one being maintained, but will open an issue to investigate further.
- configure fails to find cfitsio HOT 7
- Missing version number in pymaster
- Help installing NaMaster on M2 macOS HOT 17
- cannot find _nmtbin module HOT 4
- Error when setting lmax < 3 * nside - 1 in compute_full_master HOT 2
- Missing different lmax for mask and coupling coefficients for covariances HOT 1
- f_ell does not seem to do anything in NmtBin HOT 1
- Conda installation fails if conda installs gsl=2.7.1 instead of gsl=2.7
- Inconsistency in results between MacOS and Ubuntu HOT 13
- Make exception message more informative
- Weird power in compute_coupled_cell HOT 3
- pymaster installation problem HOT 3
- Pseudo-cl's in the covariance computation - pixel window function HOT 3
- Floating point errors with full sky CAR pixellization HOT 1
- NaMaster installation CFITSIO issue
- Apodisation window functions HOT 3
- Noise bias for flat sky HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from namaster.