0

I have to include the pandas library in my package to run my software on a cluster server without pandas library installed but with all the right dependencies.

I tried to build on my pc the pandas library from source (ver. 0.8.1):

python setup.py build_ext --inplace

and if I move the builded pandas folder anywhere in some other folder in my pc I can import it in my software (ex ./mySoftwareFolder/pandas)

But when I move my software with pandas libray on the cluster server it raise me the error:

File "testPandas.py", line 9, in <module>
    import pandas
File "/home/TEST/pandas/__init__.py", line 15, in <module>

raise ImportError('C extensions not built: if you installed already '
ImportError: C extensions not built: if you installed already verify that you are not importing from the source directory

like if it is not compiled.

What is wrong in my way to include library?

thanks a lot!

update: the directory that I copy to cluster server contains:

-bash-4.2$ ll -a pandas
totale 11476
drwxr-xr-x. 14 francesco dottor    4096  1 set 13.37 .
drwxr-xr-x. 10 francesco dottor    8192  1 set 13.36 ..
-rwxr-xr-x.  1 francesco dottor 2648299  1 set 13.36 _algos.so
drwxr-xr-x.  2 francesco dottor    4096  1 set 13.36 compat
drwxr-xr-x.  2 francesco dottor    4096  1 set 13.36 core
-rw-r--r--.  1 francesco dottor     394  1 set 13.36 info.py
-rw-r--r--.  1 francesco dottor     557  1 set 13.36 info.pyc
-rw-r--r--.  1 francesco dottor    1269  1 set 13.36 __init__.py
-rw-r--r--.  1 francesco dottor    1643  1 set 13.37 __init__.pyc
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 io
-rwxr-xr-x.  1 francesco dottor 7437108  1 set 13.36 lib.so
-rwxr-xr-x.  1 francesco dottor  474199  1 set 13.36 _period.so
drwxr-xr-x.  2 francesco dottor    4096  1 set 13.36 rpy
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 sandbox
-rw-r--r--.  1 francesco dottor     844  1 set 13.36 setup.py
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 sparse
-rwxr-xr-x.  1 francesco dottor 1065313  1 set 13.36 _sparse.so
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 src
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 stats
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 tests
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 tools
drwxr-xr-x.  3 francesco dottor    4096  1 set 13.36 tseries
drwxr-xr-x.  2 francesco dottor    4096  1 set 13.36 util
-rw-r--r--.  1 francesco dottor      42  1 set 13.36 version.py
-rw-r--r--.  1 francesco dottor     204  1 set 13.36 version.pyc
Francesco
  • 323
  • 1
  • 2
  • 10

1 Answers1

0

What platform are you building the C extensions on? On the cluster machine, verify that the extension shared objects (.so files on Linux/OSX and .pyd files on Windows) are in the folder you copied:

08:21 ~/code/pandas/pandas  $ ll
total 12568
-rw-r--r--   1 wesm  staff     1269 Aug 25 04:49 __init__.py
-rw-r--r--   1 wesm  staff     1645 Aug 25 04:52 __init__.pyc
-rwxr-xr-x   1 wesm  staff   799464 Aug 25 04:50 _algos.so
-rwxr-xr-x   1 wesm  staff    65712 Aug 25 04:48 _engines.so
-rwxr-xr-x   1 wesm  staff   197056 Sep  1 22:13 _period.so
-rwxr-xr-x   1 wesm  staff   341032 Aug 25 04:53 _sparse.so
drwxr-xr-x   6 wesm  staff      204 Aug 25 04:52 compat
drwxr-xr-x  44 wesm  staff     1496 Sep  1 17:34 core
drwxr-xr-x   3 wesm  staff      102 Aug 25 04:49 finance
-rw-r--r--   1 wesm  staff      394 Aug 25 04:49 info.py
-rw-r--r--   1 wesm  staff      535 Aug 25 04:52 info.pyc
drwxr-xr-x  15 wesm  staff      510 Sep  1 23:14 io
-rwxr-xr-x   1 wesm  staff  2490600 Sep  1 22:13 lib.so
drwxr-xr-x   9 wesm  staff      306 Sep  1 17:34 rpy
drwxr-xr-x   6 wesm  staff      204 May 20 19:13 sandbox
-rw-r--r--   1 wesm  staff      844 Feb 22  2012 setup.py
drwxr-xr-x  17 wesm  staff      578 Aug 25 04:52 sparse
drwxr-xr-x  55 wesm  staff     1870 Sep  1 22:57 src
drwxr-xr-x  23 wesm  staff      782 Aug 25 04:52 stats
drwxr-xr-x  40 wesm  staff     1360 Sep  1 17:34 tests
drwxr-xr-x  16 wesm  staff      544 Aug 25 04:52 tools
drwxr-xr-x  28 wesm  staff      952 Sep  1 17:34 tseries
drwxr-xr-x  18 wesm  staff      612 Aug 25 04:52 util
-rw-r--r--   1 wesm  staff       54 Sep  1 22:57 version.py
-rw-r--r--   1 wesm  staff      204 Sep  1 22:58 version.pyc
Wes McKinney
  • 101,437
  • 32
  • 142
  • 108
  • Hi Wes ( I have just viewed your pandas' tutorial on youtube it's great!!! ) I use linux (ubuntu 12.04) to compile pandas the directory that I copy to cluster server contains .so files and I have updated my question with the list of files. – Francesco Sep 02 '12 at 17:36
  • I'm building in Eclipse with ubuntu 12.04. Getting the same error as @Frank. I'm not doing anything fancy, just trying to run a .py that calls pandas.io.parsers.read_csv . The hover hint says "'C extensions not built: if you installed already '" . $locate pandas gives /usr/lib/pymodules/python2.7/pandas/io/parsers.py /usr/lib/pymodules/python2.7/pandas/io/parsers.pyc . In my pymodules folder i have _tseries.so, _engine.so, _sparse.so but nothing more. – darKoram Sep 03 '12 at 14:28
  • If i change the call to pd.read_csv the error goes away (but I'm not using the compiled version then?). I found the lib settings (in windows->preferences->python->interpreter no project->properties!) http://www.pasteall.org/pic/show.php?id=37312 and added /usr/lib/pymodules/python2.7/pandas but this didn't fix it. – darKoram Sep 03 '12 at 14:58