limap icon indicating copy to clipboard operation
limap copied to clipboard

install Ive error

Open Gotta-C opened this issue 2 years ago • 17 comments

python -m pip install -Ive . conda environment occurs error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /data/miniconda3/envs/limap/bin/python -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
#   import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
#   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
#     manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize

try:
    import setuptools
except ImportError as error:
    print(
        "ERROR: Can not execute `setup.py` since setuptools is not available in "
        "the build environment.",
        file=sys.stderr,
    )
    sys.exit(1)

__file__ = %r
sys.argv[0] = __file__

if os.path.exists(__file__):
    filename = __file__
    with tokenize.open(__file__) as f:
        setup_py_code = f.read()
else:
    filename = "<auto-generated setuptools caller>"
    setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/ali-nas/loc/limap/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
cwd: /ali-nas/loc/limap/

error: subprocess-exited-with-error

× python setup.py develop did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.

Gotta-C avatar Apr 23 '23 07:04 Gotta-C

Hi. I did not encounter this issue myself. Maybe this can help? https://github.com/pypa/packaging-problems/issues/573

B1ueber2y avatar Apr 23 '23 14:04 B1ueber2y

I hava try to build dockerfile and the limap-internal.git is missing so turn to conda environment. And I have seen the dockerfile update, I think that will solve my problem and thanks for the reply.

Gotta-C avatar Apr 24 '23 03:04 Gotta-C

I do use anaconda myself, so this should not be a problem. But glad that it works for you now : )

B1ueber2y avatar Apr 24 '23 08:04 B1ueber2y

Hello @B1ueber2y , I have also encountered the same mistake as @Gotta-C . May I ask what happened?

ccy-ustb avatar Apr 24 '23 14:04 ccy-ustb

Hi @LikeRain0 I have not encountered this issue before. May I ask what Python version you are using? Also, does this help? https://github.com/pypa/packaging-problems/issues/573

B1ueber2y avatar Apr 24 '23 15:04 B1ueber2y

My Python version is Python 3.9.10,and my pip version is pip 23.1.1. I think the key to the problem is “ERROR: Can not execute setup.py since setuptools is not available in the build environment.” I will try to find a solution.

ccy-ustb avatar Apr 25 '23 02:04 ccy-ustb

@LikeRain0 I think maybe the cuda image caused,the dockerfile based on nvidia/cuda:11.5.2-devel-ubuntu20.04,update dockerfile and add RUN pip install wheel before RUN the last line, the docker image build successfully, but I use A30 gpu cuda11.2 driver and A30 highest support cuda 11.4, so I rebuild based on nvidia/cuda:11.2.0-base-ubuntu18.04 and encountered the same problem again, that explain conda environment couldn't build because based on current cuda11.2 @B1ueber2y will you release a common image or uncoupled the cuda version?I have not find the submodules dependence

Gotta-C avatar Apr 25 '23 02:04 Gotta-C

@LikeRain0 I have try another machine with cuda 11.6 and all goes well. you can upgrade your cuda driver.

Gotta-C avatar Apr 25 '23 09:04 Gotta-C

OK, it is indeed related to the CUDA version. I have also updated the CUDA version to address this issue. It is recommended to explain it in readme @B1ueber2y

ccy-ustb avatar Apr 29 '23 12:04 ccy-ustb

hello, @Gotta-C , @B1ueber2y . Now,I have successfully configured it on my local computer, but now I am reconfiguring it on the server and the following issues have occurred when run “python -m pip install -Ive .”

