yangao07 / abPOA

abPOA: an SIMD-based C library for fast partial order alignment using adaptive band
MIT License
118 stars 18 forks source link

PyPI package does not install #41

Open cjw85 opened 1 year ago

cjw85 commented 1 year ago

Under Python 3.8, Linux x86 the source package is fetched (there's only a Python 3.7 wheel) but fails to install.

Collecting pyabpoa
  Using cached pyabpoa-1.4.0.tar.gz (738 kB)
  Preparing metadata (setup.py) ... done
ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-_bey3g0a
yangao07 commented 1 year ago

Have you tried using the downloaded gz file: https://files.pythonhosted.org/packages/1a/1f/7e3d26093c0078486a9daffc06aba01ebd8fd67058ede1d6c993d6ee77b7/pyabpoa-1.4.0.tar.gz and then pip install pyabpoa-1.4.0.tar.gz?

Sakshamgoel commented 1 year ago

I was facing the same issue, and I tried downloading the .tar.gz file and installing, as you recommended. It still gives the same error, exactly as the one @cjw85 gets.

yangao07 commented 1 year ago

This might be due to the cached file, you can try to add --no-cache-dir in your installation command.

Sakshamgoel commented 1 year ago

Thanks for the help @yangao07 . However, that doesn't work either.

yangao07 commented 1 year ago

OK, how about specifying a version number, like: pip install pyabpoa==1.2.5?

defendant602 commented 1 year ago

I got the same error, and I tried < pip install pyabpoa==1.2.5 >, but still got the same egg-info error.

cjw85 commented 1 year ago

@yangao07 how did you build the source distribution, it appears simply to be invalid.

yangao07 commented 1 year ago

The uploaded file was built with command make publish_pypi.

yangao07 commented 1 year ago

I cannot reproduce this error. The last thing I could suggest is to build pyabpoa from source:

git clone --recursive https://github.com/yangao07/abPOA.git
cd abPOA
make install_py
cjw85 commented 1 year ago

The error can be reproduced using a minimal python docker image:

$ docker run -it python:3.8.15-bullseye bash
root@952031ba6cd8:/# pip install pyabpoa
Collecting pyabpoa
  Downloading pyabpoa-1.4.0.tar.gz (738 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 738.4/738.4 KB 31.1 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
ERROR: No .egg-info directory found in /tmp/pip-pip-egg-info-rjtnq5n0
WARNING: You are using pip version 22.0.4; however, version 22.3.1 is available.
You should consider upgrading via the '/usr/local/bin/python -m pip install --upgrade pip' command.
yangao07 commented 1 year ago

Thanks @cjw85 , I can reproduce it now. Also I see this error when I use my system python: /usr/bin/python3 -m pip install pyabpoa.

Usually I use conda python/pip and it always works well.

I will try to figure out how to fix this error when using the system python.

yangao07 commented 1 year ago

This error might be related to the python package building process. Although I have no clue to fix it right now.

Here is my new finding: In the docker environment, where any pyabpoa was never installed, after I installed it from the source (and uninstalled it), I could successfully install any version of pyabpoa with pip without that error.

tgbrooks commented 1 year ago

Per this, the error can indicate that the build step is failing but not reporting a non-zero error code. Running with pip install -v pyabpoa to enable verbose mode shows that cython is not installed, so probably this line is causing the error due to its 0 exit status.

The workaround is to first run pip install cython and then pip install pyabpoa.

FYI, to my knowledge the 'proper' way to make this work is to write a pyproject.toml file that includes lines like the following (but with the correct version numbers):

[build-system]
requires = ["setuptools ~= 58.0", "cython ~= 0.29.0"]

This informs pip what it needs to have ready for installing your project.

cjw85 commented 9 months ago

I believe this is fixed now. The install now works for me, and I see commits where the installation files were amended to make cython a build dependency.