googlecolab/colabtools

Upgrade to Python 3.10

metrizable opened this issue · 16 comments

Upgrade to Python 3.10

To provide additional features from Python 3.10 to our users, Colab has upgraded to Python 3.10. This upgrade provides benefits for the packages we pre-install in our runtime, and brings Colab into alignment with the cadence of final regular bug fix releases for Python versions.

Colab’s fallback runtime version

Using the fallback runtime version temporarily allows access to the last version of the runtime before the upgrade described above, and is available until mid-May. Its purpose is to provide a temporary mechanism for users to more smoothly upgrade their notebooks to be compatible with Colab’s current runtime version. This is available from the Command Palette via the "Use fallback runtime version" command when connected to a runtime. Of note, this setting does not persist across sessions – the command will need to be invoked on each new session.

Hey same fatal issue happened again. Talib libary failed to install.
It worked perfectly in this way before:
!wget https://launchpad.net/~mario-mariomedina/+archive/ubuntu/talib/+files/libta-lib0_0.4.0-oneiric1_amd64.deb -qO libta.deb !wget https://launchpad.net/~mario-mariomedina/+archive/ubuntu/talib/+files/ta-lib0-dev_0.4.0-oneiric1_amd64.deb -qO ta.deb !dpkg -i libta.deb ta.deb !pip install ta-lib import talib as ta
截屏2023-04-11 下午10 13 36

but today got error like this.

I've tried downgrade my numpy, but it doesn't fix!

Very interesting fall back notebook is 3.9.16 works, new prod env is also 3.9.16 but doesn't work

I am really hoping colab can provide fall back runtime as a permanent feature that will be super helpful!!!

@CbroLab the python 3.10 upgrade is not live yet. I believe that your error means that the version of talib on the ppa was compiled with a numpy release which is different from the one currently available on colab. That is not surprising, considering that the python version of colab (be it 3.9 ore 3.10) is different from the one shipped with ubuntu (3.8). Your best bet is to recompile talib rather than using the version from a ppa.

@CbroLab the python 3.10 upgrade is not live yet. I believe that your error means that the version of talib on the ppa was compiled with a numpy release which is different from the one currently available on colab. That is not surprising, considering that the python version of colab (be it 3.9 ore 3.10) is different from the one shipped with ubuntu (3.8). Your best bet is to recompile talib rather than using the version from a ppa.

then how can this being resolved? we can't just keep pushing forward and ignore these problems.

Updated, I found numpy version in fallback runtime and prod runtime are the same, but the error only occur in prod env, pls give a check. HUGE appreciation @metrizable @francesco-ballarin

@CbroLab I think what you are experiencing may be separate from the Python 3.10 upgrade as this upgrade is not in prod yet. Could you file a separate GitHub issue and describe the behavior you are seeing there?

francesco-ballarin

sure posted here: #3580

It used to work nicely, now I get nothing but 'file not found' errors even with YouTube links

Please pardon my ignorance, but it appears that TensorFlow quantum is not supported on Python 3.10. I rolled back the Python version to 3.8 using:

!sudo update-alternatives --config python3
!sudo apt install python3-pip

which allowed me to install tfq, but I still am unable to import cirq or tensorflow-quantum as tfq.

I also attempted:

import sys
sys.path.insert(0, '/usr/local/lib/python3.8/dist-packages/')

but this raised a pandas error.

I would greatly appreciate any assistance on how to configure Colab to install and import these libraries.

Falback runtime can't be accessed on mobile because your devs are too dumb to code CSS, once again.

Strange error... suspect related to the version upgrade, also "Use fallback runtime" not visible in Desktop Chrome
ServerSelectionTimeoutError Traceback (most recent call last)
in <cell line: 22>()
20 db = client['foxquilt-prod-db?&ssl=true&ssl_cert_reqs=CERT_NONE']
21 print('\nAVAILABLE FILES')
---> 22 for name in db.list_collection_names():
23 print('\t-',name)

6 frames
/usr/local/lib/python3.10/dist-packages/pymongo/topology.py in _select_servers_loop(self, selector, timeout, address)
196 # No suitable servers.
197 if timeout == 0 or now > end_time:
--> 198 raise ServerSelectionTimeoutError(
199 self._error_message(selector))
200

ServerSelectionTimeoutError: PY_SSIZE_T_CLEAN macro must be defined for '#' formats,PY_SSIZE_T_CLEAN macro must be defined for '#' formats,PY_SSIZE_T_CLEAN macro must be defined for '#' formats

@radres2019 Thanks for commenting on this issue. I see that https://pypi.org/project/tensorflow-quantum does not list Python 3.10 as a supported Python version. I recommend filing an upstream issue in that project to extend support to Python 3.10. In the meantime, you can still use Colab's fallback version (in the menu Tools > Command palette > Use fallback runtime version) from a connected session to use a runtime from prior to the Python 3.10 upgrade. For other Colab-related questions, please file a new issue here.

@milindajoshi Thanks for commenting on this issue. Regarding the error you posted with PyMongo, would you be able to file a new issue and include a reproducible notebook? For the fallback version, it is only available from the Command palette from a connected session. I suspect that may be why you are not seeing it.

Using the fallback runtime version temporarily allows access to the last version of the runtime before the upgrade described above, and is available until mid-May.

@metrizable Is it possible to extend the period of switching to fallback version for a longer period? We are currently migrating libraries to Python 3.10, and because of the Colab upgrade we are experiencing issues on public tutorials in TFX website.

first thanks for the workaround !
+1 for @AnuarTB requests, we rely as well on TFX and Colab as runtime and we're blocked on the update for now.