Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

use lcm for python ,when import lcm.the code cannot regonize the package, but i cmake ,make ,make install ,and ldconfig.How should i do? #298

Open
Dave11233 opened this issue Nov 21, 2019 · 9 comments

Comments

@Dave11233
Copy link

No description provided.

@hoxell
Copy link
Contributor

hoxell commented Nov 21, 2019

Well, what did cmake tell you about python bindings? Did it say in the summary that it's missing relevant python paths?

@Dave11233
Copy link
Author

Well, what did cmake tell you about python bindings? Did it say in the summary that it's missing relevant python paths?

when i run cmake ,it occurs as follows:
-- Found PythonInterp: /usr/bin/python (found version "3.5.2") 
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found version "3.5.2") 
-- Found Python: /usr/bin/python 

and the i run :
make
sudo make install 
sudo ldconfig
it is ok,but when i use python and import lcm ,i can not find the related package.

@hoxell
Copy link
Contributor

hoxell commented Nov 22, 2019

Looks okay. Could you provide more information about your setup/environment, any errors, if you have multiple python versions etc.?

@Dave11233
Copy link
Author

Looks okay. Could you provide more information about your setup/environment, any errors, if you have multiple python versions etc.?

okay , in the ubuntu there is tow version python ,but i use ln -s to use python3 for the final python and i think you guss that i install the lcm in python2, i run python2 and in the end ,there is no packge lcm and it throws import error

@Dave11233
Copy link
Author

Looks okay. Could you provide more information about your setup/environment, any errors, if you have multiple python versions etc.?

when i run make, it occurs as follows:

-- The C compiler identification is GNU 5.4.0
-- The CXX compiler identification is GNU 5.4.0
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Found GLib2_glib: /usr/lib/x86_64-linux-gnu/libglib-2.0.so
-- Found GLib2: /usr/lib/x86_64-linux-gnu/libglib-2.0.so found components: glib
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__std_gnu99
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__std_gnu99 - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wall
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wall - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wshadow
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wshadow - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wuninitialized
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wuninitialized - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wunused_variable
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wunused_variable - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Werror_return_type
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Werror_return_type - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_unused_parameter
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_unused_parameter - Success
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_format_zero_length
-- Performing Test CMAKE_C_COMPILER_SUPPORTS__Wno_format_zero_length - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wall
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wall - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wshadow
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wshadow - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wuninitialized
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wuninitialized - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wunused_variable
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wunused_variable - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Werror_return_type
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Werror_return_type - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_unused_parameter
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_unused_parameter - Success
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_format_zero_length
-- Performing Test CMAKE_CXX_COMPILER_SUPPORTS__Wno_format_zero_length - Success
-- Building LCM 1.4.0 (ABI v1)
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Looking for pthread_create
-- Looking for pthread_create - not found
-- Looking for pthread_create in pthreads
-- Looking for pthread_create in pthreads - not found
-- Looking for pthread_create in pthread
-- Looking for pthread_create in pthread - found
-- Found Threads: TRUE
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY
-- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR
-- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success
-- 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")
-- Found PythonInterp: /usr/bin/python (found version "3.5.2")
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found version "3.5.2")
-- Found Python: /usr/bin/python
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/cch/lcm/build/packages
-- Configuring done
-- Generating done
-- Build files have been written to: /home/cch/lcm/build

