statsmodels.api

D

Davide Dalmasso

Hi,

I intalled an executable version of statsmodels library for Windows 32-bit.
When I import it in my Python Shell no problem occurs buy when I write:

import statsmodels.api as sm

the following error arises:

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import statsmodels.api
File "C:\Python33\lib\site-packages\statsmodels\api.py", line 1, in <module>
from . import iolib, datasets, tools
File "C:\Python33\lib\site-packages\statsmodels\iolib\__init__.py", line 1, in <module>
from .foreign import StataReader, genfromdta, savetxt
File "C:\Python33\lib\site-packages\statsmodels\iolib\foreign.py", line 20, in <module>
import statsmodels.tools.data as data_util
File "C:\Python33\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical
File "C:\Python33\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.interpolate import interp1d
File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>
from .interpolate import *
File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>
import scipy.special as spec
File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
from ._ufuncs import *

Why?

Thanks for any help you will want to give me!

Davide
 
E

Ethan Furman

Hi,

I intalled an executable version of statsmodels library for Windows 32-bit.
When I import it in my Python Shell no problem occurs buy when I write:

import statsmodels.api as sm

the following error arises:

Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import statsmodels.api
File "C:\Python33\lib\site-packages\statsmodels\api.py", line 1, in <module>
from . import iolib, datasets, tools
File "C:\Python33\lib\site-packages\statsmodels\iolib\__init__.py", line 1, in <module>
from .foreign import StataReader, genfromdta, savetxt
File "C:\Python33\lib\site-packages\statsmodels\iolib\foreign.py", line 20, in <module>
import statsmodels.tools.data as data_util
File "C:\Python33\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical
File "C:\Python33\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.interpolate import interp1d
File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>
from .interpolate import *
File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>
import scipy.special as spec
File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
from ._ufuncs import *

We'll need the rest of the traceback, as it will have the actual error.
 
J

John Gordon

In said:
I intalled an executable version of statsmodels library for Windows 32-bit.
When I import it in my Python Shell no problem occurs buy when I write:
import statsmodels.api as sm
the following error arises:
Traceback (most recent call last):
File "<pyshell#1>", line 1, in <module>
import statsmodels.api
File "C:\Python33\lib\site-packages\statsmodels\api.py", line 1, in <module>
from . import iolib, datasets, tools
File "C:\Python33\lib\site-packages\statsmodels\iolib\__init__.py", line 1, in <module>
from .foreign import StataReader, genfromdta, savetxt
File "C:\Python33\lib\site-packages\statsmodels\iolib\foreign.py", line 20, in <module>
import statsmodels.tools.data as data_util
File "C:\Python33\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical
File "C:\Python33\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.interpolate import interp1d
File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>
from .interpolate import *
File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>
import scipy.special as spec
File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
from ._ufuncs import *

This error traceback appears incomplete. Did you paste the whole thing?
 
D

Davide Dalmasso

Il giorno lunedì 16 settembre 2013 17:47:55 UTC+2, Ethan Furman ha scritto:
We'll need the rest of the traceback, as it will have the actual error.

Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import statsmodels.api as sm
File "C:\Python33\lib\site-packages\statsmodels\api.py", line 1, in <module>
from . import iolib, datasets, tools
File "C:\Python33\lib\site-packages\statsmodels\iolib\__init__.py", line 1, in <module>
from .foreign import StataReader, genfromdta, savetxt
File "C:\Python33\lib\site-packages\statsmodels\iolib\foreign.py", line 20, in <module>
import statsmodels.tools.data as data_util
File "C:\Python33\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical
File "C:\Python33\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.interpolate import interp1d
File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>
from .interpolate import *
File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>
import scipy.special as spec
File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529,in <module>
from ._ufuncs import *
ImportError: DLL load failed: Impossibile trovare il modulo specificato.
 
O

Oscar Benjamin

Il giorno lunedì 16 settembre 2013 17:47:55 UTC+2, Ethan Furman ha scritto:
We'll need the rest of the traceback, as it will have the actual error.
Python 3.3.2 (v3.3.2:d047928ae3f6, May 16 2013, 00:03:43) [MSC v.1600 32 bit (Intel)] on win32
Type "copyright", "credits" or "license()" for more information.Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import statsmodels.api as sm
File "C:\Python33\lib\site-packages\statsmodels\api.py", line 1, in <module>
from . import iolib, datasets, tools
File "C:\Python33\lib\site-packages\statsmodels\iolib\__init__.py", line 1, in <module>
from .foreign import StataReader, genfromdta, savetxt
File "C:\Python33\lib\site-packages\statsmodels\iolib\foreign.py", line20, in <module>
import statsmodels.tools.data as data_util
File "C:\Python33\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>
from .tools import add_constant, categorical
File "C:\Python33\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>
from scipy.interpolate import interp1d
File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>
from .interpolate import *
File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>
import scipy.special as spec
File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
from ._ufuncs import *
ImportError: DLL load failed: Impossibile trovare il modulo specificato.

This looks like a bug in your scipy installation. What happens if you
try the following in an interactive session:

Also how did you install scipy? I didn't think that Windows binaries
for Python 3.3 were available yet.


Oscar
 
D

Davide Dalmasso

You are right... there is a problem with scipy intallation because this error arise...
Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
from scipy.interpolate import interp1d
File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>
from .interpolate import *
File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>
import scipy.special as spec
File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
from ._ufuncs import *
ImportError: DLL load failed: Impossibile trovare il modulo specificato.

I tryed to re-install the scipy executable that I downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/
but the problem persists
 
D

Davide Dalmasso

Hi,



I intalled an executable version of statsmodels library for Windows 32-bit.

When I import it in my Python Shell no problem occurs buy when I write:



import statsmodels.api as sm



the following error arises:



Traceback (most recent call last):

File "<pyshell#1>", line 1, in <module>

import statsmodels.api

File "C:\Python33\lib\site-packages\statsmodels\api.py", line 1, in <module>

from . import iolib, datasets, tools

File "C:\Python33\lib\site-packages\statsmodels\iolib\__init__.py", line 1, in <module>

from .foreign import StataReader, genfromdta, savetxt

File "C:\Python33\lib\site-packages\statsmodels\iolib\foreign.py", line 20, in <module>

import statsmodels.tools.data as data_util

File "C:\Python33\lib\site-packages\statsmodels\tools\__init__.py", line 1, in <module>

from .tools import add_constant, categorical

File "C:\Python33\lib\site-packages\statsmodels\tools\tools.py", line 8, in <module>

from scipy.interpolate import interp1d

File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>

from .interpolate import *

File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>

import scipy.special as spec

File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>

from ._ufuncs import *



Why?



Thanks for any help you will want to give me!



Davide
 
J

Josef Pktd

You are right... there is a problem with scipy intallation because this error arise...




Traceback (most recent call last):

File "<pyshell#3>", line 1, in <module>

from scipy.interpolate import interp1d

File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>

from .interpolate import *

File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>

import scipy.special as spec

File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>

from ._ufuncs import *

ImportError: DLL load failed: Impossibile trovare il modulo specificato.



I tryed to re-install the scipy executable that I downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/

but the problem persists

Did you also install numpy from gohlke?
My guess would be binary incompatibility if numpy is not the MKL version.

Josef
 
O

Oscar Benjamin

You are right... there is a problem with scipy intallation because this error arise...

Traceback (most recent call last):
File "<pyshell#3>", line 1, in <module>
from scipy.interpolate import interp1d
File "C:\Python33\lib\site-packages\scipy\interpolate\__init__.py", line 150, in <module>
from .interpolate import *
File "C:\Python33\lib\site-packages\scipy\interpolate\interpolate.py", line 12, in <module>
import scipy.special as spec
File "C:\Python33\lib\site-packages\scipy\special\__init__.py", line 529, in <module>
from ._ufuncs import *
ImportError: DLL load failed: Impossibile trovare il modulo specificato.

I tryed to re-install the scipy executable that I downloaded from http://www.lfd.uci.edu/~gohlke/pythonlibs/
but the problem persists

There are potential compatibility problems with the binaries from
there as described at the top of the page. One thing is that you need
to use Christopher's own numpy build to go with scipy:
http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
If you installed numpy from somewhere else then that could be your problem.

