I am ssh-ing a Flask application on OpenShift and one of the Python dependencies is Pandas 0.16.1. Looking through the OpenShift documentation, I created my setup.py file as follows:
from setuptools import setup
setup(name='MyApp',
version='0.1a',
description='some description',
author='me',
author_email='me#gmail.com',
url='http://myapp.com/',
install_requires=['Flask>=0.10.1','numpy>=1.9.2','pandas>=0.16.1'],
)
When creating the app using the requires, the process fails. The following error is produced... help!
The initial build for the application failed: Shell command
'/sbin/runuser -s /bin/sh 557ba9e9e0b8cd360b000131 -c "exec
/usr/bin/runcon 'unconfined_u:system_r:openshift_t:s0:c1,c69' /bin/sh
-c \"gear postreceive --init >> /tmp/initial-build.log 2>&1\""' returned an error. rc=137 .Last 10 kB of build output: Stopping Python
2.7 cartridge Repairing links for 1 deployments Building git ref 'master', commit 239ba5f Activating virtenv Running setup.py script..
running develop running egg_info creating GTFS_Viewer.egg-info writing
requirements to GTFS_Viewer.egg-info/requires.txt writing
GTFS_Viewer.egg-info/PKG-INFO writing top-level names to
GTFS_Viewer.egg-info/top_level.txt writing dependency_links to
GTFS_Viewer.egg-info/dependency_links.txt writing manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' reading manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' writing manifest file
'GTFS_Viewer.egg-info/SOURCES.txt' running build_ext Creating
/var/lib/openshift/557ba9e9e0b8cd360b000131/app-root/runtime/dependencies/python/virtenv/lib/python2.7/site-packages/GTFS-Viewer.egg-link
(link to .) Adding GTFS-Viewer 0.1a to easy-install.pth file Installed
/var/lib/openshift/557ba9e9e0b8cd360b000131/app-root/runtime/repo
Processing dependencies for GTFS-Viewer==0.1a Searching for
pandas>=0.16.1 Reading
http://mirror1.ops.rhcloud.com/mirror/python/web/simple/pandas/ Best
match: pandas 0.16.1 Downloading
mirror1.ops.rhcloud.com/mirror/python/web/packages/source/p/pandas/pandas-0.16.1.zip#md5=d465643d588c4f886b8e796ae56673ad
Processing pandas-0.16.1.zip Writing
/tmp/easy_install-97qgiA/pandas-0.16.1/setup.cfg Running
pandas-0.16.1/setup.py -q bdist_egg --dist-dir
/tmp/easy_install-97qgiA/pandas-0.16.1/egg-dist-tmp-VpNuur warning: no
files found matching 'README.rst' no previously-included directories
found matching 'doc/build' warning: no directories found matching
'examples' warning: no previously-included files matching '*.so' found
anywhere in distribution warning: no previously-included files
matching '*.pyd' found anywhere in distribution warning: no
previously-included files matching '*.pyc' found anywhere in
distribution warning: no previously-included files matching '*~' found
anywhere in distribution warning: no previously-included files
matching '#*' found anywhere in distribution warning: no
previously-included files matching '.git*' found anywhere in
distribution warning: no previously-included files matching
'.DS_Store' found anywhere in distribution warning: no
previously-included files matching '*.png' found anywhere in
distribution In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/index.c:250:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION" pandas/index.c: In function
'__pyx_f_6pandas_5index_11IndexEngine__maybe_get_bool_indexer':
pandas/index.c:4088: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index_13Float64Engine__maybe_get_bool_indexer':
pandas/index.c:7981: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index_11Int64Engine__maybe_get_bool_indexer':
pandas/index.c:7356: warning: '__pyx_v_last_true' may be used
uninitialized in this function pandas/index.c: In function
'__pyx_f_6pandas_5index__bin_search': pandas/index.c:8769: warning:
'__pyx_v_mid' may be used uninitialized in this function In file
included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime.c:18:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/include/python2.7/datetime.h:188: warning:
'PyDateTimeAPI' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime_strings.c:17:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION"
pandas/src/datetime/np_datetime_strings.c: In function
'make_iso_8601_datetime':
pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c: At top level:
pandas/src/datetime/np_datetime_strings.c:127: warning: 'get_gmtime'
defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/period.c:251:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__multiarray_api.h:1594:
warning: '_import_array' defined but not used
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/__ufunc_api.h:236:
warning: '_import_umath' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime.c:18:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION"
/opt/rh/python27/root/usr/include/python2.7/datetime.h:188: warning:
'PyDateTimeAPI' defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/src/datetime/np_datetime_strings.c:17:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION"
pandas/src/datetime/np_datetime_strings.c: In function
'make_iso_8601_datetime':
pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c:1147: warning: format
'%04ld' expects type 'long int', but argument 4 has type 'long long
int' pandas/src/datetime/np_datetime_strings.c: At top level:
pandas/src/datetime/np_datetime_strings.c:127: warning: 'get_gmtime'
defined but not used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from pandas/src/period_helper.h:12, from pandas/src/period_helper.c:1:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION"
pandas/src/period_helper.c:33: warning: 'NULL_AF_INFO' defined but not
used In file included from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1728,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17,
from
/opt/rh/python27/root/usr/lib64/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:15,
from pandas/algos.c:250:
/opt/rh/python27/root/usr/lib64/python2.7/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 NPY_1_7_API_VERSION"
I have had the same problem: Installing pandas through requirements.txt or using pip did not work.
Openshift stops and kills the process when trying to compile algos.c. Here is the manual install workaround that did the trick for me (python3.3 cartridge). It is the result of an somewhat tedious try-and-error process, and I cannot really explain why it works. But you might want to give it a try.
Connect to openshift: rhc ssh <appname>.
Download latest pandas source into the /tmp directory to install manually
cd /tmp
mkdir pandas
cd pandas
wget https://pypi.python.org/packages/source/p/pandas/pandas-0.16.2.zip#md5=860a6c7e5e1a24bb0aa549b115830252
unzip pandas-0.16.2.zip
cd pandas-0.16.2
Edit the setup.py file using your favourite (available) editor, e.g. emacs and search for "algos". The second time it appears comment out the algos package in the variable ext_data:
...
index={'pyxfile': 'index',
'sources': ['pandas/src/datetime/np_datetime.c',
'pandas/src/datetime/np_datetime_strings.c']},
# algos={'pyxfile': 'algos',
# 'depends': [srcpath('generated', suffix='.pyx'),
# srcpath('join', suffix='.pyx')]},
parser={'pyxfile': 'parser',
'depends': ['pandas/src/parser/tokenizer.h',
'pandas/src/parser/io.h',
'pandas/src/numpy_helper.h'],
...
Run the first part of the installation procedure:
./setup.py install
Now, let us compile the missing algos piece by hand. To do so, remove the comments you made in step 2, and comment out all other entries (except the algos entry) in ext_data.
Run setup in "dry-run" mode to see the two gcccommands you need to compile algos
./setup.py -n build
Copy the first gcc command to run it from shell. When I tried this, this command made openshift shut down the connection. So, I adjusted it by removing doublicate options and remove the -O2 flag (i.e., the optimization). This worked for me:
gcc -pthread -DDYNAMIC_ANNOTATIONS_ENABLED=1 -DNDEBUG -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -I/opt/rh/python33/root/usr/include -Ipandas/src/klib -Ipandas/src -I/opt/rh/python33/root/usr/lib64/python3.3/site-packages/numpy/core/include -I$OPENSHIFT_HOMEDIR/python/virtenv/venv/include -I/opt/rh/python33/root/usr/include/python3.3m -c pandas/algos.c -o build/temp.linux-x86_64-3.3/pandas/algos.o
The second command can be run unchanged. For me it was:
gcc -pthread -shared -L/opt/rh/python33/root/usr/lib64 -L/usr/lib6464 build/temp.linux-x86_64-3.3/pandas/algos.o -L/opt/rh/python33/root/usr/lib64 -lpython3.3m -o build/lib.linux-x86_64-3.3/pandas/algos.cpython-33m.so
Now, the hand-made files need to be installed:
./setup.py install
Quick check if it worked for you. First cd to your home directory, then try python:
cd
python
Python 3.3.2 (default, Mar 20 2014, 20:25:51)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Delete the /tmp/pandas directory.
rm -rf /tmp/pandas
Hope this works for you, too!
Can you do that manually ? i.e :
ssh 12hh3456789hh01011#nameofapp-username.rhcloud.com
And activate the environment :
source app-root/runtime/dependencies/python/virtenv/bin/activate
And then install the dependencies. First Numpy
pip install -U numpy
And then Pandas:
pip install pandas
Restart Openshift Application from web console and commit the changes and deploy. it worked for me!
Related
The scikit-build distribution provides usage examples of FindF2PY and UseF2PY, but they are incomplete, only providing a partial CMakeLists.txt file without the other required files. Based on the documentation I have not been able to make something that builds.
Following the examples in the scikit-build documentation, I created the following files:
CMakeLists.txt:
cmake_minimum_required(VERSION 3.10.2)
project(skbuild_test)
enable_language(Fortran)
find_package(F2PY REQUIRED)
add_f2py_target(f2py_test f2py_test.f90)
add_library(f2py_test MODULE f2py_test.f90)
install(TARGETS f2py_test LIBRARY DESTINATION f2py_test)
setup.py:
import setuptools
from skbuild import setup
requires=['numpy']
setup(
name="skbuild-test",
version='0.0.1',
description='Performs line integrals through SAMI3 grids',
author='John Haiducek',
requires=requires,
packages=['f2py_test']
)
f2py_test.f90:
module mod_f2py_test
implicit none
contains
subroutine f2py_test(a,b,c)
real(kind=8), intent(in)::a,b
real(kind=8), intent(out)::c
end subroutine f2py_test
end module mod_f2py_test
In addition, I created a directory f2py_test containing an empty init.py.
The output from python setup.py develop shows that scikit-build invokes CMake and compiles my Fortran code. However, it fails to find Python.h while compiling the f2py wrapper code:
[2/7] Building C object CMakeFiles/_f2...kages/numpy/f2py/src/fortranobject.c.o
FAILED: CMakeFiles/_f2py_runtime_library.dir/venv/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c.o
/Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -O3 -DNDEBUG -arch x86_64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.15.sdk -mmacosx-version-min=10.14 -MD -MT CMakeFiles/_f2py_runtime_library.dir/venv/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c.o -MF CMakeFiles/_f2py_runtime_library.dir/venv/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c.o.d -o CMakeFiles/_f2py_runtime_library.dir/venv/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c.o -c ../../../venv/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c
In file included from ../../../venv/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.c:2:
../../../venv/lib/python3.8/site-packages/numpy/f2py/src/fortranobject.h:7:10: fatal error: 'Python.h' file not found
#include "Python.h"
^~~~~~~~~~
1 error generated.
First caveat, there may be a better way to do this, as I just figured out how to make scikit-build work by stumbling on your post and looking at documentation. Second caveat, I'm also learning cmake. So, there may be a better way.
There are a couple of things that you'll need to make your example here work. The big one is the second argument of add_f2py_target() isn't the source file. It is either the name of a pre-generated *.pyf, or to let f2py generate one, provide it an argument without the *.pyf extension. The other is adding the include directories for various components.
I made your example work with the following CMakeLists.txt:
cmake_minimum_required(VERSION 3.10.2)
project(skbuild_test)
enable_language(Fortran)
find_package(F2PY REQUIRED)
find_package(PythonLibs REQUIRED)
find_package(Python3 REQUIRED COMPONENTS NumPy)
#the following command either generates or points to an existing .pyf
#if provided an argument with .pyf extension, otherwise f2py generates one (not source code).
add_f2py_target(f2py_test f2py_test)
add_library(f2py_test MODULE f2py_test.f90)
include_directories(${PYTHON_INCLUDE_DIRS})
include_directories(${_Python3_NumPy_INCLUDE_DIR})
target_link_libraries(f2py_test ${PYTHON_LIBRARIES})
install(TARGETS f2py_test LIBRARY DESTINATION f2py_test)
I am currently trying to install the "pyobjc" module in Python 2.7 on Lion OSX 10.7.5 with Xcode 4.6.3. The module I actually want to install eventually is Quartz. I have tried various methods of installation including easy_install, pip install, and python setup.py install all resulting in similar error messages as seen below:
1) easy_install
$ easy_install -U pyobjc
Searching for pyobjc
Reading https://pypi.python.org/simple/pyobjc/
Best match: pyobjc 3.0.4
Processing pyobjc-3.0.4-py2.7.egg
pyobjc 3.0.4 is already the active version in easy-install.pth
Using /Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/pyobjc-3.0.4-py2.7.egg
Processing dependencies for pyobjc
Searching for pyobjc-framework-StoreKit==3.0.4
Reading https://pypi.python.org/simple/pyobjc-framework-StoreKit/
Best match: pyobjc-framework-StoreKit 3.0.4
Downloading https://pypi.python.org/packages/source/p/pyobjc-framework-StoreKit/pyobjc-framework-StoreKit-3.0.4.tar.gz#md5=734893300a3aa40153b8fce93e006812
Processing pyobjc-framework-StoreKit-3.0.4.tar.gz
Writing /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-u2q6Sz/pyobjc-framework-StoreKit-3.0.4/setup.cfg
Running pyobjc-framework-StoreKit-3.0.4/setup.py -q bdist_egg --dist-dir /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-u2q6Sz/pyobjc-framework-StoreKit-3.0.4/egg-dist-tmp-7fnscr
warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
warning: no previously-included files matching '*.dSYM' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
Modules/objc/objc-runtime-compat.m:885:17: error: cannot find interface
declaration for 'Object'; did you mean 'NSObject'?
#implementation Object (NSObjectCompat)
^~~~~~
NSObject
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:12: note:
'NSObject' declared here
#interface NSObject <NSObject> {
^
Modules/objc/objc-runtime-compat.m:891:1: warning: method has no return type
specified; defaults to 'id' [-Wmissing-method-return-type]
-doesNotRecognizeSelector:(SEL)sel
^
(id)
Modules/objc/objc-runtime-compat.m:886:1: warning: category is implementing a
method which will also be implemented by its primary class
[-Wobjc-protocol-method-implementation]
- (id)self
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:20:1: note:
method 'self' declared here
- (id)self;
^
2 warnings and 1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
2) $ env CC=clang easy_install -U pyobjc-core
$ env CC=clang easy_install -U pyobjc-core
Searching for pyobjc-core
Reading https://pypi.python.org/simple/pyobjc-core/
Best match: pyobjc-core 3.0.4
Downloading https://pypi.python.org/packages/source/p/pyobjc-core/pyobjc-core-3.0.4.tar.gz#md5=6baaa0d2533cc9c26ad9f889ca9ecb01
Processing pyobjc-core-3.0.4.tar.gz
Writing /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-5hi4rp/pyobjc-core-3.0.4/setup.cfg
Running pyobjc-core-3.0.4/setup.py -q bdist_egg --dist-dir /var/folders/1s/520_dbbj7r9fhx093c93_jf80000gn/T/easy_install-5hi4rp/pyobjc-core-3.0.4/egg-dist-tmp-FUyEFV
warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
warning: no previously-included files matching '*.dSYM' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
Modules/objc/objc-runtime-compat.m:885:17: error: cannot find interface
declaration for 'Object'; did you mean 'NSObject'?
#implementation Object (NSObjectCompat)
^~~~~~
NSObject
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:12: note:
'NSObject' declared here
#interface NSObject <NSObject> {
^
Modules/objc/objc-runtime-compat.m:891:1: warning: method has no return type
specified; defaults to 'id' [-Wmissing-method-return-type]
-doesNotRecognizeSelector:(SEL)sel
^
(id)
Modules/objc/objc-runtime-compat.m:886:1: warning: category is implementing a
method which will also be implemented by its primary class
[-Wobjc-protocol-method-implementation]
- (id)self
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:20:1: note:
method 'self' declared here
- (id)self;
^
2 warnings and 1 error generated.
error: Setup script exited with error: command 'clang' failed with exit status 1
3) after navigation to quartz directory...
$ python setup.py install
newusers-MacBook:pyobjc-framework-quartz-3.0.4 newuser$ python setup.py install
warning: no directories found matching 'Scripts'
warning: no directories found matching 'setup-lib'
warning: no directories found matching 'source-deps'
warning: no previously-included files matching '.DS_Store' found anywhere in distribution
warning: no previously-included files matching '*.pyc' found anywhere in distribution
warning: no previously-included files matching '*.pyo' found anywhere in distribution
warning: no previously-included files matching '*.so' found anywhere in distribution
warning: no previously-included files matching '*.dSYM/*' found anywhere in distribution
warning: no previously-included files matching '*.dSYM' found anywhere in distribution
warning: no previously-included files matching '__pycache__' found anywhere in distribution
Modules/objc/objc-runtime-compat.m:885:17: error: cannot find interface
declaration for 'Object'; did you mean 'NSObject'?
#implementation Object (NSObjectCompat)
^~~~~~
NSObject
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:12: note:
'NSObject' declared here
#interface NSObject <NSObject> {
^
Modules/objc/objc-runtime-compat.m:891:1: warning: method has no return type
specified; defaults to 'id' [-Wmissing-method-return-type]
-doesNotRecognizeSelector:(SEL)sel
^
(id)
Modules/objc/objc-runtime-compat.m:886:1: warning: category is implementing a
method which will also be implemented by its primary class
[-Wobjc-protocol-method-implementation]
- (id)self
^
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:20:1: note:
method 'self' declared here
- (id)self;
^
2 warnings and 1 error generated.
Traceback (most recent call last):
File "setup.py", line 81, in <module>
[ 'Modules/_coregraphics.m' ], extra_link_args=["-framework", "ApplicationServices"]),
File "/Users/newuser/Downloads/pyobjc-framework-Quartz-3.0.4/pyobjc_setup.py", line 460, in setup
**k
File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
_setup_distribution = dist = klass(attrs)
File "build/bdist.macosx-10.6-intel/egg/setuptools/dist.py", line 268, in __init__
File "build/bdist.macosx-10.6-intel/egg/setuptools/dist.py", line 313, in fetch_build_eggs
File "build/bdist.macosx-10.6-intel/egg/pkg_resources/__init__.py", line 836, in resolve
File "build/bdist.macosx-10.6-intel/egg/pkg_resources/__init__.py", line 1081, in best_match
File "build/bdist.macosx-10.6-intel/egg/pkg_resources/__init__.py", line 1093, in obtain
File "build/bdist.macosx-10.6-intel/egg/setuptools/dist.py", line 380, in fetch_build_egg
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 629, in easy_install
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 659, in install_item
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 842, in install_eggs
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 1070, in build_and_install
File "build/bdist.macosx-10.6-intel/egg/setuptools/command/easy_install.py", line 1058, in run_setup
distutils.errors.DistutilsError: Setup script exited with error: command 'clang' failed with exit status 1
newusers-MacBook:pyobjc-framework-quartz-3.0.4 newuser$
I'm having problem while installing matplotlib. I'm using Mavericks and it complains about a deprecated NumPy API both installing via pip and installing from source (following the instructions here https://github.com/matplotlib/matplotlib/blob/master/README.osx):
In file included from src/_macosx.m:1:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Cocoa.framework/Headers/Cocoa.h:12:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/Foundation.h:10:
In file included from /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSArray.h:5:
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.8.sdk/System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:76:1: error:
duplicate interface definition for class 'NSObject'
#interface NSObject <NSObject> {
^
/usr/include/objc/NSObject.h:50:12: note: previous definition is here
#interface NSObject <NSObject> {
^
In file included from src/_macosx.m:5:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/arrayobject.h:4:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/ndarrayobject.h:17:
In file included from /Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/ndarraytypes.h:1761:
/Users/se7entyse7en/Envs/datascience/lib/python2.7/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning:
"Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API
NPY_1_7_API_VERSION" [-W#warnings]
#warning "Using deprecated NumPy API, disable it by " \
^
1 warning and 1 error generated.
error: command 'clang' failed with exit status 1
After that it exists without having completed the installation. I have already installed both libpng and freetype using brew, and I also already have installed both NumPy and SciPy via pip:
numpy==1.8.2
scipy==0.14.0
Ok, I solved the issue also thanks to flebool. In the folder
/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs
I had both MacOSX10.9.sdk and MacOSX10.8.sdk and I didn't know if they should exists both. I had Mavericks so I thought that maybe MacOSX10.8.sdk could be the problem. I deleted it and I managed to install matplotlib from source succesfully.
Trying to create a python package. Seems to work, but i get a warning.
my setup.py is:
#! /usr/bin/env python
from distutils.core import setup
setup(
name='myPKG',
version='0.02.01',
url='http://someURL.02.01',
packages=['scripts',
'statistics'],
author = 'Research-Team',
author_email = 'me#gmail.com',
description='This is my package',
scripts=['scripts/myScript.py'],
entry_points={'console_scripts' : ['myCommandlineName = scripts.myScript:testRequireDecorator']},
install_requires=['numpy >= 1.5.1', 'scipy >= 0.9.0', 'poster']
)
I get the following warnings. why, specifically, the two first user warning?
root#TK: python setup.py sdist
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'entry_points'
warnings.warn(msg)
/usr/lib/python2.7/distutils/dist.py:267: UserWarning: Unknown distribution option: 'install_requires'
warnings.warn(msg)
running sdist
running check
package init file 'scripts/__init__.py' not found (or not a regular file)
reading manifest template 'MANIFEST.in'
no previously-included directories found matching '.git'
warning: no previously-included files matching '*.pyc' found under directory '.'
writing manifest file 'MANIFEST'
creating myPKG-0.02.01
creating myPKG-0.02.01/scripts
creating myPKG-0.02.01/statistics
making hard links in myPKG-0.02.01...
hard linking README -> myPKG-0.02.01
hard linking setup.py -> myPKG-0.02.01
hard linking scripts/myScript.py -> myPKG-0.02.01/scripts
hard linking statistics/RunningMedian.py -> myPKG-0.02.01/statistics
hard linking statistics/RunningStdev.py -> myPKG-0.02.01/statistics
hard linking statistics/__init__.py -> myPKG-0.02.01/statistics
Creating tar archive
removing 'myPKG-0.02.01' (and everything under it)
You're using distutils, but you need at least setuptools in order to use those options.
from setuptools import setup
I'm having some trouble installing psyco on my Macbook pro running Snow Leopard with python 2.6.1.
I've been trying to force python to run in 32-bit mode using the command
defaults write com.apple.versioner.python Prefer-32-Bit -bool yes
Further, I have tried the Macport py26-psyco, which seems to finish but the module cannot be found when compiling.
$ sudo python setup.py install
PROCESSOR = 'ivm'
running install
running build
running build_py
running build_ext
building 'psyco._psyco' extension
gcc-4.2 -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -DENABLE_DTRACE -arch i386 -arch ppc -arch x86_64 -pipe -DALL_STATIC=1 -Ic/ivm -I/System/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c c/psyco.c -o build/temp.macosx-10.6-universal-2.6/c/psyco.o
In file included from c/initialize.h:48,
from c/psyco.c:14:
c/psyfunc.c: In function ‘psycofunction_call’:
c/psyfunc.c:801: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:49,
from c/psyco.c:14:
c/stats.c: In function ‘psyco_stats_reset’:
c/stats.c:260: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_dump’:
c/stats.c:298: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_top’:
c/stats.c:326: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:75,
from c/psyco.c:14:
c/Objects/pstructmember.c: In function ‘PsycoMember_GetOne’:
c/Objects/pstructmember.c:16: warning: unused variable ‘w2’
c/psyco.c: At top level:
c/codegen.c:748: warning: ‘integer_lshift’ defined but not used
c/ivm/prolog/insns-igen.i:175: warning: ‘psyco_insn_assertdepth’ defined but not used
c/ivm/prolog/insns-igen.i:197: warning: ‘psyco_insn_dynamicfreq’ defined but not used
c/codegen.c:66: warning: ‘cc_from_vsource’ defined but not used
c/Objects/plongobject.c:20: warning: ‘PsycoLong_AsDouble’ defined but not used
c/Objects/plistobject.c:116: warning: ‘PsycoList_SingletonNew’ defined but not used
c/codegen.c: In function ‘psyco_generic_call’:
c/codegen.c:423: warning: ‘_arg’ may be used uninitialized in this function
/usr/libexec/gcc/powerpc-apple-darwin10/4.2.1/as: assembler (/usr/bin/../libexec/gcc/darwin/ppc/as or /usr/bin/../local/libexec/gcc/darwin/ppc/as) for architecture ppc not installed
Installed assemblers are:
/usr/bin/../libexec/gcc/darwin/x86_64/as for architecture x86_64
/usr/bin/../libexec/gcc/darwin/i386/as for architecture i386
In file included from c/initialize.h:48,
from c/psyco.c:14:
c/psyfunc.c: In function ‘psycofunction_call’:
c/psyfunc.c:801: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:49,
from c/psyco.c:14:
c/stats.c: In function ‘psyco_stats_reset’:
c/stats.c:260: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_dump’:
c/stats.c:298: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_top’:
c/stats.c:326: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:75,
from c/psyco.c:14:
c/Objects/pstructmember.c: In function ‘PsycoMember_GetOne’:
c/Objects/pstructmember.c:16: warning: unused variable ‘w2’
c/psyco.c: At top level:
c/codegen.c:748: warning: ‘integer_lshift’ defined but not used
c/ivm/prolog/insns-igen.i:175: warning: ‘psyco_insn_assertdepth’ defined but not used
c/ivm/prolog/insns-igen.i:197: warning: ‘psyco_insn_dynamicfreq’ defined but not used
c/codegen.c:66: warning: ‘cc_from_vsource’ defined but not used
c/Objects/plongobject.c:20: warning: ‘PsycoLong_AsDouble’ defined but not used
c/Objects/plistobject.c:116: warning: ‘PsycoList_SingletonNew’ defined but not used
c/codegen.c: In function ‘psyco_generic_call’:
c/codegen.c:423: warning: ‘_arg’ may be used uninitialized in this function
c/psyco.c: At top level:
c/psyco.c:1064: fatal error: error writing to -: Broken pipe
compilation terminated.
In file included from c/psyco.c:1:
c/psyco.h:13:3: error: #error "64-bit systems not supported at all. See help on psyco.sf.net"
In file included from c/dispatcher.h:10,
from c/codemanager.h:10,
from c/psyco.c:3:
c/vcompiler.h: In function ‘PsycoObject_New’:
c/vcompiler.h:743: warning: comparison is always false due to limited range of data type
c/vcompiler.h: In function ‘PsycoObject_Resize’:
c/vcompiler.h:757: warning: comparison is always false due to limited range of data type
In file included from c/dispatcher.h:12,
from c/codemanager.h:10,
from c/psyco.c:3:
c/codegen.h:15:3: error: #error "-----------------------------------------------------"
c/codegen.h:16:3: error: #error "Sorry, non-32-bit platforms are not supported at all."
c/codegen.h:17:3: error: #error "You may try with a Python compiled in 32-bit "
c/codegen.h:18:3: error: #error "compatibility mode. Note that Psyco will probably "
c/codegen.h:19:3: error: #error "never support non-32-bit platforms, as it is no "
c/codegen.h:20:3: error: #error "longer actively developed. Instead, the PyPy group "
c/codegen.h:21:3: error: #error "plans to replace it with a more flexible and easily "
c/codegen.h:22:3: error: #error "retargettable Psyco-for-PyPy during the year 2006. "
c/codegen.h:23:3: error: #error "See http://codespeak.net/pypy/ "
c/codegen.h:24:3: error: #error "-----------------------------------------------------"
In file included from c/ivm/iinitialize.h:12,
from c/initialize.h:42,
from c/psyco.c:14:
c/ivm/idispatcher.c: In function ‘psyco_unify’:
c/ivm/idispatcher.c:202: warning: comparison is always false due to limited range of data type
In file included from c/initialize.h:46,
from c/psyco.c:14:
c/dispatcher.c: In function ‘fz_internal_copy’:
c/dispatcher.c:131: warning: comparison is always false due to limited range of data type
c/dispatcher.c: In function ‘fz_compress’:
c/dispatcher.c:233: warning: cast from pointer to integer of different size
c/dispatcher.c:239: warning: cast to pointer from integer of different size
In file included from c/initialize.h:48,
from c/psyco.c:14:
c/psyfunc.c: In function ‘psycofunction_call’:
c/psyfunc.c:801: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:49,
from c/psyco.c:14:
c/stats.c: In function ‘psyco_stats_reset’:
c/stats.c:260: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_dump’:
c/stats.c:298: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
c/stats.c: In function ‘psyco_stats_top’:
c/stats.c:326: warning: passing argument 2 of ‘PyDict_Next’ from incompatible pointer type
In file included from c/initialize.h:53,
from c/psyco.c:14:
c/codemanager.c: In function ‘psyco_shrink_code_buffer’:
c/codemanager.c:235: warning: format ‘%d’ expects type ‘int’, but argument 3 has type ‘long int’
In file included from c/initialize.h:60,
from c/psyco.c:14:
c/Objects/pobject.c: In function ‘getdictoffset’:
c/Objects/pobject.c:257: error: ‘SIZE_OF_LONG_BITS’ undeclared (first use in this function)
c/Objects/pobject.c:257: error: (Each undeclared identifier is reported only once
c/Objects/pobject.c:257: error: for each function it appears in.)
In file included from c/initialize.h:61,
from c/psyco.c:14:
c/Objects/pabstract.c:723:3: error: #error "omitted code from Python 2.3 here"
In file included from c/initialize.h:75,
from c/psyco.c:14:
c/Objects/pstructmember.c: In function ‘PsycoMember_GetOne’:
c/Objects/pstructmember.c:16: warning: unused variable ‘w2’
lipo: can't open input file: /var/tmp//ccjHgyCU.out (No such file or directory)
error: command 'gcc-4.2' failed with exit status
Try doing this before compiling:
export ARCHFLAGS="-arch i386"
then in the setup.py
replace
extra_link_args = [ ]
with
extra_link_args = [ '-L/Developer/SDKs/MacOSX10.6.sdk/usr/lib' ]
then just run:
python setup.py install
Hope this helps!
I ran into the same problem on my MacBook Pro using OS X 10.7.
I was able to compile it using "sudo python2.5 setup.py install"
Not it work's like charm. Hope this might help someone else.
I don't have an answer to your question, but as an alternative, did you try installing from the source, as detailed here and here?
Furthermore, you can force 32bit python as well by invoking the command python2.6-32 in the terminal, which may be a bit more convenient for testing purposes.
Why compile things on your own when there is an easy way out?
Install ActivePython 2.6 for Mac
Open Terminal and type pypm install psyco