when i run sudo make install,it occurs as follow:
-- Install configuration: ""
-- Installing: /usr/local/lib/lcm/cmake/lcmTargets.cmake
-- Installing: /usr/local/lib/lcm/cmake/lcmTargets-noconfig.cmake
-- Installing: /usr/local/lib/lcm/cmake/lcmConfig.cmake
-- Installing: /usr/local/lib/lcm/cmake/lcmConfigVersion.cmake
-- Installing: /usr/local/lib/lcm/cmake/lcmUtilities.cmake
-- Installing: /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
-- Installing: /usr/local/include/lcm/lcm_export.h
-- Installing: /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
-- Installing: /usr/local/bin/lcm-gen
-- Up-to-date: /usr/local/share/man/man1/lcm-gen.1
-- Installing: /usr/local/bin/lcm-logger
-- Set runtime path of "/usr/local/bin/lcm-logger" to ""
-- Installing: /usr/local/bin/lcm-logplayer
-- Set runtime path of "/usr/local/bin/lcm-logplayer" to ""
-- Up-to-date: /usr/local/share/man/man1/lcm-logger.1
-- Up-to-date: /usr/local/share/man/man1/lcm-logplayer.1
-- Installing: /usr/local/bin/lcm-sink
-- Set runtime path of "/usr/local/bin/lcm-sink" to ""
-- Installing: /usr/local/bin/lcm-source
-- Set runtime path of "/usr/local/bin/lcm-source" to ""
-- Installing: /usr/local/bin/lcm-tester
-- Set runtime path of "/usr/local/bin/lcm-tester" to ""
-- Installing: /usr/local/bin/lcm-example
-- Set runtime path of "/usr/local/bin/lcm-example" to ""
-- Installing: /usr/local/bin/lcm-logfilter
-- Set runtime path of "/usr/local/bin/lcm-logfilter" to ""
-- 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
-- Installing: /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
-- Installing: /usr/local/lib/pkgconfig/lcm.pc

and i import lcm, and run help(lcm),it occurs as follows:
Help on package lcm:

NAME
lcm

PACKAGE CONTENTS
liblcm

FILE
(built-in)

@hoxell
Copy link
Contributor

hoxell commented Nov 22, 2019

Dude, you didn't answer any of my questions 😆
What is the error message(s) and what python version are you importing it from? (I want to exclude the possibility that you're generating the wrappers for a different python installation than you're importing it from.)
Can you share some code that is failing? Is it the import that's failing (seems like you can import it, based on your most recent answer) or some lcm related method?

@Dave11233
Copy link
Author

Dude, you didn't answer any of my questions 😆
What is the error message(s) and what python version are you importing it from? (I want to exclude the possibility that you're generating the wrappers for a different python installation than you're importing it from.)
Can you share some code that is failing? Is it the import that's failing (seems like you can import it, based on your most recent answer) or some lcm related method?

i am so sorry ,i use python with version 3 ,and i can import lcm but when i use the module lcm.EventLog , throwing a error that no module error .

@hoxell
Copy link
Contributor

hoxell commented Nov 23, 2019

You can have several versions of python 3 installed. In the future, you can get the python version with

$ python --version

and you should report the full output/version when someone asks about what version you're running. This time that's not needed since the issue isn't related to having multiple versions installed.

Furthermore, you still haven't shared the part of the code that you want help with and EventLog is a class and not a module.

I'm not gonna spend any more time on this thread until you share a minimal, workable example (i.e. some minimal code to reproduce your issue), the output it generates (e.g. any errors, and please copy-paste instead of writing in your own words what the error is) and possibly a clear statement of what's the issue you want help with if that's not obvious from the program output.

Finally, I'm pretty certain this isn't an LCM issue at all, but a matter of usage and that shouldn't be reported as an issue.

@Dave11233
Copy link
Author

You can have several versions of python 3 installed. In the future, you can get the python version with

$ python --version

and you should report the full output/version when someone asks about what version you're running. This time that's not needed since the issue isn't related to having multiple versions installed.

Furthermore, you still haven't shared the part of the code that you want help with and EventLog is a class and not a module.

I'm not gonna spend any more time on this thread until you share a minimal, workable example (i.e. some minimal code to reproduce your issue), the output it generates (e.g. any errors, and please copy-paste instead of writing in your own words what the error is) and possibly a clear statement of what's the issue you want help with if that's not obvious from the program output.

Finally, I'm pretty certain this isn't an LCM issue at all, but a matter of usage and that shouldn't be reported as an issue.

thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants