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

Installation problems [osx wheels requested] #3

Open
nicolaskruchten opened this issue Jul 22, 2022 · 5 comments
Open

Installation problems [osx wheels requested] #3

nicolaskruchten opened this issue Jul 22, 2022 · 5 comments

Comments

@nicolaskruchten
Copy link

Hello! Thanks for building and open-sourcing this :)

I'm trying to install this package with pip install pyprotoclust on my Apple Silicon machine using Python 3.9 within a conda environment and seeing the following output (even though setuptools is in fact installled)... If you had any ideas or suggestions about how I could get this installed, I'd appreciate it :)

Collecting pyprotoclust
  Using cached pyprotoclust-0.1.0.tar.gz (112 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: tqdm<5.0.0,>=4.46.0 in ./opt/miniconda3/envs/env/lib/python3.9/site-packages (from pyprotoclust) (4.63.0)
Building wheels for collected packages: pyprotoclust
  Building wheel for pyprotoclust (pyproject.toml) ... error
  error: subprocess-exited-with-error

  × Building wheel for pyprotoclust (pyproject.toml) did not run successfully.
  │ exit code: 1
  ╰─> [25 lines of output]
      A setup.py file already exists. Using it.
      Traceback (most recent call last):
        File "/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-install-hn3vumpf/pyprotoclust_5f2e121823764c21b428d4fbfc9ddfc7/setup.py", line 2, in <module>
          from setuptools import setup
      ModuleNotFoundError: No module named 'setuptools'
      Traceback (most recent call last):
        File "/Users/nicolas/opt/miniconda3/envs/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 363, in <module>
          main()
        File "/Users/nicolas/opt/miniconda3/envs/env/lib/python3.9/site-packages/pip/_vendor/pep517/in_process/_in_process.py", line 345, in main
          json_out['return_val'] = hook(**hook_input['kwargs'])
        File "/Users/nicolas/opt/miniconda3/envs/env/lib/python3.9/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 "/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-build-env-4xd7s4i7/overlay/lib/python3.9/site-packages/poetry/core/masonry/api.py", line 68, in build_wheel
          return unicode(WheelBuilder.make_in(poetry, Path(wheel_directory)))
        File "/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-build-env-4xd7s4i7/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 78, in make_in
          wb.build()
        File "/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-build-env-4xd7s4i7/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 110, in build
          self._build(zip_file)
        File "/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-build-env-4xd7s4i7/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 162, in _build
          self._run_build_command(setup)
        File "/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-build-env-4xd7s4i7/overlay/lib/python3.9/site-packages/poetry/core/masonry/builders/wheel.py", line 190, in _run_build_command
          subprocess.check_call(
        File "/Users/nicolas/opt/miniconda3/envs/env/lib/python3.9/subprocess.py", line 373, in check_call
          raise CalledProcessError(retcode, cmd)
      subprocess.CalledProcessError: Command '['/Users/nicolas/opt/miniconda3/envs/env/bin/python', '/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-install-hn3vumpf/pyprotoclust_5f2e121823764c21b428d4fbfc9ddfc7/setup.py', 'build', '-b', '/private/var/folders/20/zn579xsd7m3fm3yxbg9kkj640000gp/T/pip-install-hn3vumpf/pyprotoclust_5f2e121823764c21b428d4fbfc9ddfc7/build']' returned non-zero exit status 1.
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyprotoclust
Failed to build pyprotoclust
ERROR: Could not build wheels for pyprotoclust, which is required to install pyproject.toml-based projects
@andgoldschmidt
Copy link
Owner

Hi, thanks for your interest in this project, and sorry for the delayed reply.

This project does not currently have wheels supporting osx (there are wheels for Windows and Linux). That being said, I've been able to build from source using Poetry on my own macbook, and there are some notes on this (esp. regarding multithreading) in the Installation section of the documentation.

A current near-term goal is to offer a wider range of platform support and build automation.

@nicolaskruchten
Copy link
Author

Thanks for the info! I might give it a shot. Have you ever compared the performance of pyprotoclust to pyminimax, out of curiosity? I was able to easily install the latter, but it's not performant enough for my use-case.

@andgoldschmidt
Copy link
Owner

andgoldschmidt commented Aug 10, 2022

Thanks for the suggestion, I just ran a quick comparison based on the version of pyprotoclust I installed on my macbook air.

The performance of n=500 is around 17 s for pyminimax. Here is the performance of pyprotoclust:
test_pyprotoclust-zoom

There were no error bars in the original figure, but you can see the trend find in spite of fluctuations. Here is a version of that figure out to n=2000:
test_pyprotoclust

import time
import numpy as np
import matplotlib.pyplot as plt
from pandas import DataFrame
from scipy.spatial.distance import pdist, squareform

from pyprotoclust import protoclust

np.random.seed(0)
n_pts = np.arange(100, 2001, 20)
elapsed_time = []

def test_run(n):
    X = np.random.rand(n, 2)
    Z, _ = protoclust(squareform(pdist(X)))

for n in n_pts:
    start = time.process_time()
    test_run(n)
    end = time.process_time()
    elapsed_time.append(end - start)

df = DataFrame({'n': n_pts, 'time': elapsed_time}).set_index('n')
ax = df.plot(style='.-', legend=None);
ax.set(ylabel='Time (sec)')
plt.savefig('test_pyprotoclust.png')
plt.show()

@andgoldschmidt
Copy link
Owner

andgoldschmidt commented Aug 10, 2022

Also, I used their code exactly as provided in the documentation, but I'm not confident that these process_time timings accurately reflect the code's runtime (for example, timeit will report a runtime of approximately 30 s for pyprotoclust with n=5000, and I find this accurate. Meanwhile, process_time reported n=5000 to have a runtime of 100 s).

@andgoldschmidt andgoldschmidt changed the title Installation problems Installation problems [osx wheels requested] Aug 10, 2022
@nicolaskruchten
Copy link
Author

Thanks for taking the time to check this and share your results! I'll let you know how I make out with installation :)

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

No branches or pull requests

2 participants