jdber1 / opendrop

OpenDrop pendant drop tensiometry software
GNU General Public License v3.0
31 stars 20 forks source link

Installing on Ubuntu 20.04 (again...) #34

Closed ricotabor closed 3 years ago

ricotabor commented 3 years ago

Different computer, clean Ubuntu 20.04 installation, and following the install instructions, I get this error when trying to install OpenDrop. Python 3.8 is native python3, and SUNDIALS 5.7 and libboost1.73-dev seem to be in place. Any advice would be gratefully appreciated!

785FA532-9C32-4E11-AD22-9151429CCC18 D888F158-53D4-43D9-AD04-B415808A4E39

eugenhu commented 3 years ago

That's weird, looks like a problem with the python standard library (I think 3.8.10 is the newest python 3.8 available on Ubuntu 20.04 so updating to 3.8.11 now might not be easy). I've tried installing Python 3.8.10 on my machine and I'm not running into that error. I'll need to look into this a bit deeper and maybe add a workaround fix. I'm hoping to set up binary builds for linux (like on windows) to avoid build problems in the future.

I'm getting a new error at the moment that I'll need to figure out as well in case you run into it too

WARNING: Built wheel for opendrop is invalid: Wheel has unexpected file name: expected '3.3.1.dev19+g01cd397', got '3.3.1'

For now you could try a different python version but I'll let you know when I add a workaround to this (probably by rearranging the 'enum' import somewhere else).

ricotabor commented 3 years ago

Something has definitely gone strange. I tried also a totally fresh 18.04 installation, and get a very closely related error. Have tried all possible Python 3.x.

We have the current (?) version working on 18.04 in the other lab, so I'm wondering if there has been a package update since then that is causing us grief?

It feels like a Boost error with scons throwing an issue, but I'm honestly way outta my depth here!

25040974-B037-48E6-9A23-1C39614681CC

eugenhu commented 3 years ago

Hmm, that's really weird. I don't think anything has changed since last time, the problem now looks like a linking problem*

/usr/bin/ld: cannot find -lpython3.6

I'm working on creating an AppImage that should be as simple as downloading and double clicking to run. I should get this done in around 1-2 days and I'll send the file here later.

Sorry about the errors, who knew there was so many ways for things to not work.


*Possibly, the correct linker argument should be -lpython3.6m which would need modifying line 58 of 'opendrop/site_scons/site_tools/python.py'

https://github.com/jdber1/opendrop/blob/4c06e39dc2d4f8c2bfad4cf10f2c5f51c22a9bf7/site_scons/site_tools/python.py#L58

to (insert an m)

env['PYTHONLIB'] = 'python%s.%sm' % tuple(env['PYTHONVERSION'].split('.')[:2]) 

I currently can't try this but you can give it a go if you've got time.

Since python 3.8, the m suffix has been dropped, but perhaps a more robust solution for determining env['PYTHONLIB'] should check sys.abiflags.

eugenhu commented 3 years ago

I just realised I forgot to say, to make the above modifications, clone the repo

git clone https://github.com/jdber1/opendrop.git

And make the changes to the said file, cd into the source directory (directory containing the README.rst) and run

pip install .
eugenhu commented 3 years ago

Both issues should be fixed now (the screenshots in Ubuntu 20.04 and 18.04).

The first one seemed to be a local submodule 'types' shadowing a standard library module (also called 'types').

Second issue was the problem with the 'm' suffix which I've patched a solution by inspecting sys.abiflags.

Hopefully they install now without further problems.


I've created an experimental AppImage as well which you can try, should be able to run by just double clicking (might need to make it executable first with chmod +x OpenDrop-ea67f4a-x86_64.AppImage. (My version of pygobject has a bug that throws the error ValueError: invalid enum value: 5 in the Image preparation screen for some reason, this may freeze a camera preview, but can otherwise be ignored)

Link: https://github.com/jdber1/opendrop/releases/download/v3.3.0/OpenDrop-ea67f4a-x86_64.AppImage

ricotabor commented 3 years ago

Amazing, thank you! I can confirm from today's testing that adding the "m" suffix to the python.py file of a cloned repository did work on our old 18.04 install, and everything worked perfectly.

Interestingly, doing this on a fresh 18.04 install did allow install and functionality of opendrop, but Genicam could not find the same camera. The Genicam viewer can see + control the camera, so I've no idea what's up. It's actually the exact same hardware as the working 18.04 install (for complex reasons, we have two 18.04 installs on the same box).

We'll try the other options tomorrow and report back - thank you again!

eugenhu commented 3 years ago

Possibly genicam is no longer being installed automatically by pip when installing opendrop since it's been changed to an optional dependency (no python 3.9 support yet). Could try manually pip install genicam.

ricotabor commented 3 years ago

D'oh! Did not think to try that. Thank you! Will also try this, and report back on all matters.

Thanks again for the very rapid fixes, this is hugely appreciated.

ricotabor commented 3 years ago

Can confirm that pip install genicam magically fixed the new install - brilliant, thank you so much!

I'll get a chance to try the AppImage in a day or two, and will report back as soon as I can.