On 04/07/2012 06:23 AM, Robert Layton wrote:
On 6 April 2012 20:05, Joonas Sillanpää <[email protected]
<mailto:[email protected]>> wrote:
Hi!
I just tried to install from source using instructions
http://scikit-learn.org/stable/install.html I installed all
packages and
did "sudo pip install -U scikit-learn".
After installing did:
python -c "import sklearn; sklearn.test()"
Ran 993 tests in 35.552s
FAILED (SKIP=6, errors=6)
I got 6 Doctests errors, all were in the same line of code. One
example
here.
ERROR: Doctest: sklearn.datasets.base.load_sample_images
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/usr/local/lib/python2.7/dist-packages/nose/plugins/doctests.py",
line
395, in tearDown
delattr(builtin_mod, self._result_var)
AttributeError: _
I guess its not a big problem because its doctests and installation is
ok? I looked at the source file
"/usr/local/lib/python2.7/dist-packages/nose/plugins/doctests.py" and
wonder some things:
def tearDown(self):
super(DocTestCase, self).tearDown()
if self._result_var is not None:
sys.displayhook = self._old_displayhook
delattr(builtin_mod, self._result_var)
It seems that self._result_var is initialized to "_" in
DocTestCase.__init__()
so self.result_var will never be None...because it is assigned in two
places in this file, and
neither assigns None to it.
Perhaps better would be something like if hasattr(builtin_mod,
self._result_var) ?
So it would protect using delattr() when there is no such attribute to
delete...
I tried it and now I dont get DocTesterrors.
def tearDown(self):
super(DocTestCase, self).tearDown()
#if self._result_var is not None:
if hasattr(builtin_mod, self._result_var):
sys.displayhook = self._old_displayhook
delattr(builtin_mod, self._result_var)
Ran 993 tests in 34.766s
OK (SKIP=6)
- Joonas
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Scikit-learn-general mailing list
[email protected]
<mailto:[email protected]>
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
I've had similar errors in the past which have needed an update to
nosetests to fix.
What version are you running?
- Robert
--
Public key at: http://pgp.mit.edu/ Search for this email address and
select the key from "2011-08-19" (key id: 54BA8735)
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general
My nose version:
>>> import nose
>>> nose.__version__
'1.1.2'
I'm glad I not only one to have seen that error. It feels little weird
to use library, when test gives errors. But I guess DocTestErrors don't
effect how library works, and also I don't have the errors after I
changed the if-statement. I probaply should ask in nose forums about
that Error. Anyway, I tried library for text recognition with SVC and it
seems to work and is really easy to use, so I'm happy :)
Other Information about my versions:
OS: Linux Mint 11 64-bit, 2.6.38-8-generic
Python: 2.7.1+
sklearn:
>>> import sklearn
>>> sklearn.__version__
'0.10'
numpy:
>>> import numpy
>>> numpy.__version__
'1.5.1'
setuptools:
>>> import setuptools
>>> setuptools.__version__
'0.6
scipy:
>>> import scipy
>>> scipy.__version__
'0.8.0'
libatlas:
Version: 3.8.3-29
matplotlib:
>>> import matplotlib
>>> matplotlib.__version__
'1.0.1'
- Joonas
------------------------------------------------------------------------------
For Developers, A Lot Can Happen In A Second.
Boundary is the first to Know...and Tell You.
Monitor Your Applications in Ultra-Fine Resolution. Try it FREE!
http://p.sf.net/sfu/Boundary-d2dvs2
_______________________________________________
Scikit-learn-general mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/scikit-learn-general