There seems to be an issue installing scikit-learn on Mac M1 chips for Big Sur. I tried including the environment variable flags in this answer to no avail.
The specific error is:
Collecting scikit-learn
Using cached scikit-learn-1.0.2.tar.gz (6.7 MB)
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [5382 lines of output]
Ignoring numpy: markers 'python_version == "3.7" and platform_machine != "aarch64" and platform_system != "AIX" and platform_python_implementation != "PyPy"' don't match your environment
...clip...
Running from SciPy source directory.
/private/var/folders/4s/pdgwwvsn2wd9192jdyz2lk8w0000gn/T/pip-install-7gy3iln3/scipy_92a96fbb9138448d8d153c3fef5c5cb4/scipy/linalg/_generate_pyx.py:674: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
...clip...
libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
libraries mkl_rt not found in ['/Library/Frameworks/Python.framework/Versions/3.10/lib', '/usr/local/lib', '/usr/lib']
NOT AVAILABLE
openblas_lapack_info:
C compiler: clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -arch arm64 -arch x86_64 -g -falign-functions=8
creating /var/folders/4s/pdgwwvsn2wd9192jdyz2lk8w0000gn/T/tmpqd0a75ee/var
creating /var/folders/4s/pdgwwvsn2wd9192jdyz2lk8w0000gn/T/tmpqd0a75ee/var/folders
...clip...
Related
python 3.9
pip 22.3.1
setuptools 66.0.0
wheel 0.38.4
when install yolox, there is always error in installing pycocotools as below:
× Building wheel for pycocotools (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [33 lines of output]
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.9-universal2-cpython-39
creating build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/coco.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/mask.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/init.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
copying pycocotools/cocoeval.py -> build/lib.macosx-10.9-universal2-cpython-39/pycocotools
running build_ext
cythoning pycocotools/_mask.pyx to pycocotools/mask.c
/private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-build-env-kb70uki/overlay/lib/python3.9/site-packages/Cython/Compiler/Main.py:369: FutureWarning: Cython directive 'language_level' not set, using 2 for now (Py2). This will change in a later release! File: /private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-install-zc58cnkb/pycocotools_f63b404805f6427bb06acdd61bfd63a0/pycocotools/mask.pyx
tree = Parsing.p_module(s, pxd, full_module_name)
building 'pycocotools.mask' extension
creating build/temp.macosx-10.9-universal2-cpython-39
creating build/temp.macosx-10.9-universal2-cpython-39/common
creating build/temp.macosx-10.9-universal2-cpython-39/pycocotools
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-build-env-kb70uki/overlay/lib/python3.9/site-packages/numpy/core/include -I./common -I/Users/zhangelaine/env/YOLOX/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c ./common/maskApi.c -o build/temp.macosx-10.9-universal2-cpython-39/./common/maskApi.o -Wno-cpp -Wno-unused-function -std=c99
./common/maskApi.c:151:32: warning: unused variable 'xp' [-Wunused-variable]
uint h, w, xs, ys, xe, ye, xp, cc; siz j, m;
^
1 warning generated.
./common/maskApi.c:151:32: warning: unused variable 'xp' [-Wunused-variable]
uint h, w, xs, ys, xe, ye, xp, cc; siz j, m;
^
1 warning generated.
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -iwithsysroot/System/Library/Frameworks/System.framework/PrivateHeaders -iwithsysroot/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -arch arm64 -arch x86_64 -Werror=implicit-function-declaration -I/private/var/folders/g9/4g2rq3px69lbr64qqpmw5_280000gn/T/pip-build-env-kb70uki/overlay/lib/python3.9/site-packages/numpy/core/include -I./common -I/Users/zhangelaine/env/YOLOX/include -I/Applications/Xcode.app/Contents/Developer/Library/Frameworks/Python3.framework/Versions/3.9/Headers -c pycocotools/_mask.c -o build/temp.macosx-10.9-universal2-cpython-39/pycocotools/_mask.o -Wno-cpp -Wno-unused-function -std=c99
pycocotools/_mask.c:6:10: fatal error: 'Python.h' file not found
#include "Python.h"
^~~~~~~~~~
1 error generated.
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pycocotools
Failed to build pycocotools
ERROR: Could not build wheels for pycocotools, which is required to install pyproject.toml-based projects
so i goto pycocotools website to downlord whl file.
https://pypi.tuna.tsinghua.edu.cn/simple/pycocotools-windows/ and got error as below
ERROR: pycocotools_windows-2.0.0.2-cp37-cp37m-win_amd64.whl is not a supported wheel on this platform.
any suggestion ? thanks a lot
solution : use miniforge to install conda
and install pycocotools with conda in Mac m1. It works, no error anymore
however pip install in conda env is a little bit complicated,
i am tring it.
Here's what I get when I try to install Ruby 2.2:
$ ruby-install ruby 2.2.10
# ...
>>> Compiling ruby 2.2.10 ...
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -I/opt/X11/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/readline/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/gdbm/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin19 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/openssl#1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/gdbm/lib -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie -framework CoreFoundation
SOLIBS = -lgmp
Apple clang version 12.0.0 (clang-1200.0.31.1)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
translating probes probes.d
. ./vm_opts.h
file2lastrev.rb: does not seem to be under a vcs: .
make: [.revision.time] Error 1 (ignored)
./revision.h unchanged
compiling main.c
compiling dmydln.c
compiling miniinit.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
encoding.c:825:2: error: implicit declaration of function 'rb_str_change_terminator_length' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rb_str_change_terminator_length(obj, oldtermlen, termlen);
^
1 error generated.
make: *** [encoding.o] Error 1
!!! Compiling ruby 2.2.10 failed!
OS Version: 10.15.6
ruby-install version: 0.7.1
Any ideas on how to debug or fix this? I was previously able to install other versions of 2.2 before I upgraded my OS. I'm also able to install later versions like Ruby 2.7 with no problem
After a lot of breaking my head and realizing that the error has to do with the compilation using GCC that is native to macOS, I decided to do a test.
Because older versions of Ruby need instructions that are no longer present in updated make, it is necessary to download an older version of Command Line Tools for Xcode.
First, remove your actual version with:
sudo rm -rf /Library/Developer/CommandLineTools
Ignore the error about missing git.
Proceed to https://developer.apple.com/download/more/ and download 11.x version of Command Line Tools for Xcode.
I downloaded version 11.5 and it worked.
My return when running gcc -v
Configured with: --prefix = / Library / Developer / CommandLineTools / usr --with-gxx-include-dir = / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / usr / include / c ++ / 4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: / Library / Developer / CommandLineTools / usr / bin
To compare, with recent Command Lines, 12.x, you'll see something like:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Apparently ignoring the compiler warning is also an option
export optflags="-Wno-error=implicit-function-declaration"
For further duscussion see Problem when installing Ruby 2.2.9 on Mac Big Sur M1
I was able to install that version on Mac 10.15.7 using rvm.
I have openssl#1.1 installed with homebrew. If you run brew info openssl what do you see? I would try brew upgrade openssl first.
Try running
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig" with the info brew returns. Then try rvm install 2.2.10. If that doesn't work I would try rvm install 2.2.10 --with-openssl-dir=/usr/local/opt/openssl --with-openssl-lib=/usr/local/opt/openssl/lib --with-openssl-include=/usr/local/opt/openssl/include just make sure those paths are correct for your system.
You may also need to run
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
beforehand, which will be supplied by brew info.
Adding some extra options here that might help:
We need the right SSL version:
$ brew install rbenv/tap/openssl#1.0
$ rvm install 2.2.10 -C --with-openssl-dir=`brew --prefix openssl#1.0`
First, install open-ssl
brew install rbenv/tap/openssl#1.0
Then
CFLAGS="-Wno-error=implicit-function-declaration" rvm reinstall ruby-2.2.5 --with-openssl-dir='/usr/local/opt/openssl#1.0'
I recently had to install ruby-2.2.0 in Catalina 10.15.7 and was facing the same issues. But luckily managed to get my work done. Steps are as follows:
Installed openssl as a rvm package:
$ rvm pkg install openssl
Ignored compiler warnings:
$ export optflags="-Wno-error=implicit-function-declaration"
Installed required ruby version (2.2.0 in my case) while providing openssl directory parameter and ignoring rubygems:
$ rvm install 2.2.0 --with-openssl-dir=$rvm_path/usr --rubygems ignore
Here's what I get when I try to install Ruby 2.2:
$ ruby-install ruby 2.2.10
# ...
>>> Compiling ruby 2.2.10 ...
CC = clang
LD = ld
LDSHARED = clang -dynamic -bundle
CFLAGS = -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wshorten-64-to-32 -Wimplicit-function-declaration -Wdivision-by-zero -Wdeprecated-declarations -Wextra-tokens -pipe
XCFLAGS = -D_FORTIFY_SOURCE=2 -fstack-protector -fno-strict-overflow -fvisibility=hidden -DRUBY_EXPORT -fPIE
CPPFLAGS = -I/opt/X11/include -I/usr/local/opt/openssl#1.1/include -I/usr/local/opt/readline/include -I/usr/local/opt/libyaml/include -I/usr/local/opt/gdbm/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -I. -I.ext/include/x86_64-darwin19 -I./include -I.
DLDFLAGS = -Wl,-undefined,dynamic_lookup -Wl,-multiply_defined,suppress -L/usr/local/opt/openssl#1.1/lib -L/usr/local/opt/readline/lib -L/usr/local/opt/libyaml/lib -L/usr/local/opt/gdbm/lib -fstack-protector -Wl,-u,_objc_msgSend -Wl,-pie -framework CoreFoundation
SOLIBS = -lgmp
Apple clang version 12.0.0 (clang-1200.0.31.1)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Library/Developer/CommandLineTools/usr/bin
translating probes probes.d
. ./vm_opts.h
file2lastrev.rb: does not seem to be under a vcs: .
make: [.revision.time] Error 1 (ignored)
./revision.h unchanged
compiling main.c
compiling dmydln.c
compiling miniinit.c
compiling miniprelude.c
compiling array.c
compiling bignum.c
compiling class.c
compiling compar.c
compiling complex.c
compiling dir.c
compiling dln_find.c
compiling encoding.c
encoding.c:825:2: error: implicit declaration of function 'rb_str_change_terminator_length' is invalid in C99 [-Werror,-Wimplicit-function-declaration]
rb_str_change_terminator_length(obj, oldtermlen, termlen);
^
1 error generated.
make: *** [encoding.o] Error 1
!!! Compiling ruby 2.2.10 failed!
OS Version: 10.15.6
ruby-install version: 0.7.1
Any ideas on how to debug or fix this? I was previously able to install other versions of 2.2 before I upgraded my OS. I'm also able to install later versions like Ruby 2.7 with no problem
After a lot of breaking my head and realizing that the error has to do with the compilation using GCC that is native to macOS, I decided to do a test.
Because older versions of Ruby need instructions that are no longer present in updated make, it is necessary to download an older version of Command Line Tools for Xcode.
First, remove your actual version with:
sudo rm -rf /Library/Developer/CommandLineTools
Ignore the error about missing git.
Proceed to https://developer.apple.com/download/more/ and download 11.x version of Command Line Tools for Xcode.
I downloaded version 11.5 and it worked.
My return when running gcc -v
Configured with: --prefix = / Library / Developer / CommandLineTools / usr --with-gxx-include-dir = / Library / Developer / CommandLineTools / SDKs / MacOSX.sdk / usr / include / c ++ / 4.2.1
Apple clang version 11.0.3 (clang-1103.0.32.62)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: / Library / Developer / CommandLineTools / usr / bin
To compare, with recent Command Lines, 12.x, you'll see something like:
Configured with: --prefix=/Applications/Xcode.app/Contents/Developer/usr --with-gxx-include-dir=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/c++/4.2.1
Apple clang version 12.0.0 (clang-1200.0.32.2)
Target: x86_64-apple-darwin19.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Apparently ignoring the compiler warning is also an option
export optflags="-Wno-error=implicit-function-declaration"
For further duscussion see Problem when installing Ruby 2.2.9 on Mac Big Sur M1
I was able to install that version on Mac 10.15.7 using rvm.
I have openssl#1.1 installed with homebrew. If you run brew info openssl what do you see? I would try brew upgrade openssl first.
Try running
export PKG_CONFIG_PATH="/usr/local/opt/openssl#1.1/lib/pkgconfig" with the info brew returns. Then try rvm install 2.2.10. If that doesn't work I would try rvm install 2.2.10 --with-openssl-dir=/usr/local/opt/openssl --with-openssl-lib=/usr/local/opt/openssl/lib --with-openssl-include=/usr/local/opt/openssl/include just make sure those paths are correct for your system.
You may also need to run
export LDFLAGS="-L/usr/local/opt/openssl#1.1/lib"
export CPPFLAGS="-I/usr/local/opt/openssl#1.1/include"
beforehand, which will be supplied by brew info.
Adding some extra options here that might help:
We need the right SSL version:
$ brew install rbenv/tap/openssl#1.0
$ rvm install 2.2.10 -C --with-openssl-dir=`brew --prefix openssl#1.0`
First, install open-ssl
brew install rbenv/tap/openssl#1.0
Then
CFLAGS="-Wno-error=implicit-function-declaration" rvm reinstall ruby-2.2.5 --with-openssl-dir='/usr/local/opt/openssl#1.0'
I recently had to install ruby-2.2.0 in Catalina 10.15.7 and was facing the same issues. But luckily managed to get my work done. Steps are as follows:
Installed openssl as a rvm package:
$ rvm pkg install openssl
Ignored compiler warnings:
$ export optflags="-Wno-error=implicit-function-declaration"
Installed required ruby version (2.2.0 in my case) while providing openssl directory parameter and ignoring rubygems:
$ rvm install 2.2.0 --with-openssl-dir=$rvm_path/usr --rubygems ignore
I'm looking to install matplotlib on CentOS using :
yum install python-matplotlib.x86_64
It works but the problem is that it is an old version (matplotlib 0.99.1.1) and I need the last version : [1.3.1].
So I've downloaded the source and trying with : python setup.py install
But I get this error ...
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.3.1]
python: yes [2.6.6 (r266:84292, Jan 22 2014, 09:42:36) [GCC
4.4.7 20120313 (Red Hat 4.4.7-4)]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.1]
dateutil: yes [using dateutil version 1.4.1]
tornado: yes [using tornado version 3.2.2]
pyparsing: yes [using pyparsing version 2.0.2]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
freetype: yes [version 9.22.3]
png: yes [version 1.2.49]
OPTIONAL SUBPACKAGES
sample_data: yes [installing]
toolkits: yes [installing]
tests: yes [nose 0.11.1 or later is required to run the
matplotlib test suite]
OPTIONAL BACKEND EXTENSIONS
macosx: no [Mac OS-X only]
qt4agg: no [PyQt4 not found]
gtk3agg: no [Requires pygobject to be installed.]
gtk3cairo: no [Requires pygobject to be installed.]
Xlib: extension "RANDR" missing on display "localhost:22.0".
gtkagg: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
tkagg: yes [installing, version 73770]
wxagg: no [requires wxPython]
gtk: no [The C/C++ header for gtk (gtk/gtk.h) could not
be found. You may need to install the development
package.]
agg: yes [installing]
cairo: yes [installing, version 1.8.6]
windowing: no [Microsoft Windows only]
OPTIONAL LATEX DEPENDENCIES
dvipng: yes [version 1.11]
ghostscript: yes [version 8.70]
latex: yes [version 3.141592]
pdftops: no
running install
running bdist_egg
running egg_info
writing requirements to lib/matplotlib.egg-info/requires.txt
writing lib/matplotlib.egg-info/PKG-INFO
writing namespace_packages to lib/matplotlib.egg-info/namespace_packages.txt
writing top-level names to lib/matplotlib.egg-info/top_level.txt
writing dependency_links to lib/matplotlib.egg-info/dependency_links.txt
reading manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'lib/matplotlib.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
running build_py
copying lib/matplotlib/mpl-data/matplotlibrc -> build/lib.linux-x86_64-2.6/matplotlib/mpl-data
running build_ext
building 'matplotlib._png' extension
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -DPY_ARRAY_UNIQUE_SYMBOL=MPL_matplotlib__png_ARRAY_API -DPYCXX_ISO_CPP_LIB=1 -I/usr/lib64/python2.6/site-packages/numpy/core/include -I/usr/local/include -I/usr/include -I. -I/usr/include/libpng12 -I/usr/include/python2.6 -c src/_png.cpp -o build/temp.linux-x86_64-2.6/src/_png.o
In file included from /usr/lib64/python2.6/site-packages/numpy/core/include/numpy/ndarraytypes.h:1798,
from /usr/lib64/python2.6/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from /usr/lib64/python2.6/site-packages/numpy/core/include/numpy/arrayobject.h:4,
from src/_png.cpp:28:
/usr/lib64/python2.6/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION"
src/_png.cpp:243:48: error: macro "npy_PyFile_DupClose" requires 3 arguments, but only 2 given
src/_png.cpp:264:44: error: macro "npy_PyFile_DupClose" requires 3 arguments, but only 2 given
src/_png.cpp:577:44: error: macro "npy_PyFile_DupClose" requires 3 arguments, but only 2 given
In file included from src/file_compat.h:4,
from src/_png.cpp:31:
/usr/lib64/python2.6/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘PyObject* npy_PyFile_OpenFile(PyObject*, const char*)’:
/usr/lib64/python2.6/site-packages/numpy/core/include/numpy/npy_3kcompat.h:348: warning: deprecated conversion from string constant to ‘char*’
/usr/lib64/python2.6/site-packages/numpy/core/include/numpy/npy_3kcompat.h: In function ‘int npy_PyFile_CloseFile(PyObject*)’:
/usr/lib64/python2.6/site-packages/numpy/core/include/numpy/npy_3kcompat.h:356: warning: deprecated conversion from string constant to ‘char*’
src/_png.cpp: In member function ‘Py::Object _png_module::write_png(const Py::Tuple&)’:
src/_png.cpp:243: error: ‘npy_PyFile_DupClose’ was not declared in this scope
src/_png.cpp:264: error: ‘npy_PyFile_DupClose’ was not declared in this scope
src/_png.cpp: In member function ‘PyObject* _png_module::_read_png(const Py::Object&, bool, int)’:
src/_png.cpp:329: warning: deprecated conversion from string constant to ‘char*’
src/_png.cpp:577: error: ‘npy_PyFile_DupClose’ was not declared in this scope
error: command 'gcc' failed with exit status 1
Any helps ?
Thanks
This has been fixed in version 1.4.0 (see patch here). I have successfully compiled version 1.4.0 on CentOS 6.5 after patching setupext.py to lower the required freetype version (as suggested in the installation notes).
I can't get Numpy or Scipy to work with Python3 on MAC OSX Lion.
I have used pip successfully to install numpy, scipy and matplotlib, and they work well with Python2.7, but in Python3 typing import numpy brings up No module named numpy. I've tried downloading the source code directly and then running 'python3 setup.py build', but I get various error warnings, some in red that have to do with fortran (e.g. 'Could not locate executable f95'). The error message that appears to fail in the end is 'RuntimeError: Broken toolchain: cannot link a simple C program', and appears to be related to the previous line 'sh: gcc-4.2: command not found'.
The Scipy website suggests that there may be issues with the c compiler, but the same problems didn't arise using pip to install for python2.7. I have followed the instructions on the website regarding changing the compiler but this has not made any difference.
I have also tried installing from a virtual environment:
mkvirtualenv -p python3.2 test1
pip install numpy
But this fails with Command python setup.py egg_info failed with error code 1 in /Users/Eddy/.virtualenvs/test1/build/numpy
I've considered making python3 default, and then I thought a pip install might work, but I don't know how to do that. Does anyone have any suggestions for how I might proceed? Thanks.
I ran into the same issue of
scipy/sparse/linalg/dsolve/superlumodule.c:268:9: error: non-void function 'PyInit_superlu' should return a value [-Wreturn-type]
someone on the scipy mailing list suggested the following:
what happens if you change the line 268 ( in scipy/sparse/linalg/dsolve/_superlumodule.c)
from
return;
to
return NULL;
sure enough it worked
I've made some progress with this problem, with much assistance from Ned Deily on the pythonmac mailing list. I can now build numpy for python3, but scipy still won't build.
To install numpy:
The scipy website (http://www.scipy.org/Installing_SciPy/Mac_OS_X) suggests working around the C compiler problem with three typed commands, but these are insufficient, you need one more:
$ export CC=clang
$ export CXX=clang
$ export FFLAGS=-ff2c
$ export LDSHARED='clang -bundle -undefined dynamic_lookup \
-arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -g'
After this building from source should work. See here for details.
Problem building scipy:
I don't know what the issue here is, something with the C compiler again though I think. Here are the error messages. I'd greatly appreciate any thoughts on this matter.
Thanks, Eddy
error messages:
compiling C sources
C compiler: clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk
compile options: '-DNO_ATLAS_INFO=3 -DUSE_VENDOR_BLAS=1 -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c'
extra options: '-msse3'
clang: scipy/sparse/linalg/dsolve/_superlumodule.c
In file included from scipy/sparse/linalg/dsolve/_superlumodule.c:18:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/arrayobject.h:15:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarraytypes.h:1972:
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API"
^
scipy/sparse/linalg/dsolve/_superlumodule.c:268:9: error: non-void function 'PyInit__superlu' should return a value [-Wreturn-type]
return;
^
1 warning and 1 error generated.
In file included from scipy/sparse/linalg/dsolve/_superlumodule.c:18:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/arrayobject.h:15:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/ndarraytypes.h:1972:
/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API"
^
scipy/sparse/linalg/dsolve/_superlumodule.c:268:9: error: non-void function 'PyInit__superlu' should return a value [-Wreturn-type]
return;
^
1 warning and 1 error generated.
error: Command "clang -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -O3 -isysroot /Developer/SDKs/MacOSX10.6.sdk -arch i386 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.6.sdk -DNO_ATLAS_INFO=3 -DUSE_VENDOR_BLAS=1 -I/Library/Frameworks/Python.framework/Versions/3.2/lib/python3.2/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/3.2/include/python3.2m -c scipy/sparse/linalg/dsolve/_superlumodule.c -o build/temp.macosx-10.6-intel-3.2/scipy/sparse/linalg/dsolve/_superlumodule.o -msse3" failed with exit status 1
I had this problem and one of these sorted it - not sure which one but I include both for completeness:
I had this in my .bash_profile "export CC=gcc-4.2" which was probably some kind of hack from previous OS X compilation problems, I removed it.
Installed the standalone GCC from here https://github.com/kennethreitz/osx-gcc-installer/ over my XCode install
booted up a new terminal window and pip install numpy worked fine