Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] sagemath: missing packages when running in a virtual environment
@ 2024-07-31 16:26 Eloitor
  2024-08-01 15:51 ` Eloitor
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Eloitor @ 2024-07-31 16:26 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2495 bytes --]

New issue by Eloitor on void-packages repository

https://github.com/void-linux/void-packages/issues/51574

Description:
### Is this a new report?

Yes

### System Info

Void 6.8.12_2 x86_64 GenuineIntel uptodate rrFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

### Package(s) Affected

sagemath-10.4_1

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

_No response_

### Expected behaviour

I can import and use sage from python, even in a virtual environment (with --system-site-packages).

### Actual behaviour

In a virtual environment, I open python and run
```
from sage.all import *
EllipticCurve("38B2")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sage/structure/factory.pyx", line 371, in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:4178)
  File "/usr/lib/python3.12/site-packages/sage/schemes/elliptic_curves/constructor.py", line 440, in create_key_and_extra_args
    x, data = CremonaDatabase().coefficients_and_data(x)
              ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/sage/databases/cremona.py", line 1730, in CremonaDatabase
    return MiniCremonaDatabase(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/sage/databases/cremona.py", line 673, in __init__
    db_path = DatabaseCremona(name=name).absolute_filename()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/sage/features/__init__.py", line 841, in absolute_filename
    raise FeatureNotPresentError(self, reason=reason, resolution=self.resolution())
sage.features.FeatureNotPresentError: database_cremona_mini_ellcurve is not available.
'cremona_mini.db' not found in any of ['/home/eloi/.config/sage/db/cremona', '/home/eloi/venv/share/sagemath/cremona', '/home/eloi/venv/share/cremona']
No equivalent system packages for pip are known to Sage.
Further installation instructions might be available at https://github.com/JohnCremona/ecdata.
>>> 
Traceback (most recent call last):
  File "src/cysignals/signals.pyx", line 341, in cysignals.signals.python_check_interrupt
KeyboardInterrupt
```

### Steps to reproduce

1. Install sagemath
2. Create and activate a virtual environment 
```
python3 -m venv venv --system-site-packages
. ./venv/bin/activate
```
3. Open python and type
```
from sage.all import *
EllipticCurve("38B2")
```

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sagemath: missing packages when running in a virtual environment
  2024-07-31 16:26 [ISSUE] sagemath: missing packages when running in a virtual environment Eloitor
@ 2024-08-01 15:51 ` Eloitor
  2024-08-06  2:55 ` [ISSUE] [CLOSED] " ahesford
  2024-08-06  2:55 ` ahesford
  2 siblings, 0 replies; 4+ messages in thread
From: Eloitor @ 2024-08-01 15:51 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 249 bytes --]

New comment by Eloitor on void-packages repository

https://github.com/void-linux/void-packages/issues/51574#issuecomment-2263404931

Comment:
I can reproduce the same behavior running 
`sage --python3 -m venv venv --system-site-packages` instead.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [ISSUE] [CLOSED] sagemath: missing packages when running in a virtual environment
  2024-07-31 16:26 [ISSUE] sagemath: missing packages when running in a virtual environment Eloitor
  2024-08-01 15:51 ` Eloitor
@ 2024-08-06  2:55 ` ahesford
  2024-08-06  2:55 ` ahesford
  2 siblings, 0 replies; 4+ messages in thread
From: ahesford @ 2024-08-06  2:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 2498 bytes --]

Closed issue by Eloitor on void-packages repository

https://github.com/void-linux/void-packages/issues/51574

Description:
### Is this a new report?

Yes

### System Info

Void 6.8.12_2 x86_64 GenuineIntel uptodate rrFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF

### Package(s) Affected

sagemath-10.4_1

### Does a report exist for this bug with the project's home (upstream) and/or another distro?

_No response_

### Expected behaviour

I can import and use sage from python, even in a virtual environment (with --system-site-packages).

### Actual behaviour

In a virtual environment, I open python and run
```
from sage.all import *
EllipticCurve("38B2")

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "sage/structure/factory.pyx", line 371, in sage.structure.factory.UniqueFactory.__call__ (build/cythonized/sage/structure/factory.c:4178)
  File "/usr/lib/python3.12/site-packages/sage/schemes/elliptic_curves/constructor.py", line 440, in create_key_and_extra_args
    x, data = CremonaDatabase().coefficients_and_data(x)
              ^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/sage/databases/cremona.py", line 1730, in CremonaDatabase
    return MiniCremonaDatabase(name)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/sage/databases/cremona.py", line 673, in __init__
    db_path = DatabaseCremona(name=name).absolute_filename()
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.12/site-packages/sage/features/__init__.py", line 841, in absolute_filename
    raise FeatureNotPresentError(self, reason=reason, resolution=self.resolution())
sage.features.FeatureNotPresentError: database_cremona_mini_ellcurve is not available.
'cremona_mini.db' not found in any of ['/home/eloi/.config/sage/db/cremona', '/home/eloi/venv/share/sagemath/cremona', '/home/eloi/venv/share/cremona']
No equivalent system packages for pip are known to Sage.
Further installation instructions might be available at https://github.com/JohnCremona/ecdata.
>>> 
Traceback (most recent call last):
  File "src/cysignals/signals.pyx", line 341, in cysignals.signals.python_check_interrupt
KeyboardInterrupt
```

### Steps to reproduce

1. Install sagemath
2. Create and activate a virtual environment 
```
python3 -m venv venv --system-site-packages
. ./venv/bin/activate
```
3. Open python and type
```
from sage.all import *
EllipticCurve("38B2")
```

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: sagemath: missing packages when running in a virtual environment
  2024-07-31 16:26 [ISSUE] sagemath: missing packages when running in a virtual environment Eloitor
  2024-08-01 15:51 ` Eloitor
  2024-08-06  2:55 ` [ISSUE] [CLOSED] " ahesford
@ 2024-08-06  2:55 ` ahesford
  2 siblings, 0 replies; 4+ messages in thread
From: ahesford @ 2024-08-06  2:55 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 599 bytes --]

New comment by ahesford on void-packages repository

https://github.com/void-linux/void-packages/issues/51574#issuecomment-2270284246

Comment:
This doesn't look like a bug, so much as a limitation of the search algorithm for a specific file. It seems the affected package looks in your home directory or in `../share` relative to the interpreter path, so it's your job to make sure one of those files exist if you try to relocate the interpreter by using a virtual environment.

You might try to convince upstream to make the search aware of virtual environments with access to system packages. 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2024-08-06  2:55 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-07-31 16:26 [ISSUE] sagemath: missing packages when running in a virtual environment Eloitor
2024-08-01 15:51 ` Eloitor
2024-08-06  2:55 ` [ISSUE] [CLOSED] " ahesford
2024-08-06  2:55 ` ahesford

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).