Skip to content
This repository was archived by the owner on Feb 12, 2026. It is now read-only.
This repository was archived by the owner on Feb 12, 2026. It is now read-only.

RuntimeError: PythonNext() argument variant is not valid: Dynamic cast failed. #32

@Biogitte

Description

@Biogitte

Hi,

As I am using Mac-OS, I have set up a Docker environment to run Nucleus with Tensorflow in a Jupyter Notebook.

For the Docker image/container I am using the base-image "python:3.6-buster" as Nucleus doesn't work with Python 3.8. Here is the Dockerfile that I use:

# download base image
FROM python:3.6-buster

# dealing with cache issues
RUN apt-get clean
RUN apt-get update

# keep pip below v.21
RUN pip3 install --upgrade pip==20.2.3

# copy and paste the src directory into the image
WORKDIR src/
COPY . .

RUN pip3 install -r requirements.txt

For the dependencies (requirements.txt) I have tried with the latest versions of Tensorflow and Nucleus, as well as
Nucleus v. 0.4.1 and Tensorflow v.1.13.1 as suggested here.

Inside the Jupyter Notebook (that is running in the Docker container), I am re-installing protobuf (i.e., !pip3 install --force-reinstall --upgrade protobuf).

But when trying to test-run this code:

from nucleus.io import vcf
r = vcf.VcfReader('<sample>.vcf')
for v in r:
  print(v.start)

I am getting this error: RuntimeError: PythonNext() argument variant is not valid: Dynamic cast failed.

I have tried different hacks and tricks to get around the error (changing pip versions, different python versions (3.6, and 3.7, different Tensorflow and Nucleus, etc.) in the Docker container. Unfortunately, I forgot to log everything I have tried to get past this issue the last couple of days.

Is there a way to get around this issue?

Thanks,

Best wishes, Birgitte

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