Fall back to serial mode does not work in current version
See original GitHub issueI tried to use joblib with Chaquopy, but Android does not have a functioning sem_open implementation, so I received the following warning as expected:
_multiprocessing_helpers.py:38: UserWarning: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.. joblib will operate in serial mode
With joblib 0.11, the import still succeeds. But with joblib 0.13.0 it fails, because joblib unconditionally imports loky, which unconditionally imports multiprocessing.synchronize.
Traceback from https://github.com/chaquo/chaquopy/issues/21#issuecomment-448568723 (edited for clarity):
File "/android_asset/chaquopy/requirements-common.zip/joblib/__init__.py", line 119, in <module>
from .parallel import Parallel
File "/android_asset/chaquopy/requirements-common.zip/joblib/parallel.py", line 33, in <module>
from .externals import loky
File "/android_asset/chaquopy/requirements-common.zip/joblib/externals/loky/__init__.py", line 11, in <module>
from .backend.context import cpu_count
File "/android_asset/chaquopy/requirements-common.zip/joblib/externals/loky/backend/__init__.py", line 13, in <module>
from multiprocessing import synchronize
File "stdlib/multiprocessing/synchronize.py", line 34, in <module>
ImportError: This platform lacks a functioning sem_open implementation, therefore, the required synchronization primitives needed will not function, see issue 3770.
Issue Analytics
- State:
- Created 5 years ago
- Reactions:5
- Comments:9
Top Results From Across the Web
Troubleshooting - ESP32-S3 - — esptool.py latest ...
No serial data received. Wrong boot mode detected (0xXX)! The chip needs to be in download mode. Download mode successfully detected, but getting...
Read more >Modem-HOWTO: Troubleshooting
Another reason may be that whatever is on the serial port (such as a modem, terminal, printer) doesn't work as fast as you...
Read more >Troubleshoot EC2Launch v2 - Amazon Elastic Compute Cloud
This section shows common troubleshooting scenarios for EC2Launch v2, information about viewing Windows event logs, and console log output and messages.
Read more >Troubleshooting using the serial console - Google Cloud
Install or update to the latest version of the Google Cloud CLI. ... troubleshoot an issue that occurs after VM has booted past...
Read more >Find your lost AirPods - Apple Support
About Find My · Locate your AirPods on a map · Play a sound on your AirPods · Get an alert if you...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Running this workaround before the import will allow it to succeed:
Of course, process-based parallelism will still not work if the underlying platform doesn’t support it, so you’ll have to use the
parallel_backend
context manager to use thread-based parallelism instead.Chaquopy 8.0.1 now has a workaround for this problem. Process-based parallelism is still unavailable, but joblib can at least be imported, and then you can use the
parallel_backend
context manager to use thread-based parallelism instead.To upgrade, edit your app’s top-level build.gradle file and change the version number of
com.chaquo.python:gradle
.