38 / d4-format

The D4 Quantitative Data Format

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

pip install fails

tsackton opened this issue · comments

I can install the Python API successfully by cloning the git repo, but using pip install fails:

[tsackton@holylogin02 d4test]$ python -m pip install pyd4

Collecting pyd4
  Using cached pyd4-0.3.1.2.tar.gz (15 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Collecting numpy
  Using cached numpy-1.22.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
Building wheels for collected packages: pyd4
  Building wheel for pyd4 (pyproject.toml) ... error
  error: subprocess-exited-with-error
  
  × Building wheel for pyd4 (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [83 lines of output]
      running bdist_wheel
      running build
      running build_py
      creating build
      creating build/lib.linux-x86_64-3.10
      creating build/lib.linux-x86_64-3.10/pyd4
      copying pyd4/__init__.py -> build/lib.linux-x86_64-3.10/pyd4
      running egg_info
      writing pyd4.egg-info/PKG-INFO
      writing dependency_links to pyd4.egg-info/dependency_links.txt
      writing requirements to pyd4.egg-info/requires.txt
      writing top-level names to pyd4.egg-info/top_level.txt
      reading manifest file 'pyd4.egg-info/SOURCES.txt'
      writing manifest file 'pyd4.egg-info/SOURCES.txt'
      running build_ext
      running build_rust
      error: failed to get `d4` as a dependency of package `pyd4 v0.1.13 (/tmp/pip-install-ow4cacbp/pyd4_1c42aedb701a4779a0da42389c2ab244)`
      
      Caused by:
        failed to load source for dependency `d4`
      
      Caused by:
        Unable to update /tmp/pip-install-ow4cacbp/d4
      
      Caused by:
        failed to read `/tmp/pip-install-ow4cacbp/d4/Cargo.toml`
      
      Caused by:
        No such file or directory (os error 2)
      Traceback (most recent call last):
        File "/n/home12/tsackton/sw/mambaforge/envs/d4/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/n/home12/tsackton/sw/mambaforge/envs/d4/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/n/home12/tsackton/sw/mambaforge/envs/d4/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 261, in build_wheel
          return _build_backend().build_wheel(wheel_directory, config_settings,
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 244, in build_wheel
          return self._build_with_temp_dir(['bdist_wheel'], '.whl',
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 229, in _build_with_temp_dir
          self.run_setup()
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/build_meta.py", line 174, in run_setup
          exec(compile(code, __file__, 'exec'), locals())
        File "setup.py", line 34, in <module>
          setup(
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/__init__.py", line 155, in setup
          return distutils.core.setup(**attrs)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 148, in setup
          return run_commands(dist)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/core.py", line 163, in run_commands
          dist.run_commands()
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 967, in run_commands
          self.run_command(cmd)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/wheel/bdist_wheel.py", line 299, in run
          self.run_command('build')
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/command/build.py", line 135, in run
          self.run_command(cmd_name)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/cmd.py", line 313, in run_command
          self.distribution.run_command(command)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools/_distutils/dist.py", line 986, in run_command
          cmd_obj.run()
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools_rust/setuptools_ext.py", line 132, in run
          build_rust.run()
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools_rust/command.py", line 101, in run
          self.run_for_extension(ext)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools_rust/build.py", line 108, in run_for_extension
          dylib_paths = self.build_extension(ext, self.target)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools_rust/build.py", line 139, in build_extension
          target_dir = _base_cargo_target_dir(ext)
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools_rust/build.py", line 673, in _base_cargo_target_dir
          target_directory = ext._metadata()["target_directory"]
        File "/tmp/pip-build-env-3dnx28re/overlay/lib/python3.10/site-packages/setuptools_rust/extension.py", line 200, in _metadata
          self._cargo_metadata = json.loads(subprocess.check_output(metadata_command))
        File "/n/home12/tsackton/sw/mambaforge/envs/d4/lib/python3.10/subprocess.py", line 420, in check_output
          return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
        File "/n/home12/tsackton/sw/mambaforge/envs/d4/lib/python3.10/subprocess.py", line 524, in run
          raise CalledProcessError(retcode, process.args,
      subprocess.CalledProcessError: Command '['cargo', 'metadata', '--manifest-path', 'Cargo.toml', '--format-version', '1']' returned non-zero exit status 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: Could not build wheels for pyd4, which is required to install pyproject.toml-based projects

Pip install still failing. Error is now:

     error: failed to run custom build command for `d4-hts v0.3.5`
      
      Caused by:
        process didn't exit successfully: `/tmp/pip-install-3kya479p/pyd4_c078b6dd33b54f9f9f02cefe521e2e41/target/release/build/d4-hts-1b44fec096ee500a/build-script-build` (exit status: 101)
        --- stderr
        + pushd /tmp/pip-install-3kya479p/pyd4_c078b6dd33b54f9f9f02cefe521e2e41/target/release/build/d4-hts-8e2eee3158639a84/out
        + HTSLIB_VERSION=1.11
        + rm -rf /tmp/pip-install-3kya479p/pyd4_c078b6dd33b54f9f9f02cefe521e2e41/target/release/build/d4-hts-8e2eee3158639a84/out/htslib
        + git clone -b 1.11 https://github.com/samtools/htslib.git
        Note: checking out '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 performing another checkout.
      
        If you want to create a new branch to retain commits you create, you may
        do so (now or later) by using -b with the checkout command again. Example:
      
          git checkout -b new_branch_name
      
        + cd htslib
        + cat
        + perl -i -pe 's/hfile_libcurl\.o//g' Makefile
        + is_musl
        ++ echo x86_64-unknown-linux-gnu
        ++ grep musl
        + '[' '!' -z ']'
        + return 1
        + curl https://zlib.net/zlib-1.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
      100   315  100   315    0     0    722      0 --:--:-- --:--:-- --:--:--   724
      
        gzip: stdin: not in gzip format
        tar: Child returned status 1
        tar: Error is not recoverable: exiting now
        thread 'main' panicked at 'assertion failed: Command::new(\"bash\").args(&[\"build_htslib.sh\",\n                            &version]).stdout(std::process::Stdio::null()).spawn().expect(\"Unable to build htslib\").wait().unwrap().success()', /n/home12/tsackton/.cargo/registry/src/github.com-1ecc6299db9ec823/d4-hts-0.3.5/build.rs:34:5
        note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
      warning: build failed, waiting for other jobs to finish...
      error: build failed
      error: cargo 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: Could not build wheels for pyd4, which is required to install pyproject.toml-based projects

I think the problem is that zlib is now at version 1.2.12, so the hard-coded url does not work.

Thanks for reporting this. This is due to the zlib website removed one file that D4 depends on.

Got this fixed on pypi already. Please let me know if the error persists. Cheers!