Skip to content

Problem installing pyd4 with both pip and from the GitHub repo #104

@GaRa2901

Description

@GaRa2901

Hi, while following the installation guidelines in the d4tools Python API documentation, I encountered the following error when running pip install pyd4. This occurred on a remote server running Ubuntu 22.04.

error: failed to run custom build command for d4-hts v0.3.9
      
      Caused by:
        process didn't exit successfully: `/tmp/pip-install-efnu6vq_/pyd4_61e88f30b165453e8c5b7abf7ab77306/target/release/build/d4-hts-6dae444dfd568bbe/build-script-build` (exit status: 101)
        --- stderr
        + pushd /tmp/pip-install-efnu6vq_/pyd4_61e88f30b165453e8c5b7abf7ab77306/target/release/build/d4-hts-6307912c9da4467e/out
        + HTSLIB_VERSION=1.11
        + rm -rf /tmp/pip-install-efnu6vq_/pyd4_61e88f30b165453e8c5b7abf7ab77306/target/release/build/d4-hts-6307912c9da4467e/out/htslib
        + git clone -b 1.11 http://github.com/samtools/htslib.git
        Cloning into 'htslib'...
        warning: redirecting to https://github.com/samtools/htslib.git/
        Note: switching to 'a7a90fe913f8a466f32f6e284cf46653944acd6f'.
      
        You are in 'detached HEAD' state. You can look around, make experimental
        changes and commit them, and you can discard any commits you make in this
        state without impacting any branches by switching back to a branch.
      
        If you want to create a new branch to retain commits you create, you may
        do so (now or later) by using -c with the switch command. Example:
      
          git switch -c <new-branch-name>
      
        Or undo this operation with:
      
          git switch -
      
        Turn off this advice by setting config variable advice.detachedHead to false
      
        + cd htslib
        + cat
        + perl -i -pe 's/hfile_libcurl\.o//g' Makefile
        + is_musl
        ++ grep musl
        ++ echo x86_64-unknown-linux-gnu
        + '[' '!' -z ']'
        + return 1
        + '[' x '!=' x ']'
        + curl -L http://github.com/madler/zlib/archive/refs/tags/v1.2.11.tar.gz
        + tar xz
          % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                         Dload  Upload   Total   Spent    Left  Speed
      
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      
      100  629k  100  629k    0     0   752k      0 --:--:-- --:--:-- --:--:--  752k
        + cd zlib-1.2.11
        + is_musl
        ++ grep musl
        ++ echo x86_64-unknown-linux-gnu
        + '[' '!' -z ']'
        + return 1
        + ./configure
        + make libz.a
        + cp libz.a ..
        + cd ..
        + tar xz
        + curl http://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz
          % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                         Dload  Upload   Total   Spent    Left  Speed
      
        0     0    0     0    0     0      0      0 --:--:-- --:--:-- --:--:--     0
      100   235  100   235    0     0    830      0 --:--:-- --:--:-- --:--:--   830
      
        gzip: stdin: not in gzip format
        tar: Child returned status 1
        tar: Error is not recoverable: exiting now
        thread 'main' panicked at /home/gabriel.alves/.cargo/registry/src/index.crates.io-6f17d22bba15001f/d4-hts-0.3.9/build.rs:34:5:
        assertion failed: Command::new("bash").args(&["build_htslib.sh",
                                                &version]).stdout(std::process::Stdio::null()).spawn().expect("Unable to build htslib").wait().unwrap().success()
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      warning: build failed, waiting for other jobs to finish...
      error: `cargo rustc --lib --message-format=json-render-diagnostics --manifest-path Cargo.toml --release -v --features pyo3/extension-module --crate-type cdylib --` failed with code 101
      [end of output]
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyd4
Failed to build pyd4
ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyd4)

While exploring the issues, I came across this one: #77. I'm not entirely sure if it's the same issue, but it does seem similar. There's also a comment #77 (comment) suggesting a workaround.

After running echo 'location' >> ~/.curlrc followed by pip install pyd4, the installation was successful. However, I still don't fully understand why this workaround resolved the issue.

Additionally, when attempting to install the latest pyd4 from this repository (version 0.3.11 vs. version 0.3.9 which is the most recent available in pip), following the instructions available here: https://github.com/38/d4-format/tree/master/pyd4/#installation, the installation script setup.py does not seem to be available anymore.

How can I install the latest version of pyd4 from this GitHub repository?

Any insights would be appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions