abPOA icon indicating copy to clipboard operation
abPOA copied to clipboard

PyPI package does not install

Open cjw85 opened this issue 1 year ago • 14 comments

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

cjw85 avatar Oct 14 '22 11:10 cjw85

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?

yangao07 avatar Oct 14 '22 14:10 yangao07

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.

Sakshamgoel avatar Nov 07 '22 23:11 Sakshamgoel

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

yangao07 avatar Nov 08 '22 00:11 yangao07

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

Sakshamgoel avatar Nov 08 '22 21:11 Sakshamgoel

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

yangao07 avatar Nov 08 '22 23:11 yangao07

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

defendant602 avatar Nov 09 '22 04:11 defendant602

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

cjw85 avatar Nov 09 '22 07:11 cjw85

The uploaded file was built with command make publish_pypi.

yangao07 avatar Nov 09 '22 18:11 yangao07

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

yangao07 avatar Nov 09 '22 18:11 yangao07

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.

cjw85 avatar Nov 10 '22 11:11 cjw85

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 avatar Nov 10 '22 23:11 yangao07

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.

yangao07 avatar Nov 10 '22 23:11 yangao07

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.

tgbrooks avatar Jan 23 '23 19:01 tgbrooks

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.

cjw85 avatar Dec 19 '23 15:12 cjw85