{"id":22458,"library":"theano","title":"Theano","description":"Theano is a Python library that allows you to define, optimize, and evaluate mathematical expressions involving multi-dimensional arrays efficiently, with support for CPUs and GPUs. It was a pioneering library for deep learning but is now in maintenance mode; the latest version is 1.0.5. The project is no longer actively developed, and users are encouraged to migrate to alternatives like TensorFlow, PyTorch, or JAX.","status":"maintenance","version":"1.0.5","language":"python","source_language":"en","source_url":"https://github.com/Theano/Theano","tags":["deep-learning","gpu","symbolic-math","array","optimization"],"install":[{"cmd":"pip install theano","lang":"bash","label":"Install Theano stable version"}],"dependencies":[{"reason":"Core dependency for array operations","package":"numpy","optional":false},{"reason":"Used for some linear algebra routines","package":"scipy","optional":true},{"reason":"GPU backend support","package":"pygpu","optional":true}],"imports":[{"note":"Common pattern but not the top-level import; it's fine to use theano.tensor directly.","wrong":"import theano.tensor as T","symbol":"theano","correct":"import theano"}],"quickstart":{"code":"import theano\nimport theano.tensor as T\n\n# Define symbolic variables\nx = T.dscalar('x')\ny = T.dscalar('y')\n\n# Define expression\nz = x + y\n\n# Compile function\nf = theano.function([x, y], z)\n\n# Execute\nprint(f(1.5, 2.5))  # Output: 4.0","lang":"python","description":"Basic symbolic addition using Theano's tensor module."},"warnings":[{"fix":"Consider migrating to PyTorch, TensorFlow, or JAX for active development and support.","message":"Theano is no longer actively maintained; the latest release (1.0.5) is from 2021. It may not work with newer Python versions (>=3.10) or modern CUDA toolkits.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use Python 3.8 or 3.9, or upgrade to Theano 1.0.5 and check compatibility.","message":"Python 3.9 support was dropped in Theano 1.0.5; Python 3.10+ may not be fully compatible. Expect import errors with older Theano versions on newer Python.","severity":"breaking","affected_versions":"<=1.0.4 on Python 3.10+"},{"fix":"Use CPU only or migrate to a library with active GPU support.","message":"Theano's GPU backend (pygpu) is deprecated and may not work with CUDA 11+.","severity":"deprecated","affected_versions":"all"}],"env_vars":null,"last_verified":"2026-04-27T00:00:00.000Z","next_check":"2026-07-26T00:00:00.000Z","problems":[{"fix":"Run 'pip install theano'.","cause":"Theano is not installed in the current environment.","error":"ImportError: No module named 'theano'"},{"fix":"Reinstall with 'pip install --upgrade theano' and verify with 'import theano; print(theano.__version__)'.","cause":"Likely using an older version or wrong import path. Theano's 'function' is top-level; ensure you have the correct version installed.","error":"AttributeError: module 'theano' has no attribute 'function'"},{"fix":"Install a C compiler (e.g., 'sudo apt-get install gcc' on Ubuntu, or install Xcode command line tools on macOS).","cause":"Theano requires a working C compiler (like GCC) for compilation.","error":"RuntimeError: Cannot compile theano function: No C compiler found"}],"ecosystem":"pypi","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}