uoip / pangolin

Python binding of 3D visualization library Pangolin
MIT License
285 stars 90 forks source link

install on ubuntu 18.04 LTS #7

Open fahamjv opened 6 years ago

fahamjv commented 6 years ago

gh0st@GH0ST:~/Desktop/pangolin$ python setup.py install running install Traceback (most recent call last): File "setup.py", line 49, in graphical data.""" File "/usr/local/lib/python2.7/dist-packages/setuptools/init.py", line 129, in setup return distutils.core.setup(**attrs) File "/usr/lib/python2.7/distutils/core.py", line 151, in setup dist.run_commands() File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "setup.py", line 22, in run assert len(lib_file) == 1 and len(install_dirs) >= 1
NameError: global name 'install_dirs' is not defined

Tien94 commented 6 years ago

Hi, Some modifies in setup.py worked for me, hope it also works for you. Please open the file "setup.py" in which there is a inconsistency in a variable's name. Particularly, in line 19 and line 25, it's " install_dir", meanwhile it's "install_dirs" in line 22 and 24. Correct them to a consistent name and reinstall it.

medakk commented 5 years ago

I also had to remove the array index. get_python_lib() is returning a single string:

diff --git a/setup.py b/setup.py
index 3be4a43..dfe69d2 100644
--- a/setup.py
+++ b/setup.py
@@ -19,9 +19,9 @@ class CopyLibFile(install):
         install_dir = get_python_lib()

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

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