question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Python 3.8 support

See original GitHub issue

I know that Django doesn’t officially support Python 3.8 yet, but I tried an upgrade anyway. Django seems to work fine and our project is happy, but qcluster crashes on start with:

TypeError: cannot pickle '_thread.lock' object

Seems to be related to multiprocessing changes in py38. As far as I can tell at this early stage, it only seems to crash on MacOS, while Linux is fine (our Linux developers had no problem and our server deploys were fine, but MacOS devs all experienced this crash).

Discussion of this started in #313, but this is a separate issue.

Issue Analytics

  • State:open
  • Created 4 years ago
  • Reactions:6
  • Comments:9 (2 by maintainers)

github_iconTop GitHub Comments

19reactions
roharveycommented, Sep 4, 2020

As @Solanar said, this is related to the start method. A very simple workaround is to include this in startup (windows or OS X, but should be a no-op in linux):

from multiprocessing import set_start_method
set_start_method("fork")

The reason this shows up in python3.8 is because the default multiprocessing method changed: https://docs.python.org/3/whatsnew/3.8.html#multiprocessing

3reactions
jeroenbrouwercommented, Sep 26, 2020

As @Solanar said, this is related to the start method. A very simple workaround is to include this in startup (windows or OS X, but should be a no-op in linux):

from multiprocessing import set_start_method
set_start_method("fork")

The reason this shows up in python3.8 is because the default multiprocessing method changed: https://docs.python.org/3/whatsnew/3.8.html#multiprocessing

Thanks for the suggestion! I’ve added the following snippet to my manage.py and it works 😃

import platform
if platform.system() != "Linux":
    from multiprocessing import set_start_method
    set_start_method("fork")
Read more comments on GitHub >

github_iconTop Results From Across the Web

Status of Python Versions - Python Developer's Guide
The latest release for each Python version can be found on the download page. ... Python 3.3 Python 3.4 Python 3.5 Python 3.6...
Read more >
Python - endoflife.date
Release Released Security Support 3.11 1 month and 3 weeks ago. (24 Oct 2022) Ends in 4 years and 10 months. (24 Oct 2... 3.10...
Read more >
Python 3.8 support table for most popular Python packages
Python 3.8 is a currently supported version of Python . This site shows Python 3.8 support for the 360 most downloaded packages on...
Read more >
Chapter 38. Installing and using Python Red Hat Enterprise ...
Note that parallel installation is not supported for multiple streams within a single module. You can install Python 3.8 and Python 3.9, including...
Read more >
Which Python Versions Does ActiveState Support?
While the Python 2 programming language reached End of Life (EOL) in January 2020 and is no longer supported by the open source...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found