Open kelle opened 3 years ago
IIRC, python 3.9 is required for M1 support. haven't tried 3.8. however, even with 3.9 i ran into a lot of conda dependency issues with the miniforge installer for the M1. it could handle dependencies, but not dependencies of dependencies. haven't had a chance to loop back to see if there's since been a fix for that.
If there is willingness to try a few things:
conda env create -n astropy-M1 python=3.9 astropy matplotlib pip scipy pandas
followed by conda activate astropy-M1
and then pip install astroquery notebook xlrd xlwt
.For the workshop, we might have to make a separate set of instructions for M1; and we can have a Binder instance as a fallback. We could have troubleshooting at the Astropy booth the week after the workshop.
it could handle dependencies, but not dependencies of dependencies.
This is not true. What probably happens is that you are trying to install a noarch
package with a dependency that is not noarch
and has not been built for the osx-arm64
platform. If you want more packages built for the osx-arm64
platform and is willing to help out, send a PR to https://github.com/conda-forge/conda-forge-pinning-feedstock/blob/master/recipe/migrations/osx_arm64.txt to add whatever packages you need.
that sounds like a good explanation for the root cause of what i saw. i was able to get everything installed eventually by installing the deep dependencies manually and then working upward from there. so everything i needed was built for osx-arm64
, but somehow not being found. anyway, it's been a month since i worked on this so will give it another go soon.
in the meantime, i stick with my strong recommendation that users run astropy and the rest of the scientific python stack under rosetta until apple silicon is officially supported by the default conda and pip channels.
What has worked. I did it line-by-line:
conda create -n astropy-workshop-M1 python=3.9
conda activate astropy-workshop-M1
conda install astropy
conda install matplotlib
conda install scipy
conda install pandas
pip install astroquery
pip install xlrd
pip install xlwt
conda install ipython
conda install notebook
conda install cython
conda install scikit-image
conda install jupyterlab
conda install nbgitpuller
conda install asdf
conda install gwcs
And now only two things left which failed to import when I ran check_env.py
:
photutils
specutils
PROGRESS!
I will start digging into how to get the utils packages installed but any hand holding advice is welcome.
I got more things to work! Just going to edit the above comment.
Now i'm running into this error when I try pip install photutils
. I've tried to only paste the relevant parts:
customize UnixCCompiler
libraries mkl_rt not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
blis_info:
libraries blis not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
openblas_info:
libraries openblas not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
atlas_3_10_blas_threads_info:
Setting PTATLAS=ATLAS
libraries tatlas not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
atlas_3_10_blas_info:
libraries satlas not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
atlas_blas_threads_info:
Setting PTATLAS=ATLAS
libraries ptf77blas,ptcblas,atlas not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
atlas_blas_info:
libraries f77blas,cblas,atlas not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
accelerate_info:
libraries accelerate not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
Library accelerate was not found. Ignoring
libraries veclib not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
Library veclib was not found. Ignoring
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
non-existing path in 'numpy/distutils': 'site.cfg'
lapack_opt_info:
lapack_mkl_info:
libraries mkl_rt not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
openblas_lapack_info:
libraries openblas not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
openblas_clapack_info:
libraries openblas,lapack not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
flame_info:
libraries flame not found in ['/Users/kelle/miniforge3/envs/astropy-workshop-M1/lib', '/usr/lib']
NOT AVAILABLE
atlas_3_10_threads_info:
Setting PTATLAS=ATLAS
libraries lapack_atlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries tatlas,tatlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries lapack_atlas not found in /usr/lib
libraries tatlas,tatlas not found in /usr/lib
<class 'numpy.distutils.system_info.atlas_3_10_threads_info'>
NOT AVAILABLE
atlas_3_10_info:
libraries lapack_atlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries satlas,satlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries lapack_atlas not found in /usr/lib
libraries satlas,satlas not found in /usr/lib
<class 'numpy.distutils.system_info.atlas_3_10_info'>
NOT AVAILABLE
atlas_threads_info:
Setting PTATLAS=ATLAS
libraries lapack_atlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries ptf77blas,ptcblas,atlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries lapack_atlas not found in /usr/lib
libraries ptf77blas,ptcblas,atlas not found in /usr/lib
<class 'numpy.distutils.system_info.atlas_threads_info'>
NOT AVAILABLE
atlas_info:
libraries lapack_atlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries f77blas,cblas,atlas not found in /Users/kelle/miniforge3/envs/astropy-workshop-M1/lib
libraries lapack_atlas not found in /usr/lib
libraries f77blas,cblas,atlas not found in /usr/lib
<class 'numpy.distutils.system_info.atlas_info'>
NOT AVAILABLE
FOUND:
extra_compile_args = ['-msse3', '-I/System/Library/Frameworks/vecLib.framework/Headers']
extra_link_args = ['-Wl,-framework', '-Wl,Accelerate']
define_macros = [('NO_ATLAS_INFO', 3), ('HAVE_CBLAS', None)]
In file included from numpy/core/src/npymath/npy_math.c:9:
numpy/core/src/npymath/npy_math_internal.h.src:490:21: warning: incompatible pointer types passing 'npy_longdouble *' (aka 'double *') to parameter of type 'long double *' [-Wincompatible-pointer-types]
return modfl(x, iptr);
^~~~
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/math.h:394:52: note: passing argument to parameter here
extern long double modfl(long double, long double *);
^
1 warning generated.
llvm-ar: adding 4 object files to build/temp.macosx-11.0-arm64-3.9/libnpymath.a
error: Command "/Users/runner/miniforge3/conda-bld/python-split_1608587737618/_build_env/bin/llvm-ar rcs build/temp.macosx-11.0-arm64-3.9/libnpymath.a build/temp.macosx-11.0-arm64-3.9/numpy/core/src/npymath/npy_math.o build/temp.macosx-11.0-arm64-3.9/build/src.macosx-11.0-arm64-3.9/numpy/core/src/npymath/ieee754.o build/temp.macosx-11.0-arm64-3.9/build/src.macosx-11.0-arm64-3.9/numpy/core/src/npymath/npy_math_complex.o build/temp.macosx-11.0-arm64-3.9/numpy/core/src/npymath/halffloat.o" failed with exit status 127
----------------------------------------
ERROR: Failed building wheel for numpy
Failed to build numpy
ERROR: Could not build wheels for numpy which use PEP 517 and cannot be installed directly
I get this same error with another package I'm working on so at least there's consistency!
@kelle Those warnings are coming from trying to build numpy
from source (and it's not finding the OpenBlas or ATLAS libraries). I'm not sure how you installed astropy
without installing numpy
though.
@kelle If indeed numpy
is not installed, try this: https://github.com/numpy/numpy/issues/17807
@larrybradley , might be easier to chat on slack? As far as I can tell, numpy is indeed installed.
numpy 1.19.4 py39h69a04d8_2 conda-forge
yeah, if you can't install photutils
via conda
, you'll need to pull the source and do python setup.py install
. i had to do that for a few packages, but would need to pry laptop away from spouse to double-check if photutils
was one of them. actually reasonably sure it was...
the other packages i needed to install from source ran into the same problem when installing via pip
. namely, not seeing a conda-installed dependency and trying to build it, but failing. until there are osx-arm64
binary wheels, pip
will be problematic on that platform.
cloned photutils and then ran python setup.py install
from the top level directory. Had to do this first though:
pip install extensions-helpers
. Trying specutils
now.
Yep, that worked (I used pip install .
instead this time) and now the setup script found all the things!
Found IPython 7.19.0
Found cython 0.29.21
Found jupyter
Found notebook 6.1.6
Found numpy 1.19.4
Found scipy 1.6.0
Found skimage 0.18.1
Found matplotlib 3.3.3
Found pandas 1.2.0
Found bs4 4.9.3
Found keyring
Found html5lib 1.1
Found xlwt 1.3.0
Found requests 2.25.1
Found jupyterlab 3.0.1
Found nbgitpuller 0.9.0
Found astropy 4.2
Found asdf 2.7.1
Found gwcs 0.16.1
Found photutils 1.1.0.dev99+gc9ff83db
Found specutils 1.2.dev73+g91bd46a7
Found astroquery 0.4.1
I've put this workflow in the Google Doc Setup for M1 Mac for Scientific Astro Programming. And I think we can close this issue. :)
uh-oh, I think we forgot to add ccdproc to the workshop installation instructions! I see it in the Google doc, so does that mean you've installed it already?
I'm trying to get setup on a new ARM mac and I've hit this problem when trying to create the new environment using the yml file. I've followed this document so far. I'm looping in @tepickering since he helped me get this point.