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 fails with sage 9.6 on conda #55

Open
videlec opened this issue Nov 27, 2022 · 3 comments
Open

installation fails with sage 9.6 on conda #55

videlec opened this issue Nov 27, 2022 · 3 comments

Comments

@videlec
Copy link
Contributor

videlec commented Nov 27, 2022

I am running sage 9.6 in a conda environment with python 3.9.7. Trying to install ore_algebra I got the following error

$ sage -pip install git+https://github.com/mkauers/ore_algebra.git
Collecting git+https://github.com/mkauers/ore_algebra.git
  Cloning https://github.com/mkauers/ore_algebra.git to /tmp/pip-req-build-b_u00gr5
  Running command git clone --filter=blob:none --quiet https://github.com/mkauers/ore_algebra.git /tmp/pip-req-build-b_u00gr5
  Resolved https://github.com/mkauers/ore_algebra.git to commit ad1cfd034ac78535593e6a9a9d475df2f0b8c038
  Preparing metadata (setup.py) ... error
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> [19 lines of output]
      Traceback (most recent call last):
        File "/tmp/pip-req-build-b_u00gr5/setup.py", line 36, in <module>
          from sage.misc.package_dir import cython_namespace_package_support
      ImportError: cannot import name 'cython_namespace_package_support' from 'sage.misc.package_dir' (/home/vincent/miniconda3/envs/flatsurf/lib/python3.9/site-packages/sage/misc/package_dir.py)
      
      During handling of the above exception, another exception occurred:
      
      Traceback (most recent call last):
        File "<string>", line 2, in <module>
        File "<pip-setuptools-caller>", line 34, in <module>
        File "/tmp/pip-req-build-b_u00gr5/setup.py", line 40, in <module>
          extensions = do_cythonize()
        File "/tmp/pip-req-build-b_u00gr5/setup.py", line 32, in do_cythonize
          aliases = sage.env.cython_aliases(),
        File "/home/vincent/miniconda3/envs/flatsurf/lib/python3.9/site-packages/sage/env.py", line 474, in cython_aliases
          lib = get_cblas_pc_module_name()
        File "/home/vincent/miniconda3/envs/flatsurf/lib/python3.9/site-packages/sage/env.py", line 397, in get_cblas_pc_module_name
          return next((blas_lib for blas_lib in cblas_pc_modules if pkgconfig.exists(blas_lib)))
      StopIteration
      [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.
@mezzarobba
Copy link
Collaborator

mezzarobba commented Nov 27, 2022 via email

@videlec
Copy link
Contributor Author

videlec commented Nov 27, 2022

Indeed

sage: from sage.env import cython_aliases
sage: cython_aliases()
---------------------------------------------------------------------------
StopIteration                             Traceback (most recent call last)
<ipython-input-3-7fb929438fa3> in <cell line: 1>()
----> 1 cython_aliases()

~/miniconda3/envs/flatsurf/lib/python3.9/site-packages/sage/env.py in cython_aliases(required_modules, optional_modules)
    472         var = lib.upper().replace("-", "") + "_"
    473         if lib == 'cblas':
--> 474             lib = get_cblas_pc_module_name()
    475         if lib == 'zlib':
    476             aliases[var + "CFLAGS"] = ""

~/miniconda3/envs/flatsurf/lib/python3.9/site-packages/sage/env.py in get_cblas_pc_module_name()
    395     import pkgconfig
    396     cblas_pc_modules = CBLAS_PC_MODULES.split(':')
--> 397     return next((blas_lib for blas_lib in cblas_pc_modules if pkgconfig.exists(blas_lib)))
    398 
    399 

StopIteration: 

@videlec
Copy link
Contributor Author

videlec commented Nov 27, 2022

The conda setup does not always fit with sage thingy way of finding libraries. In particular the base install of sage in conda comes without many of the standard sage packages such as numpy, sympy, maxima, gap, ... It might well be the case that my conda environment is missing blas.

I agree that the bug is somehow not ore_algebra specific but it would be nice to have a simple harmless work around.

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