Picsart-AI-Research / LIVE-Layerwise-Image-Vectorization

[CVPR 2022 Oral] Towards Layer-wise Image Vectorization
https://arxiv.org/abs/2206.04655
Apache License 2.0
480 stars 50 forks source link

Meet error when using python setup.py install #11

Open DHUAVY opened 1 year ago

DHUAVY commented 1 year ago

I did not encounter this issue when using the original administrator account on the Linux virtual machine. However, when I switched to a newly created account and tried to build the environment using Miniconda, I encountered an error while using "python setup.py install": "Could NOT find PythonLibs (missing: PYTHON_LIBRARIES PYTHON_INCLUDE_DIRS)."

To resolve this issue, I modified line 41 in setup.py from: cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, '-DPYTHON_INCLUDE_PATH=' + include_path] to: cmake_args = ['-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=' + extdir, '-DPYTHON_INCLUDE_DIR=' + get_python_inc(), '-DPYTHON_LIBRARY=' + sysconfig.get_config_var('LIBDIR')].

DHUAVY commented 1 year ago

Of course, you should add import distutils.sysconfig as sysconfig and from distutils.sysconfig import get_python_inc

ahiliitb commented 5 months ago

It is still not working even after the suggested change and giving the same error as before, please can you check the code again and suggest some other changes for the error

ma-xu commented 5 months ago

@ahiliitb Please double-check your env and the error information.

Check more details here about installing diffvg: https://github.com/BachiLi/diffvg

ahiliitb commented 5 months ago

@ma-xu I am just running the colab file :https://colab.research.google.com/drive/1s108WmqSVH9MILOjSAu29QyAEjExOWAP?usp=sharing provided in the GitHub and then I am getting that error, I am not running on my local machine Please can you check the colab file

Spandan2003 commented 4 months ago

I am encountering a similar issue. The code given in the Google Colab file just gives an error when I Run All. The code block is:

!sudo apt-get install -y libsdl2-image-dev
!git submodule update --init --recursive
!python3 setup.py install
%cd ..

And the error received is:

 -- Configuring incomplete, errors occurred!
See also "/content/LIVE/DiffVG/build/temp.linux-x86_64-cpython-310/CMakeFiles/CMakeOutput.log".
Traceback (most recent call last):
  File "/content/LIVE/DiffVG/setup.py", line 91, in <module>
    setup(name = 'diffvg',
  File "/usr/local/lib/python3.10/dist-packages/setuptools/__init__.py", line 107, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 185, in setup
    return run_commands(dist)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/core.py", line 201, in run_commands
    dist.run_commands()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 969, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/command/install.py", line 80, in run
    self.do_egg_install()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/command/install.py", line 129, in do_egg_install
    self.run_command('bdist_egg')
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/command/bdist_egg.py", line 164, in run
    cmd = self.call_command('install_lib', warn_dir=0)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/command/bdist_egg.py", line 150, in call_command
    self.run_command(cmdname)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/command/install_lib.py", line 11, in run
    self.build()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/install_lib.py", line 111, in build
    self.run_command('build_ext')
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/cmd.py", line 318, in run_command
    self.distribution.run_command(command)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/dist.py", line 1244, in run_command
    super().run_command(command)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/dist.py", line 988, in run_command
    cmd_obj.run()
  File "/content/LIVE/DiffVG/setup.py", line 31, in run
    super().run()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/command/build_ext.py", line 84, in run
    _build_ext.run(self)
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 345, in run
    self.build_extensions()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 467, in build_extensions
    self._build_extensions_serial()
  File "/usr/local/lib/python3.10/dist-packages/setuptools/_distutils/command/build_ext.py", line 493, in _build_extensions_serial
    self.build_extension(ext)
  File "/content/LIVE/DiffVG/setup.py", line 64, in build_extension
    subprocess.check_call(['cmake', ext.sourcedir] + cmake_args, cwd=self.build_temp, env=env)
  File "/usr/lib/python3.10/subprocess.py", line 369, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['cmake', '/content/LIVE/DiffVG', '-DCMAKE_LIBRARY_OUTPUT_DIRECTORY=/content/LIVE/DiffVG/build/lib.linux-x86_64-cpython-310', '-DPYTHON_INCLUDE_PATH=/usr/include/python3.10', '-DCMAKE_BUILD_TYPE=Release', '-DDIFFVG_CUDA=1']' returned non-zero exit status 1.
/content/LIVE

This further causes an error where they say that DiffVG Module is not found. The entire code is the same as what is given in the google colab link on this Github Repo. Can anyone please help me with how I can solve this issue?