Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not installing under Python 3.11 #17

Open
doccosmos opened this issue Sep 7, 2023 · 5 comments
Open

Not installing under Python 3.11 #17

doccosmos opened this issue Sep 7, 2023 · 5 comments

Comments

@doccosmos
Copy link

Hi,

I'm trying to install under Python 3.11.4 on a Intel Mac running 13.5:

% python setup.py config_fc --fcompiler=gnu95 install
/Users/mjg/Projects/packages/javelin/setup.py:5: DeprecationWarning:

numpy.distutils is deprecated since NumPy 1.23.0, as a result
of the deprecation of distutils itself. It will be removed for
Python >= 3.12. For older Python versions it will remain present.
It is recommended to use setuptools < 60.0 for those Python versions.
For more details, see:
https://numpy.org/devdocs/reference/distutils_status_migration.html

from numpy.distutils.misc_util import Configuration
running config_fc
INFO: unifing config_fc, config, build_clib, build_ext, build commands --fcompiler options
running install
/opt/anaconda3/lib/python3.11/site-packages/setuptools/_distutils/cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

    ********************************************************************************
    Please avoid running ``setup.py`` directly.
    Instead, use pypa/build, pypa/installer or other
    standards-based tools.

    See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
    ********************************************************************************

!!
self.initialize_options()
running build
running config_cc
INFO: unifing config_cc, config, build_clib, build_ext, build commands --compiler options
running build_src
INFO: build_src
INFO: building extension "javelin.gp.linalg_utils" sources
INFO: f2py options: []
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/fortranobject.c' to sources.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp' to include_dirs.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/javelin/gp/linalg_utils-f2pywrappers.f' to sources.
INFO: building extension "javelin.gp.incomplete_chol" sources
INFO: f2py options: []
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/fortranobject.c' to sources.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp' to include_dirs.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/javelin/gp/incomplete_chol-f2pywrappers.f' to sources.
INFO: building extension "javelin.gp.cov_funs.isotropic_cov_funs" sources
INFO: f2py options: []
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/cov_funs/fortranobject.c' to sources.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/cov_funs' to include_dirs.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/javelin/gp/cov_funs/isotropic_cov_funs-f2pywrappers.f' to sources.
INFO: building extension "javelin.gp.cov_funs.distances" sources
INFO: f2py options: []
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/cov_funs/fortranobject.c' to sources.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/cov_funs' to include_dirs.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/javelin/gp/cov_funs/distances-f2pywrappers.f' to sources.
INFO: building extension "javelin.spear_covfunc" sources
INFO: f2py options: []
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/fortranobject.c' to sources.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin' to include_dirs.
INFO: adding 'build/src.macosx-10.9-x86_64-3.11/javelin/spear_covfunc-f2pywrappers2.f90' to sources.
INFO: build_src: building npy-pkg config files
running build_py
running build_ext
INFO: customize UnixCCompiler
INFO: customize UnixCCompiler using build_ext
INFO: CCompilerOpt.init[819] : load cache from file -> /Users/mjg/Projects/packages/javelin/build/temp.macosx-10.9-x86_64-cpython-311/ccompiler_opt_cache_ext.py
INFO: CCompilerOpt.init[830] : hit the file cache
WARN: resetting extension 'javelin.gp.linalg_utils' language from 'c' to 'f77'.
WARN: resetting extension 'javelin.gp.incomplete_chol' language from 'c' to 'f77'.
WARN: resetting extension 'javelin.gp.cov_funs.isotropic_cov_funs' language from 'c' to 'f77'.
WARN: resetting extension 'javelin.gp.cov_funs.distances' language from 'c' to 'f77'.
WARN: resetting extension 'javelin.spear_covfunc' language from 'c' to 'f77'.
INFO: customize Gnu95FCompiler
INFO: Found executable /usr/local/bin/gfortran
INFO: customize Gnu95FCompiler using build_ext
INFO: building 'javelin.gp.linalg_utils' extension
INFO: compiling C sources
INFO: C compiler: clang -DNDEBUG -fwrapv -O2 -Wall -fPIC -O2 -isystem /opt/anaconda3/include -fPIC -O2 -isystem /opt/anaconda3/include -ftrapping-math

INFO: compile options: '-DHAVE_CBLAS -Ibuild/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp -I/opt/anaconda3/lib/python3.11/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-x86_64-3.11/numpy/distutils/include -I/opt/anaconda3/include/python3.11 -c'
extra options: '-msse -msse2 -msse3'
INFO: compiling Fortran sources
INFO: Fortran f77 compiler: /usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran f90 compiler: /usr/local/bin/gfortran -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops
Fortran fix compiler: /usr/local/bin/gfortran -Wall -g -ffixed-form -fno-second-underscore -Wall -g -fno-second-underscore -fPIC -O3 -funroll-loops
INFO: compile options: '-DHAVE_CBLAS -Ibuild/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp -I/opt/anaconda3/lib/python3.11/site-packages/numpy/core/include -Ibuild/src.macosx-10.9-x86_64-3.11/numpy/distutils/include -I/opt/anaconda3/include/python3.11 -c'
INFO: gfortran:f77: javelin/gp/linalg_utils.f
INFO: gfortran:f77: javelin/blas_wrap.f
INFO: gfortran:f77: build/src.macosx-10.9-x86_64-3.11/javelin/gp/linalg_utils-f2pywrappers.f
javelin/gp/linalg_utils.f:151:56:

