Bug #24622
closedNo module named rados
0%
Description
I have installed ceph from source code using these command:
sudo ./install-deps.sh
./do_cmake.sh
cd build/
make && sudo make install
But when I run /usr/local/bin/ceph -v, it failed with error:
Traceback (most recent call last):
File "/usr/local/bin/ceph", line 125, in <module>
import rados
ImportError: No module named rados
The version of ceph is 12.2.5 luminous. The OS is centos 7.
Updated by Abhishek Lekshmanan almost 6 years ago
- Project changed from rgw to Ceph
For development clusters it is recommended to use vstart which is mentioned in README of ceph repo. rados itself uses python bindings so PYTHONPATH needs to be checked if it points to python modules of ceph correcly
Updated by chang wan almost 6 years ago
Abhishek Lekshmanan wrote:
For development clusters it is recommended to use vstart which is mentioned in README of ceph repo. rados itself uses python bindings so PYTHONPATH needs to be checked if it points to python modules of ceph correcly
Thanks. Do you mean that it's need to set PYTHONPATH after make install? Here are some logs during make install. Is there any thing goes wrong?
running install
running install_lib
copying /data/ceph/ceph/build/lib/cython_modules/lib.2/rgw.so -> /usr/local/lib64/python2.7/site-packages
running install_egg_info
running egg_info
creating /data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info
writing /data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info/PKG-INFO
writing top-level names to /data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info/top_level.txt
writing dependency_links to /data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info/dependency_links.txt
writing manifest file '/data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info/SOURCES.txt'
reading manifest file '/data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file '/data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info/SOURCES.txt'
removing '/usr/local/lib64/python2.7/site-packages/rgw-2.0.0-py2.7.egg-info' (and everything under it)
Copying /data/ceph/ceph/build/src/pybind/rgw/rgw.egg-info to /usr/local/lib64/python2.7/site-packages/rgw-2.0.0-py2.7.egg-info
running install_scripts
writing list of installed files to '/dev/null'
running install
Checking .pth file support in /usr/local/lib/python2.7/site-packages/
/bin/python2.7 -E -c pass
TEST FAILED: /usr/local/lib/python2.7/site-packages/ does NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python2.7/site-packages/
and your PYTHONPATH environment variable currently contains:
''
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
Updated by Patrick Donnelly almost 6 years ago
- Project changed from Ceph to devops
- Priority changed from Normal to High
Updated by Nathan Cutler almost 6 years ago
- Assignee set to Nathan Cutler
@chang wan: Can you tell us which distro (including version) this is?
Presumably this part Checking .pth file support in /usr/local/lib/python2.7/site-packages/
should be fixed to say /usr/lib/python2.7/site-packages
Can you confirm that /usr/lib/python2.7/site-packages
is populated (lots of files and directories inside) in your system?
Updated by Nathan Cutler almost 6 years ago
Ah, correction - on my system the file "rados.so" (i.e. the one that is imported by "import rados") is installed in /usr/lib64/python2.7/site-packages
.
Updated by Nathan Cutler almost 6 years ago
chang wan: Can you try it again as you did above, except instead of ./do_cmake.sh
can you please use ./do_cmake.sh -DCMAKE_INSTALL_LIBDIR=/usr/lib64
Does this resolve the issue?
Updated by chang wan almost 6 years ago
@Nathan Weinberg Cutler: Thanks a lot. I will try this at weekend.
Updated by chang wan over 5 years ago
@Nathan Weinberg Cutler: I've tried these commands as your suggestion. But it doesn't work.
./do_cmake.sh -DCMAKE_INSTALL_LIBDIR=/usr/lib64
cd build
make && sudo make install
Updated by Nathan Cutler over 3 years ago
- Status changed from New to Closed
In case anyone is having problems building Ceph, please ask on dev@ceph.io mailing list and only open a bug report if someone there confirms it's a bug :-)