Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install failures #173

Closed
naisanzaa opened this issue Feb 7, 2022 · 5 comments · Fixed by #174
Closed

pip install failures #173

naisanzaa opened this issue Feb 7, 2022 · 5 comments · Fixed by #174

Comments

@naisanzaa
Copy link

I recently started having swifter pip install failures.

It works if I run pip3 install -U numpy pandas pandas>=1.1.5 numpy>=1.22.2 dask>=2022.1.1 tqdm psutil before grep -v '^#' requirements.txt | xargs python3 -m pip install -U

But I don't understand why

The xargs should be installing the required packages before swifter?

And before, I was just installing with python3 -m pip install -U -r requirements.txt and it was working fine.

requirements.txt

...
# datascience
pandas>=1.1.5
jupyterlab>=3.1.9
numpy>=1.22.2
dask>=2022.1.1
tqdm>=4.62.3
swifter>=1.1.1
...

ci.yml

      - name: Setup Python
        uses: actions/setup-python@v2
        with:
          python-version: 3.8
#      - run: pip3 install -U numpy pandas pandas>=1.1.5 numpy>=1.22.2 dask>=2022.1.1 tqdm psutil
      - name: Install python packages
        run: grep -v '^#' requirements.txt | xargs pip3 install -U

https://github.com/TheShellLand/automonisaur/runs/5089991392?check_suite_focus=true

Collecting numpy>=1.22.2
  Downloading numpy-1.22.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (16.8 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.8/16.8 MB 57.1 MB/s eta 0:00:00
Collecting dask>=2022.1.1
  Downloading dask-2022.1.1-py3-none-any.whl (1.1 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.1/1.1 MB 62.0 MB/s eta 0:00:00
Collecting tqdm>=4.62.3
  Downloading tqdm-4.62.3-py2.py3-none-any.whl (76 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 76.2/76.2 KB 18.5 MB/s eta 0:00:00
Collecting swifter>=1.1.1
  Downloading swifter-1.1.1.tar.gz (633 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 633.1/633.1 KB 51.8 MB/s eta 0:00:00
  Preparing metadata (setup.py): started
  Preparing metadata (setup.py): finished with status 'error'
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [10 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-install-fifafnqu/swifter_09eb726c6b204f0a8f[46](https://github.com/TheShellLand/automonisaur/runs/5089991392?check_suite_focus=true#step:4:46)5d3690df00ce/setup.py", line 2, in <module>
          from swifter import __version__ as VERSION
        File "/tmp/pip-install-fifafnqu/swifter_09eb726c6b204f0a8f4[65](https://github.com/TheShellLand/automonisaur/runs/5089991392?check_suite_focus=true#step:4:65)d3[69](https://github.com/TheShellLand/automonisaur/runs/5089991392?check_suite_focus=true#step:4:69)0df00ce/swifter/__init__.py", line 5, in <module>
          from .swifter import SeriesAccessor, DataFrameAccessor
        File "/tmp/pip-install-fifafnqu/swifter_09eb[72](https://github.com/TheShellLand/automonisaur/runs/5089991392?check_suite_focus=true#step:4:72)6c6b204f0a8f465d3690df00ce/swifter/swifter.py", line 3, in <module>
          import numpy as np
      ModuleNotFoundError: No module named 'numpy'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
@naisanzaa
Copy link
Author

Okay fixed using xargs -L1 (to split the lines)

But still doesn't explain why python3 -m pip install -U -r requirements.txt was working fine before

@jtmiclat
Copy link

jtmiclat commented Feb 7, 2022

Did some investigating, if you pin the version to swifter==1.0.9 it should work for now.

The culprit seems to be in setup.py importing the library before installing anything.

from swifter import __version__ as VERSION

Within the swifter/__init__.py, it imports some modules that causes the situation where you need all the dependency before you can install the package.

import sys
import warnings
from logging import config
from .swifter import SeriesAccessor, DataFrameAccessor
from .parallel_accessor import (
register_parallel_dataframe_accessor,
register_parallel_series_accessor,
register_modin,
)

@dlangerm
Copy link

dlangerm commented Feb 7, 2022

I'm getting this error suddenly too.

@jmcarpenter2
Copy link
Owner

Thanks for raising this! I will fix this immediately. Apologies!

@jmcarpenter2
Copy link
Owner

Hey @naisanzaa , @jtmiclat, @dlangerm can you try 1.1.2 and let me know if that resolves it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants