On Fri, 13 Jul 2012, George Panterov wrote:
> Installation goes through but still no statsmodels.api ...
> import statsmodels
> In [2]: statsmodels.
> statsmodels.NoseWrapper statsmodels.test
> statsmodels.Tester statsmodels.with_statement
> statsmodels.errstate
> In [2]: import statsmodels.api
> ---------------------------------------------------------------------------
> ImportError Traceback (most recent call
> last)
> /home/gpanterov/<ipython-input-2-b81506c9f24a> in <module>()
> ----> 1 import statsmodels.api
> /usr/local/lib/python2.7/dist-packages/statsmodels/api.py in <module>()
> ----> 1 import iolib, datasets, tools
> 2 from tools.tools import add_constant, categorical
> 3 import regression
> 4 from .regression.linear_model import OLS, GLS, WLS, GLSAR
> 5 from .genmod.generalized_linear_model import GLM
> ImportError: No module named iolib
well -- you are still importing from /usr/local -- first remove this
incorrectly installed copy of statsmodels (and pandas)... and then your
packaged installation should work just fine... e.g. here I tried to
replicate/see if there is indeed any issue:
head2:/# nd_login nd+ubuntu precise amd64 /tmp/
-> Copying COW directory
forking: rm -rf /backup/neurodebian/build/cow.30733
forking: cp -al /backup/neurodebian/cow/nd+ubuntu-precise-amd64.cow /backup/neurodebian/build/cow.30733
I: removed stale ilistfile /backup/neurodebian/build/cow.30733/.ilist
-> Invoking pbuilder
forking: pbuilder login --aptcache /backup/neurodebian/ubuntu_aptcache --bindmounts /tmp/ --buildplace /backup/neurodebian/build/cow.30733 --no-targz --internal-chrootexec chroot /backup/neurodebian/build/cow.30733 cow-shell
W: /root/.pbuilderrc does not exist
I: Running in no-targz mode
I: copying local configuration
I: mounting /proc filesystem
I: mounting /dev/pts filesystem
I: Mounting /dev/shm
I: Mounting /tmp/
I: Mounting /var/cache/pbuilder/ccache
I: policy-rc.d already exists
I: Obtaining the cached apt archive contents
I: entering the shell
head2:/# apt-get install python-statsmodels
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
libamd2.2.0 libblas3gf libexpat1 libgfortran3 liblapack3gf libumfpack5.4.0 mime-support neurodebian-popularity-contest popularity-contest python python-numpy python-scipy python-statsmodels-lib python-support python2.7
Suggested packages:
anacron python-doc python-tk python-numpy-doc python-numpy-dbg python-nose python-dev gfortran python-profiler python2.7-doc
Recommended packages:
file python-imaging python-pandas python-matplotlib python-joblib
The following NEW packages will be installed:
libamd2.2.0 libblas3gf libexpat1 libgfortran3 liblapack3gf libumfpack5.4.0 mime-support neurodebian-popularity-contest popularity-contest python python-numpy python-scipy python-statsmodels python-statsmodels-lib python-support python2.7
0 upgraded, 16 newly installed, 0 to remove and 0 not upgraded.
Need to get 3153 kB/20.8 MB of archives.
After this operation, 68.1 MB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1
http://neuro.debian.net/debian/ precise/main python-statsmodels-lib amd64 0.4.2-1~nd12.04+1 [66.3 kB]
Get:2
http://neuro.debian.net/debian/ precise/main python-statsmodels all 0.4.2-1~nd12.04+1 [3087 kB]
Fetched 3153 kB in 0s (7395 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package libexpat1.
(Reading database ... 13955 files and directories currently installed.)
Unpacking libexpat1 (from .../libexpat1_2.0.1-7.2ubuntu1_amd64.deb) ...
Selecting previously unselected package popularity-contest.
Unpacking popularity-contest (from .../popularity-contest_1.53ubuntu1_all.deb) ...
Selecting previously unselected package libgfortran3.
Unpacking libgfortran3 (from .../libgfortran3_4.6.3-1ubuntu5_amd64.deb) ...
Selecting previously unselected package mime-support.
Unpacking mime-support (from .../mime-support_3.51-1ubuntu1_all.deb) ...
Selecting previously unselected package python2.7.
Unpacking python2.7 (from .../python2.7_2.7.3-0ubuntu3_amd64.deb) ...
Selecting previously unselected package python.
Unpacking python (from .../python_2.7.3-0ubuntu2_amd64.deb) ...
Selecting previously unselected package libamd2.2.0.
Unpacking libamd2.2.0 (from .../libamd2.2.0_1%3a3.4.0-2ubuntu3_amd64.deb) ...
Selecting previously unselected package libblas3gf.
Unpacking libblas3gf (from .../libblas3gf_1.2.20110419-2ubuntu1_amd64.deb) ...
Selecting previously unselected package liblapack3gf.
Unpacking liblapack3gf (from .../liblapack3gf_3.3.1-1_amd64.deb) ...
Selecting previously unselected package libumfpack5.4.0.
Unpacking libumfpack5.4.0 (from .../libumfpack5.4.0_1%3a3.4.0-2ubuntu3_amd64.deb) ...
Selecting previously unselected package neurodebian-popularity-contest.
Unpacking neurodebian-popularity-contest (from .../neurodebian-popularity-contest_0.27~nd11.10+1+nd12.04+1_all.deb) ...
Selecting previously unselected package python-numpy.
Unpacking python-numpy (from .../python-numpy_1%3a1.6.1-6ubuntu1_amd64.deb) ...
Selecting previously unselected package python-support.
Unpacking python-support (from .../python-support_1.0.14ubuntu2_all.deb) ...
Selecting previously unselected package python-scipy.
Unpacking python-scipy (from .../python-scipy_0.9.0+dfsg1-1ubuntu2_amd64.deb) ...
Selecting previously unselected package python-statsmodels-lib.
Unpacking python-statsmodels-lib (from .../python-statsmodels-lib_0.4.2-1~nd12.04+1_amd64.deb) ...
Selecting previously unselected package python-statsmodels.
Unpacking python-statsmodels (from .../python-statsmodels_0.4.2-1~nd12.04+1_all.deb) ...
Setting up libexpat1 (2.0.1-7.2ubuntu1) ...
Setting up popularity-contest (1.53ubuntu1) ...
Setting up libgfortran3 (4.6.3-1ubuntu5) ...
Setting up mime-support (3.51-1ubuntu1) ...
update-alternatives: using /usr/bin/see to provide /usr/bin/view (view) in auto mode.
Setting up python2.7 (2.7.3-0ubuntu3) ...
Setting up python (2.7.3-0ubuntu2) ...
Setting up libamd2.2.0 (1:3.4.0-2ubuntu3) ...
Setting up libblas3gf (1.2.20110419-2ubuntu1) ...
update-alternatives: using /usr/lib/libblas/libblas.so.3gf to provide /usr/lib/libblas.so.3gf (libblas.so.3gf) in auto mode.
Setting up liblapack3gf (3.3.1-1) ...
update-alternatives: using /usr/lib/lapack/liblapack.so.3gf to provide /usr/lib/liblapack.so.3gf (liblapack.so.3gf) in auto mode.
Setting up libumfpack5.4.0 (1:3.4.0-2ubuntu3) ...
Setting up neurodebian-popularity-contest (0.27~nd11.10+1+nd12.04+1) ...
Adding NeuroDebian url for Popularity Contest submissions.
Setting up python-numpy (1:1.6.1-6ubuntu1) ...
Setting up python-support (1.0.14ubuntu2) ...
Setting up python-scipy (0.9.0+dfsg1-1ubuntu2) ...
Setting up python-statsmodels-lib (0.4.2-1~nd12.04+1) ...
Setting up python-statsmodels (0.4.2-1~nd12.04+1) ...
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Processing triggers for python-support ...
head2:/# python -c 'import statsmodels.api'
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/lib/pymodules/python2.7/statsmodels/api.py", line 1, in <module>
import iolib, datasets, tools
File "/usr/lib/pymodules/python2.7/statsmodels/datasets/__init__.py", line 5, in <module>
import anes96, committee, ccard, copper, cpunish, elnino, grunfeld, longley, \
File "/usr/lib/pymodules/python2.7/statsmodels/datasets/anes96/__init__.py", line 1, in <module>
from data import *
File "/usr/lib/pymodules/python2.7/statsmodels/datasets/anes96/data.py", line 87, in <module>
import statsmodels.tools.datautils as du
File "/usr/lib/pymodules/python2.7/statsmodels/tools/__init__.py", line 1, in <module>
from tools import add_constant, categorical
File "/usr/lib/pymodules/python2.7/statsmodels/tools/tools.py", line 14, in <module>
from pandas import DataFrame
ImportError: No module named pandas
head2:/# apt-get install python-pandas
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following extra packages will be installed:
python-dateutil python-pandas-lib
Suggested packages:
python-pandas-doc
Recommended packages:
python-matplotlib python-tables python-tz python-xlrd python-openpyxl python-xlwt
The following NEW packages will be installed:
python-dateutil python-pandas python-pandas-lib
0 upgraded, 3 newly installed, 0 to remove and 0 not upgraded.
Need to get 1537 kB/1591 kB of archives.
After this operation, 5596 kB of additional disk space will be used.
Do you want to continue [Y/n]?
Get:1
http://neuro.debian.net/debian/ precise/main python-pandas-lib amd64 0.8.0-1~nd12.04+1 [928 kB]
Get:2
http://neuro.debian.net/debian/ precise/main python-pandas all 0.8.0-1~nd12.04+1 [609 kB]
Fetched 1537 kB in 0s (6699 kB/s)
debconf: delaying package configuration, since apt-utils is not installed
Selecting previously unselected package python-dateutil.
(Reading database ... 18194 files and directories currently installed.)
Unpacking python-dateutil (from .../python-dateutil_1.5-1_all.deb) ...
Selecting previously unselected package python-pandas-lib.
Unpacking python-pandas-lib (from .../python-pandas-lib_0.8.0-1~nd12.04+1_amd64.deb) ...
Selecting previously unselected package python-pandas.
Unpacking python-pandas (from .../python-pandas_0.8.0-1~nd12.04+1_all.deb) ...
Setting up python-dateutil (1.5-1) ...
Setting up python-pandas-lib (0.8.0-1~nd12.04+1) ...
Setting up python-pandas (0.8.0-1~nd12.04+1) ...
Processing triggers for python-support ...
head2:/# python -c 'import statsmodels.api'
head2:/#