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

JOSS review: installation error #89

Open
prashjet opened this issue Feb 27, 2024 · 17 comments · Fixed by #90
Open

JOSS review: installation error #89

prashjet opened this issue Feb 27, 2024 · 17 comments · Fixed by #90
Assignees

Comments

@prashjet
Copy link

In a fresh conda environment, I get the following error when attempting the pip install as instructed on the README:

(quickBayes) prash@air > python -m pip install quickBayes
Collecting quickBayes
  Using cached quickBayes-1.0.0b18.tar.gz (1.6 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/n2/qrrgr98x5flg7lx88y_r9z0r0000gn/T/pip-install-zwi18xxa/quickbayes_4aadff4f9d2b4124af579c739b4f2dcb/setup.py", line 2, in <module>
          from tools.setup_helper import get_extensions
      ModuleNotFoundError: No module named 'tools.setup_helper'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
@AnthonyLim23
Copy link
Collaborator

It looks like that the uploaded version is missing the tools, which is strange. I will have a look into this.

@AnthonyLim23
Copy link
Collaborator

If you try a pip install now it should work

@prashjet
Copy link
Author

Same error as before unfortunately:

(quickBayes) prash@air > python -m pip install quickBayes
Collecting quickBayes
  Downloading quickBayes-1.0.0b21.tar.gz (2.2 MB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.2/2.2 MB 8.4 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [6 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/n2/qrrgr98x5flg7lx88y_r9z0r0000gn/T/pip-install-b6yahjlx/quickbayes_2c34791c0c44403b97a236e18f59369e/setup.py", line 2, in <module>
          from tools.setup_helper import get_extensions
      ModuleNotFoundError: No module named 'tools.setup_helper'
      [end of output]

@AnthonyLim23
Copy link
Collaborator

how strange. It worked for me when it didnt before. It looks like we have the same version. What operating system are you using (maybe that makes a difference)?

(quickBayes2-dev) C:\Users\BTR75544\work\tmp>python -m pip install quickBayes
Collecting quickBayes
  Downloading quickBayes-1.0.0b21.tar.gz (2.2 MB)
     ---------------------------------------- 2.2/2.2 MB 6.3 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.12 in c:\users\btr75544\.conda\envs\quickbayes2-dev\lib\site-packages (from quickBayes) (1.26.4)
Requirement already satisfied: scipy in c:\users\btr75544\.conda\envs\quickbayes2-dev\lib\site-packages (from quickBayes) (1.12.0)
Requirement already satisfied: gofit in c:\users\btr75544\.conda\envs\quickbayes2-dev\lib\site-packages (from quickBayes) (0.4)
Building wheels for collected packages: quickBayes
  Building wheel for quickBayes (setup.py) ... done
  Created wheel for quickBayes: filename=quickBayes-1.0.0b21-py3-none-any.whl size=46202 sha256=5229cb2ef827426a61259cff6eb52aa60f57528450e7dc6d780edc12b8e9b621
  Stored in directory: c:\users\btr75544\appdata\local\pip\cache\wheels\cf\9b\ca\98ce560e5b6417de9cc9e12b0bc356af57f5b58f843b4153f7
Successfully built quickBayes
Installing collected packages: quickBayes
Successfully installed quickBayes-1.0.0b21

@prashjet
Copy link
Author

MacOS 14.3

@AnthonyLim23
Copy link
Collaborator

I dont have access to a mac, but I will try in the next week on a Linux and see if that works. If not I will need to track down someone else to help me debug it. I am sorry this is taking awhile.

@prashjet
Copy link
Author

No worries - good luck!

@AnthonyLim23
Copy link
Collaborator

Sorry it has taken so long for me to respond. I have asked around and I cannot find anyone who can reproduce your error. I just had a look at the tar file and it looks as expected (it includes the setup_helper.py)

CLRC+btr75544@NDLT1627 MINGW64 ~/Downloads/quickBayes-1.0.0b21/tools
$ ls
setup_helper.py

If you have any thoughts on what could be going wrong it would be greatly appreciated.

@prashjet
Copy link
Author

If you have any thoughts on what could be going wrong it would be greatly appreciated.

Unfortunately, I don't have any specific idea about what is going wrong, but I tried an install in a different conda environment (with Python 3.10.8) and got a different error message to before:

(quickBayes2) prash@air > python -m pip install quickBayes
Collecting quickBayes
  Using cached quickBayes-1.0.0b21.tar.gz (2.2 MB)
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [8 lines of output]
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/private/var/folders/n2/qrrgr98x5flg7lx88y_r9z0r0000gn/T/pip-install-4nccloy6/quickbayes_b7097a39198146069e10bd1d394708c0/setup.py", line 2, in <module>
          from tools.setup_helper import get_extensions
        File "/private/var/folders/n2/qrrgr98x5flg7lx88y_r9z0r0000gn/T/pip-install-4nccloy6/quickbayes_b7097a39198146069e10bd1d394708c0/tools/setup_helper.py", line 5, in <module>
          from Cython.Build import cythonize
      ModuleNotFoundError: No module named 'Cython'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

I then pip installed cython by hand, reattempted install of quickBayes then got the following error:

(quickBayes2) prash@air > python -m pip install quickBayes
Collecting quickBayes
  Using cached quickBayes-1.0.0b21.tar.gz (2.2 MB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy>=1.12 in /opt/miniconda3/envs/quickBayes2/lib/python3.10/site-packages (from quickBayes) (1.23.4)
Requirement already satisfied: scipy in /opt/miniconda3/envs/quickBayes2/lib/python3.10/site-packages (from quickBayes) (1.9.3)
Collecting gofit (from quickBayes)
  Downloading gofit-0.4.tar.gz (74 kB)
     ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 74.7/74.7 kB 4.5 MB/s eta 0:00:00
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: quickBayes, gofit
  Building wheel for quickBayes (setup.py) ... done
  Created wheel for quickBayes: filename=quickBayes-1.0.0b21-py3-none-any.whl size=46193 sha256=25f9daf3bc2d620d2c42206971bc397205c78ceaffcfe3eb0b939212d7dcd782
  Stored in directory: /Users/prash/Library/Caches/pip/wheels/f7/88/03/2ef2f8d25f22a6cf74615a23089706cc129634c2946e9d5b47
  Building wheel for gofit (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      running bdist_wheel
      running build
      running build_ext
      error: [Errno 2] No such file or directory: 'cmake'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gofit
  Running setup.py clean for gofit
Successfully built quickBayes
Failed to build gofit
ERROR: Could not build wheels for gofit, which is required to install pyproject.toml-based projects

I hope these are helpful!

@AnthonyLim23
Copy link
Collaborator

It will take me a little while, but I am going to do some tests on performance with its current form and without Cython (but using pyproject.toml). If it doesnt make much difference, then switching would be beneficial as it would simplify the github workflows and allow us to make a pure python wheel. This should fix the issues you have been having.

AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
AnthonyLim23 added a commit that referenced this issue Apr 23, 2024
@AnthonyLim23
Copy link
Collaborator

@prashjet after some experimenting I have made the project a pure Python wheel, using pyproject..toml https://pypi.org/project/quickBayes/1.0.0b23/

Let me know if this solves your problem. If it does I will merge the changes into main.

AnthonyLim23 added a commit that referenced this issue Jun 27, 2024
* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* #refs 89 first go at fixing pip install

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* refs #89 move to pyproject.toml

* update version number

* refs #89 move to pyproject.toml

* update version number

* refs #89 move to pyproject.toml

* limit numpy version

---------

Co-authored-by: github-actions <[email protected]>
@prashjet
Copy link
Author

Hi @AnthonyLim23 - it didn't work for me I'm afraid!

(quickBayes2) prash@air > python -m pip install quickBayes
Collecting quickBayes
  Using cached quickbayes-1.0.0b23-py3-none-any.whl.metadata (1.1 kB)
Collecting gofit (from quickBayes)
  Using cached gofit-0.4.tar.gz (74 kB)
  Preparing metadata (setup.py) ... done
Requirement already satisfied: numpy in /opt/miniconda3/envs/quickBayes2/lib/python3.10/site-packages (from quickBayes) (1.23.4)
Requirement already satisfied: scipy in /opt/miniconda3/envs/quickBayes2/lib/python3.10/site-packages (from quickBayes) (1.9.3)
Using cached quickbayes-1.0.0b23-py3-none-any.whl (49 kB)
Building wheels for collected packages: gofit
  Building wheel for gofit (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [4 lines of output]
      running bdist_wheel
      running build
      running build_ext
      error: [Errno 2] No such file or directory: 'cmake'
      [end of output]
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for gofit
  Running setup.py clean for gofit
Failed to build gofit
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (gofit)

@AnthonyLim23
Copy link
Collaborator

Ah ok, the output is much more helpful this time. The problem seems to be gofit: https://github.com/ralna/GOFit as it is a compiled code with a python interface. So I think the problem is just that it is not compatible with your system.

@jfowkes what do you think?

@jfowkes
Copy link

jfowkes commented Jun 28, 2024

@AnthonyLim23 not necessarily, GOFit is only precompiled for some systems, for others it tries to build GOFit from source (as is the case here) and that requires cmake amongst other dependencies, see the GOFit README here:
https://github.com/ralna/GOFit

@jfowkes
Copy link

jfowkes commented Jun 28, 2024

@AnthonyLim23 probably best to make GoFit an optional install dependency?

@AnthonyLim23
Copy link
Collaborator

I was thinking that too. Would need to read up on how to do that and how to make the code cope with the possibility of it being missing.

@AnthonyLim23
Copy link
Collaborator

https://stackoverflow.com/questions/75490231/pip-pyproject-toml-can-optional-dependency-groups-require-other-optional-depend

and then I can use a base class for gofit that raises an error if it is not available, otherwise it will use the "implemented version".

@AnthonyLim23 AnthonyLim23 reopened this Jun 28, 2024
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.

3 participants