151 | SUBROUTINE gp_array_logp(x, mu, sig, n, like, info)
| 1
Warning: Unused dummy argument 'info' at (1) [-Wunused-dummy-argument]
INFO: /usr/local/bin/gfortran -Wall -g -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.9-x86_64-cpython-311/build/src.macosx-10.9-x86_64-3.11/javelin/gp/linalg_utilsmodule.o build/temp.macosx-10.9-x86_64-cpython-311/build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/fortranobject.o build/temp.macosx-10.9-x86_64-cpython-311/javelin/gp/linalg_utils.o build/temp.macosx-10.9-x86_64-cpython-311/javelin/blas_wrap.o build/temp.macosx-10.9-x86_64-cpython-311/build/src.macosx-10.9-x86_64-3.11/javelin/gp/linalg_utils-f2pywrappers.o -L/opt/anaconda3/lib -L/usr/local/lib/gcc/x86_64-apple-darwin19/9.2.0 -L/usr/local/lib/gcc/x86_64-apple-darwin19/9.2.0/../../.. -L/usr/local/lib/gcc/x86_64-apple-darwin19/9.2.0/../../.. -lopenblas -lopenblas -lgfortran -o build/lib.macosx-10.9-x86_64-cpython-311/javelin/gp/linalg_utils.cpython-311-darwin.so
ld: unsupported tapi file type '!tapi-tbd' in YAML file '/Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/lib/libSystem.tbd' for architecture x86_64
collect2: error: ld returned 1 exit status
error: Command "/usr/local/bin/gfortran -Wall -g -Wall -g -undefined dynamic_lookup -bundle build/temp.macosx-10.9-x86_64-cpython-311/build/src.macosx-10.9-x86_64-3.11/javelin/gp/linalg_utilsmodule.o build/temp.macosx-10.9-x86_64-cpython-311/build/src.macosx-10.9-x86_64-3.11/build/src.macosx-10.9-x86_64-3.11/javelin/gp/fortranobject.o build/temp.macosx-10.9-x86_64-cpython-311/javelin/gp/linalg_utils.o build/temp.macosx-10.9-x86_64-cpython-311/javelin/blas_wrap.o build/temp.macosx-10.9-x86_64-cpython-311/build/src.macosx-10.9-x86_64-3.11/javelin/gp/linalg_utils-f2pywrappers.o -L/opt/anaconda3/lib -L/usr/local/lib/gcc/x86_64-apple-darwin19/9.2.0 -L/usr/local/lib/gcc/x86_64-apple-darwin19/9.2.0/../../.. -L/usr/local/lib/gcc/x86_64-apple-darwin19/9.2.0/../../.. -lopenblas -lopenblas -lgfortran -o build/lib.macosx-10.9-x86_64-cpython-311/javelin/gp/linalg_utils.cpython-311-darwin.so" failed with exit status 1
INFO:
########### EXT COMPILER OPTIMIZATION ###########
INFO: Platform :
Architecture: x64
Compiler : clang

CPU baseline :
Requested : 'min'
Enabled : SSE SSE2 SSE3
Flags : -msse -msse2 -msse3
Extra checks: none

CPU dispatch :
Requested : 'max -xop -fma4'
Enabled : SSSE3 SSE41 POPCNT SSE42 AVX F16C FMA3 AVX2 AVX512F AVX512CD AVX512_KNL AVX512_SKX AVX512_CLX AVX512_CNL AVX512_ICL
Generated : none
INFO: CCompilerOpt.cache_flush[863] : write cache to path -> /Users/mjg/Projects/packages/javelin/build/temp.macosx-10.9-x86_64-cpython-311/ccompiler_opt_cache_ext.py

@doccosmos
Copy link
Author

Digging a bit, it looks like /usr/bin/ld has to be first in PATH rather than the Anaconda ld. It compiles fine, now, but then gives:

Python 3.11.4 (main, Jul 5 2023, 09:00:44) [Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.

import javelin
Traceback (most recent call last):
File "", line 1, in
File "/Users/mjg/Projects/packages/javelin/javelin/init.py", line 2, in
from . import gp
File "/Users/mjg/Projects/packages/javelin/javelin/gp/init.py", line 19, in
from .GPutils import *
File "/Users/mjg/Projects/packages/javelin/javelin/gp/GPutils.py", line 17, in
from javelin.gp.linalg_utils import *
ModuleNotFoundError: No module named 'javelin.gp.linalg_utils'

@nye17
Copy link
Owner

nye17 commented Sep 13, 2023

It seems like you are importing javelin from the source dir? Can you go to the example dir and run some of the test codes like plotcov.py, or jump out of the javelin source dir before importing javelin?

@lss-len
Copy link

lss-len commented Jun 17, 2024

I have similar problem with python 3.12

@lss-len
Copy link

lss-len commented Jun 17, 2024

from numpy.distutils.misc_util import Configuration
ModuleNotFoundError: No module named 'numpy.distutils'

@HojinCho
Copy link

HojinCho commented Nov 7, 2024

numpy.distutils is deprecated since NumPy 1.23.0, as a result of the deprecation of distutils itself. It will be removed for Python >= 3.12. For older Python versions it will remain present. It is recommended to use setuptools < 60.0 for those Python versions. For more details, see: https://numpy.org/devdocs/reference/distutils_status_migration.html

Is there a plan to remove numpy.distutils and move on to setuptools?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants