Skip to content

Build error on OS X 10.7: tseries #77

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

Closed
fonnesbeck opened this issue Jul 21, 2011 · 35 comments
Closed

Build error on OS X 10.7: tseries #77

fonnesbeck opened this issue Jul 21, 2011 · 35 comments
Labels
Build Library building on various platforms

Comments

@fonnesbeck
Copy link

I'm trying to build pandas on OSX 10.7, but run into an error building tseries:

building 'pandas._tseries' extension
C compiler: llvm-gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -arch x86_64 -pipe

creating build/temp.macosx-10.7-x86_64-2.7
creating build/temp.macosx-10.7-x86_64-2.7/pandas
creating build/temp.macosx-10.7-x86_64-2.7/pandas/src
compile options: '-I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
llvm-gcc-4.2: pandas/src/tseries.c
i686-apple-darwin11-llvm-gcc-4.2: pandas/src/tseries.c: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: no input files
i686-apple-darwin11-llvm-gcc-4.2: pandas/src/tseries.c: No such file or directory
i686-apple-darwin11-llvm-gcc-4.2: no input files
error: Command "llvm-gcc-4.2 -DNDEBUG -g -fwrapv -Os -Wall -Wstrict-prototypes -arch x86_64 -pipe -I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c pandas/src/tseries.c -o build/temp.macosx-10.7-x86_64-2.7/pandas/src/tseries.o" failed with exit status 1

I did not get this on Snow Leopard. Running Python 2.7.1 with a current, working numpy 2.0.

@wesm
Copy link
Member

wesm commented Jul 21, 2011

You're building from head right? Do you have Cython installed? I looks like when it fails to cythonize the pyx files it should be printing an error message but it's not, should try to fix that

@fonnesbeck
Copy link
Author

I have cython installed from pypi, so it may be incompatible with Lion. I am trying to build cython from github now to see if that will fix things.

I am building from your master branch, yes.

@wesm
Copy link
Member

wesm commented Jul 21, 2011

See if you can get

cython pandas/src/tseries.pyx
cython pandas/src/sparse.pyx

to work. If so then I need to figure out what's wrong with the setup.py (sigh, the disaster of distutils and python packaging)

@fonnesbeck
Copy link
Author

OK, that worked, but subsequent building caused the following:

compile options: '-I/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include -I/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7 -c'
llvm-gcc-4.2: pandas/src/sparse.c
In file included from /Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/ndarraytypes.h:1523,
from /Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/ndarrayobject.h:17,
from /Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/arrayobject.h:14,
from pandas/src/sparse.c:237:
/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API"
/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/__multiarray_api.h:1543: warning: ‘_import_array’ defined but not used
/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used
In file included from /Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/ndarraytypes.h:1523,
from /Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/ndarrayobject.h:17,
from /Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/arrayobject.h:14,
from pandas/src/sparse.c:237:
/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/npy_deprecated_api.h:11:2: warning: #warning "Using deprecated NumPy API, disable it by #defining NPY_NO_DEPRECATED_API"
/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/__multiarray_api.h:1543: warning: ‘_import_array’ defined but not used
/Library/Python/2.7/site-packages/numpy-2.0.0.dev_e2af7b7_20110721-py2.7-macosx-10.7-intel.egg/numpy/core/include/numpy/__ufunc_api.h:242: warning: ‘_import_umath’ defined but not used
llvm-gcc-4.2 -Wl,-F. -bundle -undefined dynamic_lookup -Wl,-F. -arch i386 -arch x86_64 build/temp.macosx-10.7-intel-2.7/pandas/src/sparse.o -o build/lib.macosx-10.7-intel-2.7/pandas/_sparse.so

Are there any unwanted build flags in there?

@fonnesbeck
Copy link
Author

Aha! Restricting the build to 64-bit seems to do the trick. I can build successfully by restricting the LDFLAGS and ARCHFLAGS to -arch x86_64.

@fonnesbeck
Copy link
Author

Spoke too soon:

In [1]: import pandas
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
/Users/fonnescj/<ipython-input-1-d6ac987968b6> in <module>()
----> 1 import pandas

/Library/Python/2.7/site-packages/pandas/__init__.py in <module>()
     10 from pandas.info import __doc__
     11 
---> 12 from pandas.core.api import *
     13 from pandas.core.common import set_printoptions
     14 from pandas.io.parsers import read_csv, read_table, ExcelFile

/Library/Python/2.7/site-packages/pandas/core/api.py in <module>()
      6 import pandas.core.datetools as datetools
      7 
----> 8 from pandas.core.common import isnull, notnull
      9 from pandas.core.index import Index
     10 from pandas.core.daterange import DateRange

/Library/Python/2.7/site-packages/pandas/core/common.py in <module>()
      9 import numpy as np
     10 
---> 11 import pandas._tseries as _tseries
     12 
     13 # XXX: HACK for NumPy 1.5.1 to suppress warnings


ImportError: dynamic module does not define init function (init_tseries)

@wesm
Copy link
Member

wesm commented Jul 21, 2011

Ouch. May have to wait for the Cython folks to test on 10.7.

@fonnesbeck
Copy link
Author

I guess so. I have not been able to build SciPy either, so the problems are not confined to cython.

@keflavich
Copy link

I have the exact same issue reported at the top, but on 10.6 Snow Leopard. I'm using the 64 bit version of the OS.
As fonnesbeck reported, I succeeded in getting the module to install using the cython commands, but then ran into the same import error:
ImportError: dynamic module does not define init function (init_tseries)

I've tried the installs with both python2.6 and 2.7. I'm running numpy 1.4 on python2.6 and 2.0 on python2.7, and the errors are identical.

@wesm
Copy link
Member

wesm commented Jul 22, 2011

@keflavich what version of Cython

@keflavich
Copy link

python2.7: 0.14.1
python2.6: 0.12.1

I installed with easy_install on both. Those are also based on the presence of eggs in my site-packages directories; cython doesn't seem to have a version attribute

@wesm
Copy link
Member

wesm commented Jul 22, 2011

can you post the exact output of running

python setup.py clean
python setup.py build_ext --inplace

@keflavich
Copy link

$ python setup.py build_ext --inplace
running build_ext
building 'pandas._tseries' extension
C compiler: gcc -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

creating build
creating build/temp.macosx-10.6-x86_64-2.6
creating build/temp.macosx-10.6-x86_64-2.6/pandas
creating build/temp.macosx-10.6-x86_64-2.6/pandas/src
compile options: '-I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c'
gcc: pandas/src/tseries.c
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include/numpy/__ufunc_api.h:197: warning: '_import_umath' defined but not used
pandas/src/tseries.c:1507: warning: '__pyx_f_7tseries_get_int16_ptr' defined but not used
pandas/src/tseries.c:1548: warning: '__pyx_f_7tseries_get_int32_ptr' defined but not used
pandas/src/tseries.c:1589: warning: '__pyx_f_7tseries_get_int64_ptr' defined but not used
pandas/src/tseries.c:1630: warning: '__pyx_f_7tseries_get_double_ptr' defined but not used
gcc -bundle -undefined dynamic_lookup build/temp.macosx-10.6-x86_64-2.6/pandas/src/tseries.o -o /Users/adam/repos/pandas/pandas/_tseries.so
building 'pandas._sparse' extension
C compiler: gcc -fno-strict-aliasing -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes

compile options: '-I/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include -I/Library/Frameworks/Python.framework/Versions/2.6/include/python2.6 -c'
gcc: pandas/src/sparse.c
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include/numpy/__multiarray_api.h:1188: warning: '_import_array' defined but not used
/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/numpy/core/include/numpy/__ufunc_api.h:197: warning: '_import_umath' defined but not used
pandas/src/sparse.c: In function '__pyx_pf_6sparse_12reindex_block':
pandas/src/sparse.c:15436: warning: '__pyx_v_length' is used uninitialized in this function
gcc -bundle -undefined dynamic_lookup build/temp.macosx-10.6-x86_64-2.6/pandas/src/sparse.o -o /Users/adam/repos/pandas/pandas/_sparse.so

@wesm
Copy link
Member

wesm commented Jul 22, 2011

here's what mine looks like from a fresh git clone (I'm using EPD 7.0):

12:35 ~/code/fresh-pandas  (master)$ python setup.py build_ext --inplace
running build_ext
cythoning pandas/src/tseries.pyx to pandas/src/tseries.c
building 'pandas._tseries' extension
C compiler: gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -O3 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Library/Frameworks/EPD64.framework/Versions/7.0/include

creating build
creating build/temp.macosx-10.5-x86_64-2.7
creating build/temp.macosx-10.5-x86_64-2.7/pandas
creating build/temp.macosx-10.5-x86_64-2.7/pandas/src
compile options: '-I/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/EPD64.framework/Versions/7.0/include/python2.7 -c'
gcc: pandas/src/tseries.c
gcc -g -arch x86_64 -L/usr/local/lib -L/Library/Frameworks/EPD64.framework/Versions/7.0/lib -bundle -undefined dynamic_lookup -g -arch x86_64 -L/usr/local/lib -L/Library/Frameworks/EPD64.framework/Versions/7.0/lib -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/pandas/src/tseries.o -o /Users/wesm/code/fresh-pandas/pandas/_tseries.so
cythoning pandas/src/sparse.pyx to pandas/src/sparse.c
building 'pandas._sparse' extension
C compiler: gcc -fno-strict-aliasing -fno-common -dynamic -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -DNDEBUG -g -O3 -arch x86_64 -isysroot /Developer/SDKs/MacOSX10.5.sdk -I/Library/Frameworks/EPD64.framework/Versions/7.0/include

compile options: '-I/Library/Frameworks/EPD64.framework/Versions/7.0/lib/python2.7/site-packages/numpy/core/include -I/Library/Frameworks/EPD64.framework/Versions/7.0/include/python2.7 -c'
gcc: pandas/src/sparse.c
gcc -g -arch x86_64 -L/usr/local/lib -L/Library/Frameworks/EPD64.framework/Versions/7.0/lib -bundle -undefined dynamic_lookup -g -arch x86_64 -L/usr/local/lib -L/Library/Frameworks/EPD64.framework/Versions/7.0/lib -arch x86_64 build/temp.macosx-10.5-x86_64-2.7/pandas/src/sparse.o -o /Users/wesm/code/fresh-pandas/pandas/_sparse.so    

how did you install NumPy? I really don't know what to tell you guys (@fonnesbeck can you make sense of any of that?) -- this looks like some kind of distutils / Cython problem and is likely worth asking the Cython guys. I don't know enough about such matters to debug this

@keflavich
Copy link

Maybe EPD is more internally self consistent...
What version of cython are you using? I suppose I can also try explicitly passing some other compiler flags... you've specified -arch x86_64, while I haven't.

@fonnesbeck
Copy link
Author

Which Xcode are you using @keflavich? Try installing my packages at http://stronginference.com/scipy-superpack/ which I was able to use pandas under.

@wesm
Copy link
Member

wesm commented Jul 22, 2011

Enthought have likely modified the distutils config to play nice with the scientific Python stack. Yet another reason why I've given up on building everything myself! Using Cython 0.14.1.

@wesm
Copy link
Member

wesm commented Jul 22, 2011

I similarly highly recommend you use Chris's superpack, what I used to use on OS X before EPD (!)

@keflavich
Copy link

Thanks for those tips. I've attempted the scipy-superpack install before but never successfully. I'm still in build-everything-myself-hell because I don't want to risk undoing all the work I put into the installs.

I think I'm using xcode 3.2.6. I installed numpy (and scipy, and matplotlib) from source, all 64-bit.

@fonnesbeck
Copy link
Author

OK, I'm not sure the superpack will work, then, as it is built around Xcode 4.

@wesm
Copy link
Member

wesm commented Jul 22, 2011

Shouldn't the superpack be essentially equivalent to your builds (barring being on the newer XCode)?

@wesm
Copy link
Member

wesm commented Jul 24, 2011

@fonnesbeck did you ever get this resolved (I saw that you got SciPy to build)?

@fonnesbeck
Copy link
Author

Not yet. I had to monkey with some includes on SciPy to get it working, but its not clear if its a similar issue for pandas.

@snth
Copy link
Contributor

snth commented Jul 29, 2011

I have the same problem as keflavich but on Ubuntu 11.04 32-bit. Python 2.7.1+ with all packages from the Ubuntu repositories. Fresh git clone of pandas as of about an hour ago.

$: ~/Documents/src/pandas-fresh$ python setup.py build_ext --inplace
running build_ext
cythoning pandas/src/tseries.pyx to pandas/src/tseries.c
building 'pandas._tseries' extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC

creating build
creating build/temp.linux-i686-2.7
creating build/temp.linux-i686-2.7/pandas
creating build/temp.linux-i686-2.7/pandas/src
compile options: '-I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -c'
gcc: pandas/src/tseries.c
/usr/lib/pymodules/python2.7/numpy/core/include/numpy/__ufunc_api.h:196:1: warning: ‘_import_umath’ defined but not used
pandas/src/tseries.c:1482:33: warning: ‘__pyx_f_6pandas_8_tseries_get_int16_ptr’ defined but not used
pandas/src/tseries.c:1519:33: warning: ‘__pyx_f_6pandas_8_tseries_get_int32_ptr’ defined but not used
pandas/src/tseries.c:1556:33: warning: ‘__pyx_f_6pandas_8_tseries_get_int64_ptr’ defined but not used
pandas/src/tseries.c:1593:34: warning: ‘__pyx_f_6pandas_8_tseries_get_double_ptr’ defined but not used
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/pandas/src/tseries.o -o /home/toby/Documents/src/pandas-fresh/pandas/_tseries.so
cythoning pandas/src/sparse.pyx to pandas/src/sparse.c
building 'pandas._sparse' extension
C compiler: gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC

compile options: '-I/usr/lib/pymodules/python2.7/numpy/core/include -I/usr/include/python2.7 -c'
gcc: pandas/src/sparse.c
/usr/lib/pymodules/python2.7/numpy/core/include/numpy/__multiarray_api.h:1187:1: warning: ‘_import_array’ defined but not used
/usr/lib/pymodules/python2.7/numpy/core/include/numpy/__ufunc_api.h:196:1: warning: ‘_import_umath’ defined but not used
pandas/src/sparse.c: In function ‘__pyx_pf_6pandas_7_sparse_reindex_block’:
pandas/src/sparse.c:14793:13: warning: ‘__pyx_v_length’ may be used uninitialized in this function
gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions build/temp.linux-i686-2.7/pandas/src/sparse.o -o /home/toby/Documents/src/pandas-fresh/pandas/_sparse.so

@wesm
Copy link
Member

wesm commented Jul 29, 2011

@snth so when you try important from the source directory, then, you're getting the same import error?

@wesm
Copy link
Member

wesm commented Jul 29, 2011

@snth @keflavich can you please try building off of the current git HEAD (pushed moments ago). I switched to build using regular distutils instead of numpy's distutils

same goes for you @fonnesbeck =P

@snth
Copy link
Contributor

snth commented Jul 29, 2011

No, import error is slightly different. I'll clone your latest HEAD now. Here's my previous import error so long.

Python 2.7.1+ (r271:86832, Apr 11 2011, 18:05:24) 
[GCC 4.5.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pandas
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "pandas/__init__.py", line 12, in <module>
    from pandas.core.api import *
  File "pandas/core/api.py", line 8, in <module>
    from pandas.core.common import isnull, notnull
  File "pandas/core/common.py", line 11, in <module>
    import pandas._tseries as _tseries
ImportError: No module named _tseries
>>> 

@wesm
Copy link
Member

wesm commented Jul 29, 2011

that's strange because it looks like everything worked fine from your "python setup.py built_ext --inplace" output. Is there a _tseries.so file under your pandas-fresh/pandas/ directory?

@snth
Copy link
Contributor

snth commented Jul 29, 2011

Yes, there is. There's also a _tseries.so under /usr/local/lib/python2.7/dist-packages/pandas if I do a normal install.

Just tried your latest git HEAD and I'm still getting the same behaviour.

Incidentally, as I was checking for the _tseries.so file, I ran python from within the /usr/local/lib/python2.7/dist-packages/pandas directory and I could "import pandas" just fine. Do I have a PYTHONPATH problem?

@wesm
Copy link
Member

wesm commented Jul 29, 2011

can you copy/paste the full output when you try "import pandas" completely outside of dist-packages and outside of the pandas source directory?

Secondly, can you show me the list of files in dist-packages? Looks like some kind of path problem but very hard for me to diagnose

@snth
Copy link
Contributor

snth commented Jul 29, 2011

Sorry, I was running python from the pandas source directory. From everywhere else it runs fine. I also cleaned out the latest install and rebuilt the previous version which I had started with and that runs fine as well.

Really sorry to have wasted your time.

@wesm
Copy link
Member

wesm commented Jul 29, 2011

awesome, no worries at all. it's basically a rite of passage in writing python code to struggle with builds at times =) i would like to resolve the issues that kevlavich and fonnesbeck have, though

@wesm
Copy link
Member

wesm commented Sep 12, 2011

Cleared the milestone as this seems idiosyncratic, won't let it block the 0.4 release. But leaving the issue open until we figure out what's going on (!)

@wesm
Copy link
Member

wesm commented Oct 2, 2011

Unless I'm mistaken this was an idiosyncratic issue and has been resolved :)

@wesm wesm closed this as completed Oct 2, 2011
@fonnesbeck
Copy link
Author

Correct.

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

No branches or pull requests

4 participants