Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asserion error on running python setup.py install #20

Open
lken01 opened this issue Jun 2, 2019 · 11 comments
Open

Asserion error on running python setup.py install #20

lken01 opened this issue Jun 2, 2019 · 11 comments

Comments

@lken01
Copy link

lken01 commented Jun 2, 2019

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
Copy link
Author

lken01 commented Jun 3, 2019

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

@ZisisT
Copy link

ZisisT commented Jun 26, 2019

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

@KunB-Fighting
Copy link

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.

@solbach
Copy link

solbach commented Nov 16, 2019

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.

@zhufeng888
Copy link

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.

@fsan
Copy link

fsan commented Nov 10, 2020

@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

@harshitsinghcode
Copy link

same error !!

image

@harshitsinghcode
Copy link

@fsan @solbach

@fsan
Copy link

fsan commented Jul 11, 2024

not sure what you need @harshitsinghcode, but you should probably look into the main fork and/or then try to contact the authors. Last commit on this fork is like 7 years old already.
If the problem persists there, then you can collaborate with a patch to fix the problem

@harshitsinghcode
Copy link

I mentioned you because u also had the same error!

@yishaiSilver
Copy link

yishaiSilver commented Dec 6, 2024

I had this error because the build failed. I think it was trying to link the wrong python.

cmake .. -DPython_EXECUTABLE=`which python3` -DBUILD_PANGOLIN_FFMPEG=OFF

Worked for me on python 3.10

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants