Discussion:
[lxc-users] lxc-ls question
Kevin Wilson
2014-02-23 19:59:16 UTC
Permalink
Hello,
My question is about lxc.1.0:

I want first to verify that my understanding is correct:
lxc-ls, which is a python script, is created both when using
--enable-python and when not using --enable-python in ./configure.
And in fact, --enable-python is not needed so that it will work.

Please let me know if I am correct in this (and I would appreciate if
somebody will elaborate about what is --enable-python for).

Second, I have a Fedora 20 x86_64 machine on which docker is
installed; as part of
docker rpm installation, it installs lxc 0.9.

I want to do tests with lxc-1.0 on this machine without
removing docker, so I had installed lxc-1.0 from the tar file
from http://linuxcontainers.org/downloads/

I had run this:
./configure --enable-python --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib

lxc-ls
Traceback (most recent call last):
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
I also tried without --enable-python (though it seems to me not needed at all):

./configure --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib


lxc-ls
Traceback (most recent call last):
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'

Any ideas ?
I would appreciate if somebody will test it on his machine (Ubunut/other) and
tell me it does work (and on which distro and the distro version)

Kevin
Tamas Papp
2014-02-23 20:06:07 UTC
Permalink
Post by Kevin Wilson
Hello,
lxc-ls, which is a python script, is created both when using
--enable-python and when not using --enable-python in ./configure.
And in fact, --enable-python is not needed so that it will work.
Probably yes, --enable-python should be default, though personally I've
never tried it.
Post by Kevin Wilson
Please let me know if I am correct in this (and I would appreciate if
somebody will elaborate about what is --enable-python for).
lxc-ls uses via python api.
Post by Kevin Wilson
Second, I have a Fedora 20 x86_64 machine on which docker is
installed; as part of
docker rpm installation, it installs lxc 0.9.
I want to do tests with lxc-1.0 on this machine without
removing docker, so I had installed lxc-1.0 from the tar file
from http://linuxcontainers.org/downloads/
./configure --enable-python --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
./configure --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
Any ideas ?
You need to install python module to its appropriate place (or set it up
properly).
Post by Kevin Wilson
I would appreciate if somebody will test it on his machine (Ubunut/other) and
tell me it does work (and on which distro and the distro version)
On ubuntu it looks like this:

/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python3-lxc
/usr/share/doc/python3-lxc/copyright
/usr/share/doc/python3-lxc/examples
/usr/share/doc/python3-lxc/examples/pyconsole.py
/usr/share/doc/python3-lxc/examples/pyconsole-vte.py
/usr/share/doc/python3-lxc/examples/api_test.py.gz
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/lxc
/usr/lib/python3/dist-packages/lxc/__init__.py
/usr/lib/python3/dist-packages/_lxc.cpython-34m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/_lxc-0.1.egg-info
/usr/lib/python3/dist-packages/_lxc.cpython-33m-x86_64-linux-gnu.so
/usr/share/doc/python3-lxc/changelog.Debian.gz


tamas
Kevin Wilson
2014-02-23 20:15:32 UTC
Permalink
Thanks,
Following your answer:
After
yum install -y python3-lxc
the problem disappeared.


This rpm consists of:
/usr/lib64/python3.3/site-packages/_lxc-0.1-py3.3.egg-info
/usr/lib64/python3.3/site-packages/_lxc.cpython-33m.so
/usr/lib64/python3.3/site-packages/lxc
/usr/lib64/python3.3/site-packages/lxc/__init__.py

Kevin
Post by Tamas Papp
Post by Kevin Wilson
Hello,
lxc-ls, which is a python script, is created both when using
--enable-python and when not using --enable-python in ./configure.
And in fact, --enable-python is not needed so that it will work.
Probably yes, --enable-python should be default, though personally I've
never tried it.
Post by Kevin Wilson
Please let me know if I am correct in this (and I would appreciate if
somebody will elaborate about what is --enable-python for).
lxc-ls uses via python api.
Post by Kevin Wilson
Second, I have a Fedora 20 x86_64 machine on which docker is
installed; as part of
docker rpm installation, it installs lxc 0.9.
I want to do tests with lxc-1.0 on this machine without
removing docker, so I had installed lxc-1.0 from the tar file
from http://linuxcontainers.org/downloads/
./configure --enable-python --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
./configure --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
Any ideas ?
You need to install python module to its appropriate place (or set it up
properly).
Post by Kevin Wilson
I would appreciate if somebody will test it on his machine (Ubunut/other) and
tell me it does work (and on which distro and the distro version)
/.
/usr
/usr/share
/usr/share/doc
/usr/share/doc/python3-lxc
/usr/share/doc/python3-lxc/copyright
/usr/share/doc/python3-lxc/examples
/usr/share/doc/python3-lxc/examples/pyconsole.py
/usr/share/doc/python3-lxc/examples/pyconsole-vte.py
/usr/share/doc/python3-lxc/examples/api_test.py.gz
/usr/lib
/usr/lib/python3
/usr/lib/python3/dist-packages
/usr/lib/python3/dist-packages/lxc
/usr/lib/python3/dist-packages/lxc/__init__.py
/usr/lib/python3/dist-packages/_lxc.cpython-34m-x86_64-linux-gnu.so
/usr/lib/python3/dist-packages/_lxc-0.1.egg-info
/usr/lib/python3/dist-packages/_lxc.cpython-33m-x86_64-linux-gnu.so
/usr/share/doc/python3-lxc/changelog.Debian.gz
tamas
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
Stéphane Graber
2014-02-23 21:06:32 UTC
Permalink
Post by Kevin Wilson
Hello,
lxc-ls, which is a python script, is created both when using
--enable-python and when not using --enable-python in ./configure.
And in fact, --enable-python is not needed so that it will work.
Please let me know if I am correct in this (and I would appreciate if
somebody will elaborate about what is --enable-python for).
Second, I have a Fedora 20 x86_64 machine on which docker is
installed; as part of
docker rpm installation, it installs lxc 0.9.
I want to do tests with lxc-1.0 on this machine without
removing docker, so I had installed lxc-1.0 from the tar file
from http://linuxcontainers.org/downloads/
./configure --enable-python --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
./configure --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
All options are enabled by default if the requirements for the option
are met.

