jeffdaily / parasail-python

Python bindings for the parasail C library.
Other
87 stars 17 forks source link

Error installing parasail on macos #55

Closed grst closed 3 years ago

grst commented 3 years ago

My CI for the scirpy project started failing on MacOS, because parasail cannot be installed:

 Collecting parasail
    Downloading parasail-1.2.1.tar.gz (76 kB)
      ERROR: Command errored out with exit status 1:
       command: /Users/runner/hostedtoolcache/Python/3.6.12/x64/bin/python -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-install-gomq73wa/parasail/setup.py'"'"'; __file__='"'"'/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-install-gomq73wa/parasail/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-pip-egg-info-fjb0573p
           cwd: /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-install-gomq73wa/parasail/
      Complete output (5 lines):
      Traceback (most recent call last):
        File "<string>", line 1, in <module>
        File "/private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-install-gomq73wa/parasail/setup.py", line 18, in <module>
          from wheel.bdist_wheel import bdist_wheel as bdist_wheel_
      ModuleNotFoundError: No module named 'wheel'
      ----------------------------------------
  ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
  WARNING: You are using pip version 20.2.4; however, version 20.3 is available.
  You should consider upgrading via the '/Users/runner/hostedtoolcache/Python/3.6.12/x64/bin/python -m pip install --upgrade pip' command.
  ----------------------------------------
ERROR: Command errored out with exit status 1: /Users/runner/hostedtoolcache/Python/3.6.12/x64/bin/python /Users/runner/hostedtoolcache/Python/3.6.12/x64/lib/python3.6/site-packages/pip install --ignore-installed --no-user --prefix /private/var/folders/24/8k48jl6d249_n_qfxwsl6xvm0000gn/T/pip-build-env-hfxvpoax/normal --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- scipy 'scanpy>=1.6.0' python-levenshtein 'nbsphinx>=0.6.0 ; extra == "doc"' 'rectangle-packer ; extra == "rpack"' 'scanpydoc>=0.5 ; extra == "doc"' parasail 'jupytext ; extra == "doc"' 'pandas>=0.21' 'pytest ; extra == "test"' 'pycairo ; extra == "doc"' 'sphinxcontrib-bibtex>=1.0.0 ; extra == "doc"' 'sphinx_autodoc_typehints>=1.8.0 ; extra == "doc"' scikit-learn 'sphinx>=3.0.1,<3.1 ; extra == "doc"' squarify 'black ; extra == "test"' numpy 'sphinx_rtd_theme>=0.4,<0.5 ; extra == "doc"' 'ipykernel ; extra == "doc"' 'anndata>=0.7.3' networkx 'typing_extensions ; extra == "doc" and ( python_version < "3.8")' python-igraph airr 'leidenalg ; extra == "doc"' 'jupyter_client ; extra == "doc"' 'pycairo>=1.20; sys_platform == "win32"' 'tqdm>=4.29.1' Check the logs for full command output.

Apparently the wheel package is missing. I saw that it is declared as a dependency in setup.py, however it is already imported in setup.py, making it impossible for pip to read the dependencies when the package is not installed.

https://github.com/jeffdaily/parasail-python/blob/03ce8b5dede0aed15d7406c09db9b10ea6a3794c/setup.py#L18

jeffdaily commented 3 years ago

I'm open to suggestions here. I don't think I've used install_requires correctly since my package doesn't need wheel at runtime, only during build. But using setup_requires instead won't work for the same reason as your error.

PEP 518 (https://www.python.org/dev/peps/pep-0518/) would have me believe that any build environment at a minimum would need setuptools and wheel.

grst commented 3 years ago

The weird thing is, it does works with v1.2.0. Can this be related to your changes to the .travis.yml file?

https://github.com/jeffdaily/parasail-python/compare/v1.2...v1.2.1

jeffdaily commented 3 years ago

The .travis.yml file is only used by the Travis CI webhook, not during build and install. What is your exact install command on MacOS?

grst commented 3 years ago

The .travis.yml file is only used by the Travis CI webhook, not during build and install.

Yes, what I meant was: The way how the wheel has been built might affect how it can be installed.

What is your exact install command on MacOS?

I install a package that dependes on parasail using pip install . (see gh actions script)

I now temporarily changed the dependency to parasail != 1.2.1 and it works again...

jeffdaily commented 3 years ago

I can kinda sorta reproduce in an ubuntu container, but it seems like a broken environment to have pip and setuptools but not wheel.

FROM ubuntu:18.04
RUN apt update
# note the minus '-' at the end to exclude the python3-wheel package
RUN apt install build-essential python3 python3-pip python3-wheel-
# fails, No module named 'wheel'
RUN python3 -m pip install parasail
# also fails, same reason
python3 -m pip install parasail != 1.2.1
grst commented 3 years ago

hmm, maybe it's easiest to just pre-install wheel separately in that CI and be done with it...

jeffdaily commented 3 years ago

How does this look?

https://github.com/jeffdaily/parasail-python/compare/no_wheel

grst commented 3 years ago

This looks great, that should do the trick!

jeffdaily commented 3 years ago

Merged and tagged v1.2.2.