ImportError: No module named vectors

744 views
Skip to first unread message

yang

unread,
May 13, 2011, 4:27:45 AM5/13/11
to IMUSim
hi, this following two commands was worked well, but when I exec "from
imusim.all import *"
I got error information as follows, so what's that mean,I a
newbie of Python,can you help
me?

python setup.py build_ext --compiler=mingw32 -liberty
python setup.py install

In [1]: from imusim.all import *
---------------------------------------------------------------------------
ImportError Traceback (most recent call
last)

D:\imusim\<ipython console> in <module>()

D:\imusim\imusim\all\__init__.py in <module>()
29 and not modname.startswith('imusim.tests') \
30 and not modname.startswith('imusim.all'):
---> 31 exec("import %s" % modname)
32 exec("module = %s" % modname)
33 symbols = filter(lambda o: not inspect.ismodule(o),

D:\imusim\<string> in <module>()

D:\imusim\imusim\algorithms\calibration.py in <module>()
22 from scipy.optimize import leastsq
23 from abc import abstractmethod, ABCMeta
---> 24 import imusim.maths.vectors as vectors
25 import numpy as np
ImportError: No module named vectors

Martin Ling

unread,
May 13, 2011, 5:49:20 AM5/13/11
to imusim...@googlegroups.com
Hi,

This is a problem that occurs when you run python or ipython from the
directory that you installed IMUSim from. Because the 'imusim' directory
containing the code is present there, Python tries to import the
packages from this location rather than the location they have been
installed to. This fails because the parts which were compiled from C
(including imusim.maths.vectors) are not found there.

There are two solutions, either should work:

1. Simply change to any other directory before running ipython.

or:

2. Tell setup.py to build the extensions in place:

python setup.py build_ext --inplace

(adding the --compiler=mingw32 -liberty options if using MinGW)

Hope that helps!


Martin

> --
> You received this message because you are subscribed to the Google Groups "IMUSim" group.
> To post to this group, send email to imusim...@googlegroups.com.
> To unsubscribe from this group, send email to imusim-users...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/imusim-users?hl=en.
>


Reply all
Reply to author
Forward
0 new messages