Since you appear to have the python3 headers installed on your system,
--enable-python or not, the result is the same and the configuration
output at the end of the configure script should tell you as much.

To disable python3 and instead get the shell lxc-ls replacement, you
need to pass --disable-python to configure.
Post by Kevin Wilson
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
Any ideas ?
I would appreciate if somebody will test it on his machine (Ubunut/other) and
tell me it does work (and on which distro and the distro version)
Kevin
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
--
St?phane Graber
Ubuntu developer
http://www.ubuntu.com
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140223/03b05741/attachment.pgp>
Kevin Wilson
2014-02-24 13:29:45 UTC
Permalink
Thanks, Stephane,

I just want to let you know that
./configure --disable-python --prefix=/test --with-config-path=/test/var/lib/lxc
and then
lxc-create -n mybb -t busybox
and
lxc-ls
does show it the container I created

regards,
Kevin
Post by Stéphane Graber
Post by Kevin Wilson
Hello,
lxc-ls, which is a python script, is created both when using
--enable-python and when not using --enable-python in ./configure.
And in fact, --enable-python is not needed so that it will work.
Please let me know if I am correct in this (and I would appreciate if
somebody will elaborate about what is --enable-python for).
Second, I have a Fedora 20 x86_64 machine on which docker is
installed; as part of
docker rpm installation, it installs lxc 0.9.
I want to do tests with lxc-1.0 on this machine without
removing docker, so I had installed lxc-1.0 from the tar file
from http://linuxcontainers.org/downloads/
./configure --enable-python --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
./configure --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
All options are enabled by default if the requirements for the option
are met.
Since you appear to have the python3 headers installed on your system,
--enable-python or not, the result is the same and the configuration
output at the end of the configure script should tell you as much.
To disable python3 and instead get the shell lxc-ls replacement, you
need to pass --disable-python to configure.
Post by Kevin Wilson
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
Any ideas ?
I would appreciate if somebody will test it on his machine (Ubunut/other) and
tell me it does work (and on which distro and the distro version)
Kevin
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
--
St?phane Graber
Ubuntu developer
http://www.ubuntu.com
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
Alvaro Miranda Aguilera
2014-02-25 19:46:53 UTC
Permalink
for the rpm part, you can do make rpm after the make and update the lxc
that came/require docker..
Post by Kevin Wilson
Thanks, Stephane,
I just want to let you know that
./configure --disable-python --prefix=/test
--with-config-path=/test/var/lib/lxc
and then
lxc-create -n mybb -t busybox
and
lxc-ls
does show it the container I created
regards,
Kevin
Post by Stéphane Graber
Post by Kevin Wilson
Hello,
lxc-ls, which is a python script, is created both when using
--enable-python and when not using --enable-python in ./configure.
And in fact, --enable-python is not needed so that it will work.
Please let me know if I am correct in this (and I would appreciate if
somebody will elaborate about what is --enable-python for).
Second, I have a Fedora 20 x86_64 machine on which docker is
installed; as part of
docker rpm installation, it installs lxc 0.9.
I want to do tests with lxc-1.0 on this machine without
removing docker, so I had installed lxc-1.0 from the tar file
from http://linuxcontainers.org/downloads/
./configure --enable-python --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
I also tried without --enable-python (though it seems to me not needed
./configure --prefix=/test
make && make install
export PATH=/test/bin:$PATH
export LD_LIBRARY_PATH=/test/lib
All options are enabled by default if the requirements for the option
are met.
Since you appear to have the python3 headers installed on your system,
--enable-python or not, the result is the same and the configuration
output at the end of the configure script should tell you as much.
To disable python3 and instead get the shell lxc-ls replacement, you
need to pass --disable-python to configure.
Post by Kevin Wilson
lxc-ls
File "/test/bin/lxc-ls", line 31, in <module>
import lxc
ImportError: No module named 'lxc'
Any ideas ?
I would appreciate if somebody will test it on his machine
(Ubunut/other) and
Post by Stéphane Graber
Post by Kevin Wilson
tell me it does work (and on which distro and the distro version)
Kevin
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
--
St?phane Graber
Ubuntu developer
http://www.ubuntu.com
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
_______________________________________________
lxc-users mailing list
lxc-users at lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-users
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.linuxcontainers.org/pipermail/lxc-users/attachments/20140226/6b7ae2e1/attachment.html>
Loading...