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

Cannot import name 'std_data' from 'auvlib.data_tools' #93

Open
MichalMotylinski opened this issue Jan 19, 2023 · 6 comments
Open

Cannot import name 'std_data' from 'auvlib.data_tools' #93

MichalMotylinski opened this issue Jan 19, 2023 · 6 comments

Comments

@MichalMotylinski
Copy link

HI,
I am getting an error while trying to run a sample code.
ImportError: cannot import name 'std_data' from 'auvlib.data_tools' (/home/user126/Projects/auvlib/install/lib/auvlib/data_tools/init.py)

I am running Ubuntu 20.04 and I think I followed the building process correctly.

  1. sudo apt-get install libcereal-dev libglfw3-dev libtinyxml2-dev libboost-all-dev libopencv-dev xorg-dev
  2. git clone https://github.com/nilsbore/auvlib.git
  3. git submodule update --init
  4. mkdir build && cd build
  5. cmake -DCMAKE_INSTALL_PREFIX=../install ..
  6. make -j4 && make install

There are no errors during building apart from tinyxml2 and glfw.

When trying to run the sample code I am first adding path and then executing the sample code.
export PYTHONPATH=$PYTHONPATH:/home/user126/Projects/auvlib/install/lib

Are there any other dependencies needed or did I just missed a step while building?

Thanks!

@xyp8023
Copy link
Contributor

xyp8023 commented Feb 4, 2023

Hi,

It looks like you are doing alright, but can you import other libararies from data_tools such as xtf_data, csv_data and so on? Is std_data is the only one you cannot import or?

Btw, are you using conda?

@lbhqw
Copy link

lbhqw commented May 10, 2024

I use conda and meet the same problem. how to solve it?

@xyp8023
Copy link
Contributor

xyp8023 commented May 10, 2024

I use conda and meet the same problem. how to solve it?

If you are using conda, you need to specify it here:

set(PYTHON_EXECUTABLE /usr/bin/python3)

Check out this commit: 33b3970

@lbhqw
Copy link

lbhqw commented May 10, 2024

Thank you for your answer but there are still some problems:
cmake -DCMAKE_INSTALL_PREFIX=../install .. -DAUVLIB_USE_LIBIGL_TINYXML=ON -DAUVLIB_USE_LIBIGL_GLFW=ON
-- The C compiler identification is GNU 9.4.0
-- The CXX compiler identification is GNU 9.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 OpenCV: /usr (found version "4.2.0") found components: core highgui imgproc
CMake Warning (dev) at /usr/share/cmake-3.16/Modules/FindOpenGL.cmake:275 (message):
Policy CMP0072 is not set: FindOpenGL prefers GLVND by default when
available. Run "cmake --help-policy CMP0072" for policy details. Use the
cmake_policy command to set the policy and suppress this warning.

FindOpenGL found both a legacy GL library:

OPENGL_gl_LIBRARY: /usr/lib/x86_64-linux-gnu/libGL.so

and GLVND libraries for OpenGL and GLX:

OPENGL_opengl_LIBRARY: /usr/lib/x86_64-linux-gnu/libOpenGL.so
OPENGL_glx_LIBRARY: /usr/lib/x86_64-linux-gnu/libGLX.so

OpenGL_GL_PREFERENCE has not been set to "GLVND" or "LEGACY", so for
compatibility with CMake 3.10 and below the legacy GL library will be used.
Call Stack (most recent call first):
src/CMakeLists.txt:44 (find_package)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Found OpenGL: /usr/lib/x86_64-linux-gnu/libOpenGL.so
-- Looking for pthread.h
-- Looking for pthread.h - found
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD
-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Failed
-- 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
-- Creating target: igl::core (igl)
-- Found Git: /usr/bin/git (found version "2.25.1")
CMake Warning (dev) at src/libigl/external/embree/common/cmake/test.cmake:31 (SET):
implicitly converting 'INT' to 'STRING' type.
Call Stack (most recent call first):
src/libigl/external/embree/CMakeLists.txt:101 (INCLUDE)
This warning is for project developers. Use -Wno-dev to suppress it.

-- Creating target: igl::embree (igl_embree)
-- Creating target: igl::opengl (igl_opengl)
-- Creating target: igl::opengl_glfw (igl_opengl_glfw)
-- Using X11 for window creation
-- Found X11: /usr/include
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so
-- Looking for XOpenDisplay in /usr/lib/x86_64-linux-gnu/libX11.so;/usr/lib/x86_64-linux-gnu/libXext.so - found
-- Looking for gethostbyname
-- Looking for gethostbyname - found
-- Looking for connect
-- Looking for connect - found
-- Looking for remove
-- Looking for remove - found
-- Looking for shmat
-- Looking for shmat - found
-- Looking for IceConnectionNumber in ICE
-- Looking for IceConnectionNumber in ICE - found
-- Creating target: igl::xml (igl_xml)
-- Found Boost: /usr/lib/x86_64-linux-gnu/cmake/Boost-1.71.0/BoostConfig.cmake (found version "1.71.0") found components: system filesystem date_time
-- Found PythonInterp: /home/l/anaconda3/envs/lb1/bin/python (found version "3.8.19")
-- Found PythonLibs: /home/l/anaconda3/envs/lb1/lib/libpython3.8.so
-- pybind11 v2.4.dev4
Pybind11: /home/l/bathy_nn_learning-main/auvlib/src/pybind11/include
-- cxxopts version 2.2.0
Python dir:
-- Configuring done
CMake Error: install(EXPORT "BathyMapsConfig" ...) includes target "mesh_map" which requires target "glfw" that is not in any export set.
CMake Error: install(EXPORT "BathyMapsConfig" ...) includes target "mesh_map" which requires target "tinyxml2" that is not in any export set.
CMake Error: install(EXPORT "BathyMapsConfig" ...) includes target "align_map" which requires target "glfw" that is not in any export set.
CMake Error: install(EXPORT "BathyMapsConfig" ...) includes target "patch_draper" which requires target "glfw" that is not in any export set.
CMake Error: install(EXPORT "BathyMapsConfig" ...) includes target "view_draper" which requires target "glfw" that is not in any export set.
CMake Error: install(EXPORT "BathyMapsConfig" ...) includes target "map_draper" which requires target "glfw" that is not in any export set.
CMake Error: install(EXPORT "BathyMapsConfig" ...) includes target "sss_gen_sim" which requires target "glfw" that is not in any export set.
-- Generating done
CMake Generate step failed. Build files cannot be regenerated correctly.

@xyp8023
Copy link
Contributor

xyp8023 commented May 10, 2024

As we pointed out in the readme, you can ignore those errors and build and install the code.

Ignore the errors about the tinyxml2 and glfw targets not being in the export set; build files are still generated properly.

@WLXM0922
Copy link

HI, I am getting an error while trying to run a sample code. ImportError: cannot import name 'std_data' from 'auvlib.data_tools' (/home/user126/Projects/auvlib/install/lib/auvlib/data_tools/init.py)

I am running Ubuntu 20.04 and I think I followed the building process correctly.

1. sudo apt-get install libcereal-dev libglfw3-dev libtinyxml2-dev libboost-all-dev libopencv-dev xorg-dev

2. git clone https://github.com/nilsbore/auvlib.git

3. git submodule update --init

4. mkdir build && cd build

5. cmake -DCMAKE_INSTALL_PREFIX=../install ..

6. make -j4 && make install

There are no errors during building apart from tinyxml2 and glfw.

When trying to run the sample code I am first adding path and then executing the sample code. export PYTHONPATH=$PYTHONPATH:/home/user126/Projects/auvlib/install/lib

Are there any other dependencies needed or did I just missed a step while building?

Thanks!

Hello, have you solved your problem? I also encountered the same problem. auvlib was successfully installed, but when I tried to apply from auvlib. data _ tools to import std_data in an example, I got an error: the reference 'std_data' could not be found in ' imported module auvlib. data _ tools'.

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

4 participants