Essentially scipy isn't quite ported to Python 3.3 yet so my general
advice is to use Python 3.2 and to use the official numpy/scipy
binaries from sourceforge (they don't yet provide binaries for 3.3).

Alternatively an easier approach might be to use Python(x, y) (which
is free) or the Enthought Python Distribution (which is free for
academic users). These are distributions that bundle Python with
numpy/scipy and lots of other packages. I think they both still use
Python 2.7 though.

(As an aside, this is all much simpler if you're using Ubuntu or some
other Linux distro rather than Windows.)


Oscar
 
J

Josef Pktd

There are potential compatibility problems with the binaries from

there as described at the top of the page. One thing is that you need

to use Christopher's own numpy build to go with scipy:

http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy

If you installed numpy from somewhere else then that could be your problem.



Essentially scipy isn't quite ported to Python 3.3 yet so my general

advice is to use Python 3.2 and to use the official numpy/scipy

binaries from sourceforge (they don't yet provide binaries for 3.3).



Alternatively an easier approach might be to use Python(x, y) (which

is free) or the Enthought Python Distribution (which is free for

academic users). These are distributions that bundle Python with

numpy/scipy and lots of other packages. I think they both still use

Python 2.7 though.



(As an aside, this is all much simpler if you're using Ubuntu or some

other Linux distro rather than Windows.)

scientific python on a stick

https://code.google.com/p/winpython/wiki/PackageIndex_33

I haven't seen any problems so far on python 3.3
The statsmodels test suite passes without problems on python 3.3 also, as far as I remember.
(and no problems using Windows. just use the right binaries.)

Josef
 
O

Oscar Benjamin


Thanks, I've just installed that and I'll try it out later.
I haven't seen any problems so far on python 3.3
The statsmodels test suite passes without problems on python 3.3 also, as far as I remember.
(and no problems using Windows. just use the right binaries.)

Well that's exactly my point. On a Linux distro you would have the
right binaries first time. No need to search through project webpages
or documentation, weigh up different installers, or download 750MB of
software that you mostly won't use. Similarly on a Linux distro it's a
lot easier to get all of the build tools set up to build these things
from source if you'd prefer.

Windows users are often dependent on inconsistent sources of binaries.
In this case I imagine that the OP installed numpy from sourceforge
since it has 3.3 binaries but it doesn't have the same for scipy at
which point googling would easily lead to Cristoph's page.


Oscar
 
J

Josef Perktold

Oscar Benjamin said:
Thanks, I've just installed that and I'll try it out later.


Well that's exactly my point. On a Linux distro you would have the
right binaries first time. No need to search through project webpages
or documentation, weigh up different installers, or download 750MB of
software that you mostly won't use. Similarly on a Linux distro it's a
lot easier to get all of the build tools set up to build these things
from source if you'd prefer.

This might be true for many Linux users.
However, the last time I tried to install something in a virtual Linux OS
that was not in the standard repository, I was completely lost.
(I'm a Windows user.)

Windows users are often dependent on inconsistent sources of binaries.
In this case I imagine that the OP installed numpy from sourceforge
since it has 3.3 binaries but it doesn't have the same for scipy at
which point googling would easily lead to Cristoph's page.

Another problem with relying on binaries on Windows is when the matching
binaries are not available. For example, the Windows binaries on pypi of
pandas and statsmodels are compiled against the latest numpy release and
will not work with older numpy versions.
(
http://stackoverflow.com/questions/...e-has-the-wrong-size-try-recompiling/18369312
)

On the other hand, python-xy comes with MingW, and I never had any problems
compiling pandas and statsmodels for any version combination of python and
numpy that I tested (although 32 bit only so far, I never set up the
Microsoft sdk).

(latest moving to MingW-64 for numpy and scipy, and related packages,
might be on the way.)

Josef
 
O

Oscar Benjamin

On the other hand, python-xy comes with MingW, and I never had any problems
compiling pandas and statsmodels for any version combination of python and
numpy that I tested (although 32 bit only so far, I never set up the
Microsoft sdk).

Just out of interest: out of the box Python.org distutils is
incompatible with recent versions of MinGW. If Python-xy distributes
MinGW (and it works) then they're either creating a special patched
MinGW set up or patching distutils. I don't want to install Python-xy
myself since it'll clobber my existing Python installation but could
you answer the following for me:

1) What gcc version did Python-xy install for you?

2) Does the distutils.cygwincompiler module it installs contain the
following lines (around about line 300) specifically with the
'-mno-cygwin' option?

self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
compiler_so='gcc -mno-cygwin -mdll -O -Wall',
compiler_cxx='g++ -mno-cygwin -O -Wall',
linker_exe='gcc -mno-cygwin',
linker_so='%s -mno-cygwin %s %s'


Oscar
 
J

Josef Perktold

Oscar Benjamin said:
Just out of interest: out of the box Python.org distutils is
incompatible with recent versions of MinGW. If Python-xy distributes
MinGW (and it works) then they're either creating a special patched
MinGW set up or patching distutils. I don't want to install Python-xy
myself since it'll clobber my existing Python installation but could
you answer the following for me:

1) What gcc version did Python-xy install for you?

2) Does the distutils.cygwincompiler module it installs contain the
following lines (around about line 300) specifically with the
'-mno-cygwin' option?

self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
compiler_so='gcc -mno-cygwin -mdll -O -Wall',
compiler_cxx='g++ -mno-cygwin -O -Wall',
linker_exe='gcc -mno-cygwin',
linker_so='%s -mno-cygwin %s %s'

I installed python-xy 2 years ago with python 2.6 and didn't update, so my
information is not up-to-date

It looks like my MingW version uses mingw32-gcc-4.4.0.exe

for python 2.6 which came with python-xy:
self.set_executables(compiler='gcc -mno-cygwin -O -Wall',
compiler_so='gcc -mno-cygwin -mdll -O -Wall',
compiler_cxx='g++ -mno-cygwin -O -Wall',
linker_exe='gcc -mno-cygwin',
linker_so='%s -mno-cygwin %s %s'
% (self.linker_dll, shared_option,
entry_point))

However, I'm running python 2.5, 2.7, 3.2 and 3.3 additionally. And they are
all python.org versions without any changes (except IDLE bugs :).
I don't have any compilation problems with any of them.

Until recently statsmodels used distutils from numpy which adds some patches
AFAIK. The current statsmodels setup.py just uses plain distutils and
setuptools. (The setup.py is largely copied from pandas which has a lot more
C extensions than statsmodels.)

numpy scipy binaries for Windows are still compiled against MingW 3.x, but
David Cournapeau is looking into upgrading to the latest MingW(-64) right now.

also (from some comments about problems a long time ago): I don't have
cygwin installed, so there is no confusion between cygwin and msys/mingw
paths possible.

Josef
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top