Problem with initial install of latest PSI from bitbucket

96 views
Skip to first unread message

Paul Nguyen (SysOps)

unread,
Dec 19, 2009, 6:10:24 PM12/19/09
to psi-d...@googlegroups.com
Hello,

I'm a new to PSI. I cloned the tree from the mercurial repository at bitbucket. I am running RHEL 5.4 x86_64 with the stock python. I built the libraries and ran the tests, and came up with just one failure.

======================================================================
FAIL: test_free (mount_test.MountAttrTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/psi/tests/mount_test.py", line 136, in test_free
    self.assert_(self.m.total > self.m.free)
AssertionError

----------------------------------------------------------------------
Ran 159 tests in 1.638s

FAILED (failures=1)

When I go to the python interpreter and try to import the psi module, it fails with the following message. 

[root@host psi]# python setup.py install
running install
running build
running build_py
running build_ext
running install_lib
creating /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/_psi.so -> /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/process.so -> /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/_version.py -> /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/__init__.pyc -> /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/_version.pyc -> /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/mount.so -> /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/arch.so -> /usr/lib64/python2.4/site-packages/psi
copying build/lib.linux-x86_64-2.4/psi/__init__.py -> /usr/lib64/python2.4/site-packages/psi
[root@host psi]# python
Python 2.4.3 (#1, Jun 11 2009, 14:09:37) 
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import pwd
>>> import psi
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
  File "psi/__init__.py", line 43, in ?
    from psi._psi import AttrNotAvailableError, AttrInsufficientPrivsError, \
ImportError: No module named _psi
>>> 

Can anyone please help me get past this problem?

Thanks! Paul

Floris Bruynooghe

unread,
Dec 19, 2009, 9:07:00 PM12/19/09
to Paul Nguyen (SysOps), psi-d...@googlegroups.com
Hi Paul

On Sat, Dec 19, 2009 at 03:10:24PM -0800, Paul Nguyen (SysOps) wrote:
> I'm a new to PSI. I cloned the tree from the mercurial repository at
> bitbucket. I am running RHEL 5.4 x86_64 with the stock python. I built the
> libraries and ran the tests, and came up with just one failure.
>
> ======================================================================
> FAIL: test_free (mount_test.MountAttrTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/root/psi/tests/mount_test.py", line 136, in test_free
> self.assert_(self.m.total > self.m.free)
> AssertionError
>
> ----------------------------------------------------------------------
> Ran 159 tests in 1.638s
>
> FAILED (failures=1)

I've seen this failure once before I think. It's strange but nothing
to worry about too much. But I've just pushed a changeset out that
should give us some more information about why this test fails, so if
you want to re-run this and send the output again that would be nice.

> When I go to the python interpreter and try to import the psi module, it
> fails with the following message.

[...]


> >>> import psi
> Traceback (most recent call last):
> File "<stdin>", line 1, in ?
> File "psi/__init__.py", line 43, in ?
> from psi._psi import AttrNotAvailableError, AttrInsufficientPrivsError,
> \
> ImportError: No module named _psi

This is simply the python import path that is surprising you. If you
check your sys.path you will notice that the current directory is on
it, and your current directory -the psi toplevel directory- has the
pure-python source of psi inside the psi/ directory. When python
tries to use that it is missing the extension modules.

If you want to try psi without installing it you can just cd into the
build/lib.linux-x86_64-2.6/ (or whatever it is for your system)
directory before starting python.

Regards
Floris

--
Debian GNU/Linux -- The Power of Freedom
www.debian.org | www.gnu.org | www.kernel.org

Paul Nguyen (SysOps)

unread,
Dec 19, 2009, 9:26:09 PM12/19/09
to Floris Bruynooghe, Paul Nguyen (SysOps), psi-d...@googlegroups.com
Hi Floris,

Thanks for the quick response!

On Sat, Dec 19, 2009 at 6:07 PM, Floris Bruynooghe <floris.b...@gmail.com> wrote:
Hi Paul

On Sat, Dec 19, 2009 at 03:10:24PM -0800, Paul Nguyen (SysOps) wrote:
> I'm a new to PSI. I cloned the tree from the mercurial repository at
> bitbucket. I am running RHEL 5.4 x86_64 with the stock python. I built the
> libraries and ran the tests, and came up with just one failure.
>
> ======================================================================
> FAIL: test_free (mount_test.MountAttrTests)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
>   File "/root/psi/tests/mount_test.py", line 136, in test_free
>     self.assert_(self.m.total > self.m.free)
> AssertionError
>
> ----------------------------------------------------------------------
> Ran 159 tests in 1.638s
>
> FAILED (failures=1)

I've seen this failure once before I think.  It's strange but nothing
to worry about too much.  But I've just pushed a changeset out that
should give us some more information about why this test fails, so if
you want to re-run this and send the output again that would be nice.


I pulled down the changes.  Here is the output from python setup.py test

======================================================================
FAIL: test_free (mount_test.MountAttrTests)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/root/psi/tests/mount_test.py", line 137, in test_free
    '%d > %d' % (self.m.total, self.m.free))
AssertionError: 26531893248 > 26897207296

----------------------------------------------------------------------
Ran 159 tests in 1.195s

FAILED (failures=1) 

> When I go to the python interpreter and try to import the psi module, it
> fails with the following message.
[...]
> >>> import psi
> Traceback (most recent call last):
>   File "<stdin>", line 1, in ?
>   File "psi/__init__.py", line 43, in ?
>     from psi._psi import AttrNotAvailableError, AttrInsufficientPrivsError,
> \
> ImportError: No module named _psi

This is simply the python import path that is surprising you.  If you
check your sys.path you will notice that the current directory is on
it, and your current directory -the psi toplevel directory- has the
pure-python source of psi inside the psi/ directory.  When python
tries to use that it is missing the extension modules.

If you want to try psi without installing it you can just cd into the
build/lib.linux-x86_64-2.6/ (or whatever it is for your system)
directory before starting python.

Ah, I was running in the psi top-level directory, it must have tried to pick up in the current directory.  That makes total sense.  I changed to my home directory and successfully imported the psi module.  
 
Thanks for your help!

Paul

Reply all
Reply to author
Forward
0 new messages