-
Notifications
You must be signed in to change notification settings - Fork 334
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
TypeError: cannot pickle '_io.TextIOWrapper' object #961
Comments
I ran into the same issue. If you use another interpreter (python 3.7 for instance) all is well. This is a problem specifically with Python 3.8 Google Cloud SDK 281.0.0 |
Bug is still there Google Cloud SDK 283.0.0 |
Still exists now, only on multiprocessing flag, runs fine without Google Cloud SDK 286.0.0 |
Tracking this down, this error comes from a change in Python 3.8 in the multiprocessing library:
Spawn is being run for those using MacOs and Python 3.8+ by default since nothing is explicitly set either through |
The issue still presents with Cloud SDK 302.0.0 (gsutil 4.52), on macOS 10.15.6 with Python 3.8.5 installed from homebrew |
One workaround is to use the Python 3 interpreter shipped with macOS |
gsutil does not work with python 3.8, force it to use python 3.7 with something like
|
@aleb I'm not sure if this is specific to Mac Mojave, but the path for python3 for me was
From the link @caizixian provided,
|
Another workaround on macOS is to
|
@dinvlad That worked for me! Thank you so much |
@dinvlad Thank you! Works perfectly! |
With such a strange "pickle" error, I didn't expect to find my resolution so quickly. Thank you, @dinvlad!! |
export CLOUDSDK_PYTHON=/usr/bin/python2.7 will work ! export CLOUDSDK_PYTHON=/usr/bin/python3 or export CLOUDSDK_PYTHON=path/for/python3.7 will solve the current issue but will run into module 'sys' has no attribute 'maxint' error. |
While I recognize comments like "Is tHiS fiXEd??" are not helpful — would it be possible for someone on the Google side to acknowledge this is a bug in gsutil and plan to resolve? Currently, IIUC, gsutil breaks on python 3.8 — a version released a year ago, and the default brew version. Workarounds like installing another version of python are not small adjustments, and difficult for less technical colleagues. There are 49 👍s on the issue. |
Sorry for the delay. We are aware of this bug and we are working on releasing this workaround soon #1107 |
Another workaround would be to disable multiprocessing altogether when using Python 3.8. This can be done either by setting the
This will be relatively slow as it will be using a single process, however, multithreading will be still ON. |
That's an excellent workaround, thanks @dilipped ! |
updating gsutil solved the issue with python3.8 |
It works fine to me |
gsutil version: 4.47
The text was updated successfully, but these errors were encountered: