Github messages for voidlinux
 help / color / mirror / Atom feed
* [ISSUE] `jupyter lab` not working in virtual enviroment
@ 2023-11-09 14:36 Eloitor
  2023-11-09 15:21 ` Eloitor
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: Eloitor @ 2023-11-09 14:36 UTC (permalink / raw)
  To: ml

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

New issue by Eloitor on void-packages repository

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

Description:
### Is this a new report?

Yes

### System Info

Void 6.5.9_1 x86_64 GenuineIntel uptodate rFFFFFFFFFFFFFFFFFFFFFFFFFFF

### Package(s) Affected

sagemath-10.1_4 jupyterlab-4.0.7_1

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

_No response_

### Expected behaviour

I can use sagemath in a virtual environment in `jupyter lab`.

### Actual behaviour

I can use sagemath in a virtualenvironment in the repl, but not with `jupyer lab`.

### Steps to reproduce

1. Install `sagemath` and `jupyterlab`
2. Create a python virtual environment: `python3 -m venv /path/to/venv`
3. Activate the virtual environment: `.  /path/to/venv/bin/activate`
4. Run `sage`, output is 
```
$ sage                      
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.1, Release Date: 2023-08-20                    │
│ Using Python 3.12.0. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
/usr/lib/python3.12/site-packages/IPython/core/interactiveshell.py:913: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
  warn(
sage: 
```
After this, sage works as expected.

5. Quit sage with `Control + D`.

6. run `jupyter lab`, and create a new sagemath notebook.

The notebook does not work (computations get stuck forever).
```
/path/to/venv/bin/python3: Error while finding module specification for 'sage.repl.ipython_kernel' (ModuleNotFoundError: No module named 'sage')
```


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

* Re: `jupyter lab` not working in virtual enviroment
  2023-11-09 14:36 [ISSUE] `jupyter lab` not working in virtual enviroment Eloitor
@ 2023-11-09 15:21 ` Eloitor
  2023-11-26 16:29 ` tornaria
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: Eloitor @ 2023-11-09 15:21 UTC (permalink / raw)
  To: ml

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

New comment by Eloitor on void-packages repository

https://github.com/void-linux/void-packages/issues/47135#issuecomment-1804034798

Comment:
Maybe this is easier to debug:

```
$ . /path/to/venv/bin/activate
$ jupyter console --kernel=sagemath
/path/to/venv/bin/python3: Error while finding module specification for 'sage.repl.ipython_kernel' (ModuleNotFoundError: No module named 'sage.repl')
```

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

* Re: `jupyter lab` not working in virtual enviroment
  2023-11-09 14:36 [ISSUE] `jupyter lab` not working in virtual enviroment Eloitor
  2023-11-09 15:21 ` Eloitor
@ 2023-11-26 16:29 ` tornaria
  2023-11-27  8:27 ` Eloitor
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-11-26 16:29 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/issues/47135#issuecomment-1826828577

Comment:
Of course this is expected and how venv works afaik:
```
$ python -m venv bad-venv
$ . bad-venv/bin/activate
(bad-venv) $ python -m sage
.../bad-venv/bin/python: No module named sage
(bad-venv) $
```

What you want can be acomplished with `--system-site-packages`:
```
$ python -m venv --system-site-packages good-venv
$ . good-venv/bin/activate
(good-venv) $ python -m sage
.../good-venv/bin/python: No module named sage.__main__; 'sage' is a package and cannot be directly executed
(good-venv) $ jupyter console --kernel=sagemath
[IPKernelApp] WARNING | debugpy_stream undefined, debugging will not be enabled
Jupyter console 6.6.3

┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.2.rc4, Release Date: 2023-11-17                │
│ Using Python 3.12.0. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
┏━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Warning: this is a prerelease version, and it may be unstable.     ┃
┗━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┛
In [1]: 
```

Please check if this works for you. Note that running sage like this is unsupported upstream. They really want you to build the whole kitchen sink.

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

* Re: `jupyter lab` not working in virtual enviroment
  2023-11-09 14:36 [ISSUE] `jupyter lab` not working in virtual enviroment Eloitor
  2023-11-09 15:21 ` Eloitor
  2023-11-26 16:29 ` tornaria
@ 2023-11-27  8:27 ` Eloitor
  2023-11-28  2:25 ` tornaria
  2023-11-28  2:31 ` [ISSUE] [CLOSED] " classabbyamp
  4 siblings, 0 replies; 6+ messages in thread
From: Eloitor @ 2023-11-27  8:27 UTC (permalink / raw)
  To: ml

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

New comment by Eloitor on void-packages repository

https://github.com/void-linux/void-packages/issues/47135#issuecomment-1827352492

Comment:
This works for me! Thank you. It also works in `jupyter lab`.

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

* Re: `jupyter lab` not working in virtual enviroment
  2023-11-09 14:36 [ISSUE] `jupyter lab` not working in virtual enviroment Eloitor
                   ` (2 preceding siblings ...)
  2023-11-27  8:27 ` Eloitor
@ 2023-11-28  2:25 ` tornaria
  2023-11-28  2:31 ` [ISSUE] [CLOSED] " classabbyamp
  4 siblings, 0 replies; 6+ messages in thread
From: tornaria @ 2023-11-28  2:25 UTC (permalink / raw)
  To: ml

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

New comment by tornaria on void-packages repository

https://github.com/void-linux/void-packages/issues/47135#issuecomment-1828958746

Comment:
> This works for me! Thank you. It also works in `jupyter lab`.

If it's fixed, please close the issue as solved (I don't have permission myself).

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

* Re: [ISSUE] [CLOSED] `jupyter lab` not working in virtual enviroment
  2023-11-09 14:36 [ISSUE] `jupyter lab` not working in virtual enviroment Eloitor
                   ` (3 preceding siblings ...)
  2023-11-28  2:25 ` tornaria
@ 2023-11-28  2:31 ` classabbyamp
  4 siblings, 0 replies; 6+ messages in thread
From: classabbyamp @ 2023-11-28  2:31 UTC (permalink / raw)
  To: ml

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

Closed issue by Eloitor on void-packages repository

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

Description:
### Is this a new report?

Yes

### System Info

Void 6.5.9_1 x86_64 GenuineIntel uptodate rFFFFFFFFFFFFFFFFFFFFFFFFFFF

### Package(s) Affected

sagemath-10.1_4 jupyterlab-4.0.7_1

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

_No response_

### Expected behaviour

I can use sagemath in a virtual environment in `jupyter lab`.

### Actual behaviour

I can use sagemath in a virtualenvironment in the repl, but not with `jupyer lab`.

### Steps to reproduce

1. Install `sagemath` and `jupyterlab`
2. Create a python virtual environment: `python3 -m venv /path/to/venv`
3. Activate the virtual environment: `.  /path/to/venv/bin/activate`
4. Run `sage`, output is 
```
$ sage                      
┌────────────────────────────────────────────────────────────────────┐
│ SageMath version 10.1, Release Date: 2023-08-20                    │
│ Using Python 3.12.0. Type "help()" for help.                       │
└────────────────────────────────────────────────────────────────────┘
/usr/lib/python3.12/site-packages/IPython/core/interactiveshell.py:913: UserWarning: Attempting to work in a virtualenv. If you encounter problems, please install IPython inside the virtualenv.
  warn(
sage: 
```
After this, sage works as expected.

5. Quit sage with `Control + D`.

6. run `jupyter lab`, and create a new sagemath notebook.

The notebook does not work (computations get stuck forever).
```
/path/to/venv/bin/python3: Error while finding module specification for 'sage.repl.ipython_kernel' (ModuleNotFoundError: No module named 'sage')
```


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

end of thread, other threads:[~2023-11-28  2:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-11-09 14:36 [ISSUE] `jupyter lab` not working in virtual enviroment Eloitor
2023-11-09 15:21 ` Eloitor
2023-11-26 16:29 ` tornaria
2023-11-27  8:27 ` Eloitor
2023-11-28  2:25 ` tornaria
2023-11-28  2:31 ` [ISSUE] [CLOSED] " classabbyamp

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).