Skip to content

Persistent Dependency Conflicts and Build Failures in Google Colab (Python 3.12) #5

@nobusama

Description

@nobusama

Hello,

I am experiencing significant and persistent dependency conflicts when attempting to install and use ProteomeLM from the Bitbol-Lab/ProteomeLM.git repository in a Google Colab environment running Python 3.12. Despite numerous attempts with various version pinning strategies and installation orders, I have been unable to successfully set up the environment.

Environment Details:

  • Environment: Google Colab
  • Python Version: 3.12.x (default in current Colab runtimes)
  • Target Library: ProteomeLM (installed from git+https://github.com/Bitbol-Lab/ProteomeLM.git)
  • Key Dependencies Involved: transformers, peft, tokenizers, fair-esm, huggingface_hub, accelerate

Observed Errors & Behavior:

The primary issues encountered during installation and import checks are:

  1. tokenizers Build Failures: When transformers versions compatible with ProteomeLM's older API requirements (e.g., 4.28.1, 4.34.0) are targeted, the tokenizers package (a core dependency) consistently fails to build from source, resulting in subprocess-exited-with-error or ERROR: Failed building wheel for tokenizers. This suggests an incompatibility between older tokenizers versions and the Python 3.12 build environment.

  2. transformers Import Errors: Even when transformers manages to install, ProteomeLM's internal imports fail with RuntimeError and ImportError. Specific examples include:

    • cannot import name 'set_rng_state_for_device' from 'transformers.trainer_pt_utils'
    • ModuleNotFoundError: No module named 'transformers.modeling_layers'
    • cannot import name 'is_fairscale_available' from 'transformers.integrations'
      These errors indicate that ProteomeLM's codebase (or its direct dependency peft) relies on specific API structures within transformers that are no longer present or have been refactored in versions of transformers that are typically installed in a Python 3.12 environment (e.g., versions >= 4.29.0 for modeling_layers or >= 4.30.0 for set_rng_state_for_device).
  3. peft Import Errors: Related to the transformers issue, peft imports also fail, such as cannot import name 'MODEL_TYPE_TO_PEFT_MODEL_MAPPING' from 'peft.mapping'. This suggests peft versions compatible with ProteomeLM are not compatible with transformers versions required by Python 3.12.

  4. Implicit Dependency Upgrades: Despite using !pip uninstall -y ... to clear packages, explicitly pinning versions (e.g., transformers==4.28.1, peft==0.5.0), and even employing --force-reinstall --no-dependencies, the pip dependency resolver frequently leads to the installation of newer, incompatible transformers versions (e.g., 4.57.3), overriding the specified ones. This complicates maintaining the necessary older versions required by ProteomeLM.

Attempts to Resolve:

I have tried various installation sequences and version combinations, including:

  • Targeting transformers==4.28.1 and peft==0.5.0 (as suggested by ProteomeLM's requirements.txt range).
  • Attempting newer transformers (4.48.1) and peft (0.8.2, 0.11.1) versions, based on a user's successful local Python 3.10 setup.
  • Installing tokenizers, huggingface_hub, and accelerate in specific orders and versions to meet minimum ProteomeLM requirements and avoid build failures.
  • Using --no-deps for ProteomeLM and --force-reinstall --no-dependencies for transformers and peft.

All attempts in the Python 3.12 Colab environment have resulted in unresolvable dependency conflicts or build errors, preventing a successful proteomelm import.

Conclusion:

It appears there is a fundamental incompatibility between the dependency requirements of ProteomeLM (especially its reliance on older transformers API) and the Python 3.12 environment. The necessary older versions of transformers and its dependencies (like tokenizers) either cannot be built on Python 3.12 or create API conflicts with ProteomeLM's codebase.

Request:

Could the maintainers provide guidance on:

  1. Recommended transformers / peft versions that are compatible with ProteomeLM and a more modern Python environment (e.g., Python 3.12)?
  2. Any known workarounds or patches for these dependency issues?
  3. Plans to update ProteomeLM to support newer transformers / peft APIs and Python versions?

Thank you for your time and assistance.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions