uoip / g2opy

Python binding of SLAM graph optimization framework g2o
668 stars 176 forks source link

I met this problem when run python setup.py install #65

Open s8088899 opened 2 years ago

s8088899 commented 2 years ago

error: Multiple top-level packages discovered in a flat-layout: ['g2o', 'lib', 'script', 'contrib', 'EXTERNAL', 'cmake_modules'].

To avoid accidental inclusion of unwanted files or directories, setuptools will not proceed with this build.

If you are trying to create a single distribution with multiple packages on purpose, you should not rely on automatic discovery. Instead, consider the following options:

  1. set up custom discovery (find directive with include or exclude)
  2. use a src-layout
  3. explicitly set py_modules or packages with a list of names

To find more information, look for "package discovery" on setuptools docs.

RTae commented 2 years ago

@s8088899 I'm also face with this issue same as you. In addition, did your computer arch tech is arm64 ?

RTae commented 2 years ago

@s8088899 I found the solution !! use this script below instead

sudo python3 setup.py install

However, my recommendation you should copy the file name "g2o.cpython-{python-version}-{arch}.so" in g2opy/lib folder into [path-to-python-lib]/lib/python{python-version-which-you-use}/site-package

MarceloContreras commented 2 years ago

Two solutions have gave me good results:

  1. Just as @RTae said, you can move manually "g2o.so" to your python package folder. Be careful if you are using a conda enviorement, because then the env itself has its package folder.
  2. Downgrade installed setuptool version to 58.2.0 with this command:

pip install setuptools==58.2.0

s8088899 commented 1 year ago

Thanks a lot!I already solve this problem by improving the network environment and virtual machine versions.

robofar commented 4 months ago

Package is installed, but when I run conda list | grep g2o why it cannot "see" this package?