I met this problem when run python setup.py install
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:
- set up custom discovery (
finddirective withincludeorexclude) - use a
src-layout - explicitly set
py_modulesorpackageswith a list of names
To find more information, look for "package discovery" on setuptools docs.
@s8088899 I'm also face with this issue same as you. In addition, did your computer arch tech is arm64 ?
@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
Two solutions have gave me good results:
- 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.
- Downgrade installed setuptool version to 58.2.0 with this command:
pip install setuptools==58.2.0
Thanks a lot!I already solve this problem by improving the network environment and virtual machine versions.
Package is installed, but when I run conda list | grep g2o why it cannot "see" this package?