lcm-proj / lcm

Lightweight Communications and Marshalling
GNU Lesser General Public License v2.1
980 stars 388 forks source link

lcm-python: No module named 'lcm' #348

Open dlee640 opened 3 years ago

dlee640 commented 3 years ago

I know this question was asked in this thread, where most people responded to the solution of going into lcm-python directory and running...

$ python setup.py install or $ python3 setup.py install

This solution did not work for me, and I think it is the issue with python and lcm path, or something else that I am not aware of. I am posting the results of running cmake, make, and make install below.

This is the result of running $ cmake ..

dlee640@dlee640-ThinkPad-T580:~/lcm/build$ cmake .. CMake Warning (dev) at /home/dlee640/.local/lib/python3.6/site-packages/cmake/data/share/cmake-3.18/Modules/FindPackageHandleStandardArgs.cmake:273 (message): The package name passed to find_package_handle_standard_args (GLib2_glib) does not match the name of the calling package (GLib2). This can lead to problems in calling code that expects find_package result variables (e.g., _FOUND) to follow a certain pattern. Call Stack (most recent call first): cmake/FindGLib2.cmake:47 (find_package_handle_standard_args) cmake/FindGLib2.cmake:74 (_glib2_add_target) CMakeLists.txt:10 (find_package) This warning is for project developers. Use -Wno-dev to suppress it.

-- Building LCM 1.4.0 (ABI v1) CMake Warning at docs/CMakeLists.txt:5 (message): Doxygen was not found; documentation generation will be incomplete

-- Could NOT find Java (missing: Java_JAVA_EXECUTABLE Java_JAR_EXECUTABLE Java_JAVAC_EXECUTABLE Java_JAVAH_EXECUTABLE Java_JAVADOC_EXECUTABLE) (Required is at least version "1.6") CMake Warning at lcm-python/CMakeLists.txt:57 (message): epydoc was not found; Python documentation will not be generated

-- Could NOT find Lua (missing: LUA_LIBRARIES LUA_INCLUDE_DIR) Unable to parse the Go version string: -- Could NOT find Go (missing: GO_VERSION GO_PLATFORM GO_ARCH) -- CPack: Packages will be placed under /home/dlee640/lcm/build/packages -- Configuring done -- Generating done -- Build files have been written to: /home/dlee640/lcm/build

This is the result of running $ make

dlee640@dlee640-ThinkPad-T580:~/lcm/build$ make [ 1%] Built target lcm_use_file [ 10%] Built target lcm [ 19%] Built target lcm-static [ 28%] Built target lcm-gen [ 30%] Built target lcm-logger [ 32%] Built target lcm-logplayer [ 33%] Built target lcm-source [ 35%] Built target lcm-buftest-sender [ 36%] Built target lcm-example [ 38%] Built target lcm-logfilter [ 40%] Built target lcm-tester [ 41%] Built target lcm-buftest-receiver [ 43%] Built target lcm-sink [ 46%] Built target lcm-python [ 47%] Built target lcm-python-init [ 48%] Built target gtest [ 50%] Built target gtest_main [ 58%] Built target lcm-test-types-c.sources [ 76%] Built target lcm-test-types-c [ 79%] Built target test-c-server [ 81%] Built target test-c-memq_test [ 83%] Built target test-c-client [ 85%] Built target test-c-eventlog_test [ 87%] Built target test-c-udpm_test [ 95%] Built target lcm-test-types-cpp.sources [ 98%] Built target test-cpp-memq_test [100%] Built target test-cpp-client

This is the result of running $ sudo make install

dlee640@dlee640-ThinkPad-T580:~/lcm/build$ sudo make install [sudo] password for dlee640: [ 1%] Built target lcm_use_file [ 10%] Built target lcm [ 19%] Built target lcm-static [ 28%] Built target lcm-gen [ 30%] Built target lcm-logger [ 32%] Built target lcm-logplayer [ 33%] Built target lcm-source [ 35%] Built target lcm-buftest-sender [ 36%] Built target lcm-example [ 38%] Built target lcm-logfilter [ 40%] Built target lcm-tester [ 41%] Built target lcm-buftest-receiver [ 43%] Built target lcm-sink [ 46%] Built target lcm-python [ 47%] Built target lcm-python-init [ 48%] Built target gtest [ 50%] Built target gtest_main [ 58%] Built target lcm-test-types-c.sources [ 76%] Built target lcm-test-types-c [ 79%] Built target test-c-server [ 81%] Built target test-c-memq_test [ 83%] Built target test-c-client [ 85%] Built target test-c-eventlog_test [ 87%] Built target test-c-udpm_test [ 95%] Built target lcm-test-types-cpp.sources [ 98%] Built target test-cpp-memq_test [100%] Built target test-cpp-client Install the project... -- Install configuration: "" -- Up-to-date: /usr/local/lib/lcm/cmake/lcmTargets.cmake -- Installing: /usr/local/lib/lcm/cmake/lcmTargets-noconfig.cmake -- Up-to-date: /usr/local/lib/lcm/cmake/lcmConfig.cmake -- Up-to-date: /usr/local/lib/lcm/cmake/lcmConfigVersion.cmake -- Up-to-date: /usr/local/lib/lcm/cmake/lcmUtilities.cmake -- Up-to-date: /usr/local/lib/liblcm.a -- Up-to-date: /usr/local/include/lcm/eventlog.h -- Up-to-date: /usr/local/include/lcm/lcm.h -- Up-to-date: /usr/local/include/lcm/lcm_coretypes.h -- Up-to-date: /usr/local/include/lcm/lcm_version.h -- Up-to-date: /usr/local/include/lcm/lcm-cpp.hpp -- Up-to-date: /usr/local/include/lcm/lcm-cpp-impl.hpp -- Up-to-date: /usr/local/include/lcm/lcm_export.h -- Up-to-date: /usr/local/lib/liblcm.so.1.4.0 -- Up-to-date: /usr/local/lib/liblcm.so.1 -- Up-to-date: /usr/local/lib/liblcm.so -- Up-to-date: /usr/local/include/lcm/eventlog.h -- Up-to-date: /usr/local/include/lcm/lcm.h -- Up-to-date: /usr/local/include/lcm/lcm_coretypes.h -- Up-to-date: /usr/local/include/lcm/lcm_version.h -- Up-to-date: /usr/local/include/lcm/lcm-cpp.hpp -- Up-to-date: /usr/local/include/lcm/lcm-cpp-impl.hpp -- Up-to-date: /usr/local/include/lcm/lcm_export.h -- Up-to-date: /usr/local/bin/lcm-gen -- Up-to-date: /usr/local/share/man/man1/lcm-gen.1 -- Up-to-date: /usr/local/bin/lcm-logger -- Up-to-date: /usr/local/bin/lcm-logplayer -- Up-to-date: /usr/local/share/man/man1/lcm-logger.1 -- Up-to-date: /usr/local/share/man/man1/lcm-logplayer.1 -- Up-to-date: /usr/local/bin/lcm-sink -- Up-to-date: /usr/local/bin/lcm-source -- Up-to-date: /usr/local/bin/lcm-tester -- Up-to-date: /usr/local/bin/lcm-example -- Up-to-date: /usr/local/bin/lcm-logfilter -- Up-to-date: /usr/local/share/man/man1/lcm-example.1 -- Up-to-date: /usr/local/share/man/man1/lcm-sink.1 -- Up-to-date: /usr/local/share/man/man1/lcm-source.1 -- Up-to-date: /usr/local/share/man/man1/lcm-tester.1 -- Up-to-date: /usr/local/lib/python3/dist-packages/lcm/_lcm.so -- Up-to-date: /usr/local/lib/python3/dist-packages/lcm/init.py -- Up-to-date: /usr/local/share/aclocal/lcm.m4 -- Up-to-date: /usr/local/lib/pkgconfig/lcm.pc

It seems like cmake command returns warnings related to GLib2, Doxygen, Java, Lua, and Go. Could this lead to a python importation error? Please guide me in correct direction. :)

Thank you.

rgov commented 3 years ago

It's been a while since you posted this question, but I had success with cmake -DPYTHON_EXECUTABLE=$(which python3) ..