` [ 24%] Building CXX object limap/CMakeFiles/limap.dir/base/linetrack.cc.o In file included from /home/ccy/ccy/limap/limap/util/types.h:10, from /home/ccy/ccy/limap/limap/base/camera.h:13, from /home/ccy/ccy/limap/limap/base/camera.cc:1: /home/ccy/ccy/limap/limap/base/camera.cc: In member function ‘void limap::Camera::set_max_image_dim(const int&)’: /home/ccy/ccy/limap/limap/base/camera.cc:204:20: error: ‘IsUndistorted’ was not declared in this scope 204 | THROW_CHECK_EQ(IsUndistorted(), true); | ^~~~~~~~~~~~~ /home/ccy/ccy/limap/limap/util/log_exceptions.h:84:43: note: in definition of macro ‘THROW_CHECK_OP’ 84 | __ThrowCheckOpImpl(FILE, LINE, (val1 op val2), val1, val2,
| ^~~~ /home/ccy/ccy/limap/limap/base/camera.cc:204:5: note: in expansion of macro ‘THROW_CHECK_EQ’ 204 | THROW_CHECK_EQ(IsUndistorted(), true); | ^~~~~~~~~~~~~~ [ 25%] Building CXX object limap/CMakeFiles/limap.dir/base/line_dists.cc.o /home/ccy/ccy/limap/limap/base/image_collection.cc: In member function ‘bool limap::ImageCollection::IsUndistorted() const’: /home/ccy/ccy/limap/limap/base/image_collection.cc:405:25: error: ‘const class limap::Camera’ has no member named ‘IsUndistorted’ 405 | if (!it->second.IsUndistorted()) | ^~~~~~~~~~~~~ make[2]: *** [limap/CMakeFiles/limap.dir/build.make:90: limap/CMakeFiles/limap.dir/base/camera.cc.o] Error 1 make[2]: *** Waiting for unfinished jobs.... make[2]: *** [limap/CMakeFiles/limap.dir/build.make:132: limap/CMakeFiles/limap.dir/base/image_collection.cc.o] Error 1 make[1]: *** [CMakeFiles/Makefile2:667: limap/CMakeFiles/limap.dir/all] Error 2 make: *** [Makefile:136: all] Error 2 Traceback (most recent call last): File "", line 2, in File "", line 34, in File "/home/ccy/ccy/limap/setup.py", line 68, in setup( File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/init.py", line 87, in setup return distutils.core.setup(**attrs) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 185, in setup return run_commands(dist) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/core.py", line 201, in run_commands dist.run_commands() File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 969, in run_commands self.run_command(cmd) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command super().run_command(command) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/command/develop.py", line 34, in run self.install_for_development() File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/command/develop.py", line 114, in install_for_development self.run_command('build_ext') File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/cmd.py", line 318, in run_command self.distribution.run_command(command) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/dist.py", line 1208, in run_command super().run_command(command) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/dist.py", line 988, in run_command cmd_obj.run() File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/command/build_ext.py", line 84, in run _build_ext.run(self) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/Cython/Distutils/old_build_ext.py", line 186, in run _build_ext.build_ext.run(self) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 346, in run self.build_extensions() File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/Cython/Distutils/old_build_ext.py", line 195, in build_extensions _build_ext.build_ext.build_extensions(self) File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 468, in build_extensions self._build_extensions_serial() File "/home/ccy/anaconda3/envs/limap/lib/python3.9/site-packages/setuptools/_distutils/command/build_ext.py", line 494, in _build_extensions_serial self.build_extension(ext) File "/home/ccy/ccy/limap/setup.py", line 61, in build_extension subprocess.check_call( File "/home/ccy/anaconda3/envs/limap/lib/python3.9/subprocess.py", line 373, in check_call raise CalledProcessError(retcode, cmd) subprocess.CalledProcessError: Command '['cmake', '--build', '.', '--parallel 8']' returned non-zero exit status 2. error: subprocess-exited-with-error

× python setup.py develop did not run successfully.
│ exit code: 1
╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.
full command: /home/ccy/anaconda3/envs/limap/bin/python -c '
exec(compile('"'"''"'"''"'"'
# This is <pip-setuptools-caller> -- a caller that pip uses to run setup.py
#
# - It imports setuptools before invoking setup.py, to enable projects that directly
#   import from `distutils.core` to work with newer packaging standards.
# - It provides a clear error message when setuptools is not installed.
# - It sets `sys.argv[0]` to the underlying `setup.py`, when invoking `setup.py` so
#   setuptools doesn'"'"'t think the script is `-c`. This avoids the following warning:
#     manifest_maker: standard file '"'"'-c'"'"' not found".
# - It generates a shim setup.py, for handling setup.cfg-only projects.
import os, sys, tokenize

try:
    import setuptools
except ImportError as error:
    print(
        "ERROR: Can not execute `setup.py` since setuptools is not available in "
        "the build environment.",
        file=sys.stderr,
    )
    sys.exit(1)

__file__ = %r
sys.argv[0] = __file__

if os.path.exists(__file__):
    filename = __file__
    with tokenize.open(__file__) as f:
        setup_py_code = f.read()
else:
    filename = "<auto-generated setuptools caller>"
    setup_py_code = "from setuptools import setup; setup()"

exec(compile(setup_py_code, filename, "exec"))
'"'"''"'"''"'"' % ('"'"'/home/ccy/ccy/limap/setup.py'"'"',), "<pip-setuptools-caller>", "exec"))' develop --no-deps
cwd: /home/ccy/ccy/limap/

error: subprocess-exited-with-error

× python setup.py develop did not run successfully. │ exit code: 1 ╰─> See above for output.

note: This error originates from a subprocess, and is likely not a problem with pip.`

But my Cmake version(3.26.3) and cuda version(11.6), as well as Python(3.9.16), torch(1.13.1), tochvision(0.14.1), and the ones I have successfully configured locally, are consistent.

Do you know what's going on here?

ccy-ustb avatar Jun 08 '23 12:06 ccy-ustb

i have meet the same problem, do u find a good solution?

RivaLei avatar Jun 27 '23 08:06 RivaLei

i have meet the same problem, do u find a good solution?

Hi @RivaLei , I have fixed this error by using Colmap 3.8 (release) https://github.com/colmap/colmap/releases

I think Colmap 3.8 dev version lead to linking error build.

quachconghoang avatar Jul 17 '23 03:07 quachconghoang

i have meet the same problem, do u find a good solution?

Hi @RivaLei , I have fixed this error by using Colmap 3.8 (release) https://github.com/colmap/colmap/releases

I think Colmap 3.8 dev version lead to linking error build.

Could you please explain how you specifically repaired it?@quachconghoang

Jzyyzj avatar Jul 19 '23 06:07 Jzyyzj

i have meet the same problem, do u find a good solution?

Hi @RivaLei , I have fixed this error by using Colmap 3.8 (release) https://github.com/colmap/colmap/releases I think Colmap 3.8 dev version lead to linking error build.

Could you please explain how you specifically repaired it?@quachconghoang

I see these crashes come from Cmake native build (C++ libs) from the submodules , so that becareful with environment & dependency.

I just carefully followed the Readme:

  1. Upgrade cmake > 3.17. (I'm using Ubuntu 20.04 so that i have to build and install cmake from source code),
  2. Build Colmap release version (Colmap on git - master will have some changes):
  • https://github.com/colmap/colmap/archive/refs/tags/3.8.zip
  • Tutorial: https://colmap.github.io/install.html#linux
  • I build Colmap with Cuda 11.8 (I think non-cuda is still ok)
  1. Python environment:
  • Use Conda to create new environment - I choose Python 3.10 for longterm use.
  • Install latest pytorch v1 (1.13.1) by conda is still ok.
  • Install requirements packages by using Pip (pypi) for most packages (I got similar crash when using all packages from conda).

Good luck.

quachconghoang avatar Jul 19 '23 07:07 quachconghoang

i have meet the same problem, do u find a good solution?

Hi @RivaLei , I have fixed this error by using Colmap 3.8 (release) https://github.com/colmap/colmap/releases

I think Colmap 3.8 dev version lead to linking error build.

@quachconghoang thx! i find that the g++ version is old in my case (limap needs g++9.x while mine is g++ 4.x). so i make it by updating the g++ version. it works for me.

i have meet the same problem, do u find a good solution?

Hi @RivaLei , I have fixed this error by using Colmap 3.8 (release) https://github.com/colmap/colmap/releases

I think Colmap 3.8 dev version lead to linking error build.

@quachconghoang thx! i have checked the verison of the colmap (3.8). Then i found that the g++ version is too old in my case ( limap needs g++ > 9.0 while mine is 4.x). so i update it. luckly, it works for me~

RivaLei avatar Jul 25 '23 14:07 RivaLei

I have success in python -m pip install -Ive . in my docker(ubuntu20.04) and when I run python -c "import limap" occurs error:

root@67318b:/home/limap# python -c "import limap" Traceback (most recent call last): File "", line 1, in File "/home/limap/limap/init.py", line 6, in from . import point2d File "/home/limap/limap/point2d/init.py", line 1, in from .superpoint import * File "/home/limap/limap/point2d/superpoint/init.py", line 1, in from .main import run_superpoint File "/home/limap/limap/point2d/superpoint/main.py", line 12, in from hloc import extract_features ModuleNotFoundError: No module named 'hloc'

I build Colmap(3.8) with Cuda 11.3, the torch is torch==1.12.0 torchvision==0.13.0, cmake is 3.23.0, python is 3.9. Can someone help me?

CuiYan27 avatar Jul 27 '23 10:07 CuiYan27

I have success in python -m pip install -Ive . in my docker(ubuntu20.04) and when I run python -c "import limap" occurs error:

root@67318b:/home/limap# python -c "import limap" Traceback (most recent call last): File "", line 1, in File "/home/limap/limap/init.py", line 6, in from . import point2d File "/home/limap/limap/point2d/init.py", line 1, in from .superpoint import * File "/home/limap/limap/point2d/superpoint/init.py", line 1, in from .main import run_superpoint File "/home/limap/limap/point2d/superpoint/main.py", line 12, in from hloc import extract_features ModuleNotFoundError: No module named 'hloc'

I build Colmap(3.8) with Cuda 11.3, the torch is torch==1.12.0 torchvision==0.13.0, cmake is 3.23.0, python is 3.9. Can someone help me?

As the error message suggest, you do not have hloc installed. Please check if the submodule Hierarchical-Localization is successfully pulled in third-party, and try pip install -r requirements.txt again (or just pip install -e third-party/Hierarchical-Localization).

MarkYu98 avatar Sep 20 '23 17:09 MarkYu98