• Jobs
  • About Us
  • professionals
    • Home
    • Jobs
    • Courses and challenges
  • business
    • Home
    • Post vacancy
    • Our process
    • Pricing
    • Assessments
    • Payroll
    • Blog
    • Sales
    • Salary Calculator

0

2K
Views
¿Es posible usar Python 3.10 en Google Colab?

Me gustaría usar la función de coincidencia de patrones estructurales de Python 3.10 en Google Colab para usar los comandos

 !sudo apt-get install python3.10 !sudo update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.10 1 !sudo update-alternatives --set python3 /usr/bin/python3.10

Pude hacer !python --version de salida 3.10.0, pero la print(sys.version) aún genera 3.7.12 en celdas de código y, por lo tanto, la declaración de casos coincidentes genera SyntaxError

 number = 1 match number: case 0: print("Error") case _: print(number)

¿Hay alguna manera de hacer funcionar esto?

about 3 years ago · Santiago Trujillo
1 answers
Answer question

0

Puedes probar estos comandos:

 !update-alternatives --install /usr/bin/python python /usr/bin/python3.10

entonces

 !update-alternatives --list python

Esto debe mostrar su versión de Python descargada.

Después,

 !sudo update-alternatives --config python ## !Set python3.10 as default.

Por fin,

 !sudo update-alternatives --set python /usr/bin/python3.10

luego verifique su versión predeterminada de Python en colab.

 !python3 --version
about 3 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Our process Sales
Legal
Terms and conditions Privacy policy
© 2025 PeakU Inc. All Rights Reserved.

Andres GPT

Recommend me some offers
I have an error