Closed startakovsky closed 1 year ago
Even after updating mamba / conda all of these commands say the package is not found
https://anaconda.org/conda-forge/libgap
conda install -c conda-forge libgap conda install -c "conda-forge/label/cf201901" libgap conda install -c "conda-forge/label/cf202003" libgap conda install -c "conda-forge/label/gcc7" libgap
conda-forge/osx-arm64 Using cache
conda-forge/noarch Using cache
Pinned packages:
- python 3.8.*
Could not solve for environment specs
The following package could not be installed
└─ libgap does not exist (perhaps a typo or a missing channel).```
What is the original import error, perhaps this is fixed by https://github.com/sagemath/sage/pull/35351 (I'm actually not sure if the libgap conda package is needed by sage at all these days, it seems very out of date at any rate). Maybe you can simply have conda install gap (not libgap) 4.12.2?
@alexjbest
[Clang 14.0.6 ] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from sage.combinat.tableau import Tableau
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/steven/.pyenv/versions/mambaforge/envs/big-macs-llm/lib/python3.8/site-packages/sage/combinat/tableau.py", line 107, in <module>
from sage.combinat import permutation
File "/Users/steven/.pyenv/versions/mambaforge/envs/big-macs-llm/lib/python3.8/site-packages/sage/combinat/permutation.py", line 252, in <module>
from sage.libs.gap.libgap import libgap
File "sage/libs/gap/libgap.pyx", line 1, in init sage.libs.gap.libgap (build/cythonized/sage/libs/gap/libgap.c:9039)
File "sage/libs/gap/util.pyx", line 1, in init sage.libs.gap.util (build/cythonized/sage/libs/gap/util.c:9321)
File "sage/libs/gap/element.pyx", line 1, in init sage.libs.gap.element (build/cythonized/sage/libs/gap/element.c:29374)
File "sage/groups/perm_gps/permgroup_element.pyx", line 129, in init sage.groups.perm_gps.permgroup_element (build/cythonized/sage/groups/perm_gps/permgroup_element.c:25328)
ImportError: cannot import name libgap
>>>```
@alexjbest The recommendation to do mamba install gap
did not solve this issue, even though it ended up installing these, even though gap-core
was a part of the list of installed packages I pasted above.:
antic 56.9kB @ 606.7kB/s 0.1s
eigen 1.3MB @ 10.0MB/s 0.1s
libsemigroups 984.6kB @ 6.0MB/s 0.1s
libeantic 148.7kB @ 773.3kB/s 0.2s
normaliz 5.2MB @ 19.3MB/s 0.1s
fmt 171.1kB @ 567.8kB/s 0.3s
gap 283.2MB @ 42.5MB/s 6.6s```
I just tried to do this with anaconda too...
>>> from sage.combinat.tableau import Tableau
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/steven/.pyenv/versions/anaconda3-2023.03/envs/big-macs-llm/lib/python3.10/site-packages/sage/combinat/tableau.py", line 107, in <module>
from sage.combinat import permutation
File "/Users/steven/.pyenv/versions/anaconda3-2023.03/envs/big-macs-llm/lib/python3.10/site-packages/sage/combinat/permutation.py", line 252, in <module>
from sage.libs.gap.libgap import libgap
File "sage/libs/gap/libgap.pyx", line 1, in init sage.libs.gap.libgap (build/cythonized/sage/libs/gap/libgap.c:9039)
File "sage/libs/gap/util.pyx", line 1, in init sage.libs.gap.util (build/cythonized/sage/libs/gap/util.c:9321)
File "sage/libs/gap/element.pyx", line 1, in init sage.libs.gap.element (build/cythonized/sage/libs/gap/element.c:29374)
File "sage/groups/perm_gps/permgroup_element.pyx", line 129, in init sage.groups.perm_gps.permgroup_element (build/cythonized/sage/groups/perm_gps/permgroup_element.c:25328)
ImportError: cannot import name libgap
>>>```
The steps I followed are standard, I think:
brew install pyenv
pyenv install anaconda-2023.03
pyenv local anaconda-2023.03
@alexjbest Do you think it could be because the libgap file is a pyx file and that that requires other libraries that Anaconda cannot handle?
OK at this point I tried with the instructions here: https://doc.sagemath.org/html/en/installation/conda.html#sec-installation-conda
anaconda-2023.03 installed sage but the sage cli is not working and the import that requires the libgap.pyx file is not working.
Of all the installation options conda was most appealing because it was the first instruction that allowed me to separate out the other parts of the sage install.... seems the best path forward for now is to do what I want to do on the sage docker container. Let me know if you come up with any advice on this...
Does your conda installed gap work ok? (e.g. can you run gap from the command line and do non-trivial things with it?) It looks like you have an M2 mac, is that the case? (If so I'm not super surprised that some parts don't quite work to be honest, as far as I know we dont have any testing for such a set up @saraedum )
@startakovsky, sage needs to import files in a specific order as there are lots of cyclic import involved. Try
import sage.all
from sage.combinat.tableau import Tableau
Hey @alexjbest I do have an M1 mac. Yes this import no longer errors out. @isuruf this worked great, I have it all working for this. I am about to open up another ticket though, related to the sage cli not working. I will reference this ticket to get a sense of my set up. I am happy to not go with Docker and to stay simple with conda. Thank you.
Solution to issue cannot be found in the documentation.
Issue
python 3.9 and 3.8 doesn't come with libgap.... so I am getting an error even though on the official sage documentation they provide 3.9 as an example version of python. Am I missing something?
mamba create -n big-macs-llm sage python=3.9
installs sage without errors and I can import a number of things but when I try to import StandardTableaux I get an import name error referencing the libgap library.Any recommendations?
Installed packages
Environment info