pangolin icon indicating copy to clipboard operation
pangolin copied to clipboard

Asserion error on running `python setup.py install`

Open lken01 opened this issue 5 years ago • 10 comments

Hi, I am getting this error on running python setup.py install

running install
Traceback (most recent call last):
  File "setup.py", line 49, in <module>
    graphical data."""
  File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 129, in setup
    return distutils.core.setup(**attrs)
  File "/usr/local/lib/python3.7/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/lib/python3.7/distutils/dist.py", line 966, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python3.7/distutils/dist.py", line 985, in run_command
    cmd_obj.run()
  File "setup.py", line 22, in run
    assert len(lib_file) == 1 and len(install_dirs) >= 1     
AssertionError

lken01 avatar Jun 02 '19 13:06 lken01

I found the solution. The setup.py had a correction to be made. The variable install_dirs has been initialized as install_dir.

lken01 avatar Jun 03 '19 11:06 lken01

I tried that but im still getting the same error, any ideas?

ZisisT avatar Jun 26 '19 16:06 ZisisT

you can just copy the .so file to your python lib path, or you can add install_dirs = [install_dir] to initialize install_dirs as a list.

KunB-Fighting avatar Oct 21 '19 09:10 KunB-Fighting

you can just copy the .so file to your python lib path, or you can add install_dirs = [install_dir] to initialize install_dirs as a list.

I was also struggling with this. @LeemeetElaine is completly right. Changing the code to this worked:

def run(self):
        install_dir = get_python_lib()
        install_dirs = [install_dir]

        lib_file = glob.glob(__library_file__)
        assert len(lib_file) == 1 and len(install_dirs) >= 1     

        print('copying {} -> {}'.format(lib_file[0], install_dirs[0]))
        shutil.copy(lib_file[0], install_dir)

Then running: sudo python3.6 setup.py install If you need sudo rights, e.g. dir is /usr/lib/... No sudo is required for most install dir locations when using virtual environments etc.

solbach avatar Nov 16 '19 18:11 solbach

I add install_dirs = [install_dir] but it still put the same error "AssertionError", I have struggled with pangolin in python for a day, tired.

zhufeng888 avatar May 10 '20 15:05 zhufeng888

@KunB-Fighting solution worked for me

just after install_dirs definition after install_dir

    def run(self):
        install_dir = get_python_lib()
        install_dirs = [install_dir]

running python setup.py install will copy the so file to my conda environment and then I used the demo application from the readme

note: I installed stevenlovegrove main pangolin before. I had a problem while building due to something missing dependency of eigen library but it was actually missing a dependecy for eigen3-devel in my system and it was not listed in the cmake

fsan avatar Nov 10 '20 15:11 fsan