sassoftware / sas_kernel

A Jupyter kernel for SAS. This opens up all the data manipulation and analytics capabilities of your SAS system within a notebook interface. Use the Jupyter Notebook interface to execute SAS code and view results inline.
Apache License 2.0
199 stars 82 forks source link

Cannot install sas_kernel #93

Closed angelfish0808 closed 1 day ago

angelfish0808 commented 3 months ago

System win11, python version 3.12.4, cannot install sas_kernel, the error details are as follows:

Preparing metadata (setup.py) ... error error: subprocess-exited-with-error

× python setup.py egginfo did not run successfully. │ exit code: 1 ╰─> [6 lines of output] Traceback (most recent call last): File "", line 2, in File "", line 34, in File "D:\temp\pip-install-jfhdal8\sas-kernel_fafbcfc3f52446a78ab7c7a4fe56aa02\setup.py", line 25, in from sas_kernel.version import version ModuleNotFoundError: No module named 'sas_kernel' [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.

tomweber-sas commented 3 months ago

Can you show me what you did? What you typed in (what command) and where you typed it in? The usual way would be pip install sas_kernel from a command line where you have pip and python installed. All I can see from that is:

ModuleNotFoundError: No module named 'sas_kernel'

I don't know what you did.

angelfish0808 commented 3 months ago

@tomweber-sas I entered pip install sas_kernel through the cmd command line interface, and then the above error prompt was displayed. Saspy can be installed and configured normally.

tomweber-sas commented 3 months ago

Hmm. Well nothing in that traceback looks like anything I see when I install something. Can you run the following commands and show the complete log, including the commands, as below?

pip show sas_kernel pip uninstall sas_kernel pip install sas_kernel

Maybe something will stand out. Do pip show saspy too, just to see what it shows.

C:\Users\sastpw>pip show sas_kernel
Name: SAS-kernel
Version: 2.4.13
Summary: A SAS kernel for Jupyter
Home-page: https://github.com/sassoftware/sas_kernel
Author: Jared Dean
Author-email: jared.dean@sas.com
License: Apache Software License
Location: C:\Users\sastpw\AppData\Local\Programs\Python\Python311\Lib\site-packages
Requires: ipython, jupyter_client, metakernel, saspy
Required-by:

C:\Users\sastpw>pip uninstall sas_kernel
Found existing installation: SAS-kernel 2.4.13
Uninstalling SAS-kernel-2.4.13:
  Would remove:
    c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages\sas_kernel-2.4.13-py3.11.egg-info
    c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages\sas_kernel\*
Proceed (Y/n)? y
  Successfully uninstalled SAS-kernel-2.4.13

C:\Users\sastpw>pip install sas_kernel
Collecting sas_kernel
  Using cached SAS_kernel-2.4.13.tar.gz (89 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
  Installing backend dependencies ... done
  Preparing metadata (pyproject.toml) ... done
Requirement already satisfied: saspy>=3.6 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from sas_kernel) (5.7.0)
Requirement already satisfied: metakernel>=0.27.5 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from sas_kernel) (0.29.4)
Requirement already satisfied: jupyter-client>=6 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from sas_kernel) (7.4.8)
Requirement already satisfied: ipython>=7 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from sas_kernel) (8.8.0)
Requirement already satisfied: backcall in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (0.2.0)
Requirement already satisfied: decorator in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (5.1.1)
Requirement already satisfied: jedi>=0.16 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (0.18.2)
Requirement already satisfied: matplotlib-inline in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (0.1.6)
Requirement already satisfied: pickleshare in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (0.7.5)
Requirement already satisfied: prompt-toolkit<3.1.0,>=3.0.11 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (3.0.36)
Requirement already satisfied: pygments>=2.4.0 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (2.14.0)
Requirement already satisfied: stack-data in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (0.6.2)
Requirement already satisfied: traitlets>=5 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (5.8.0)
Requirement already satisfied: colorama in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipython>=7->sas_kernel) (0.4.6)
Requirement already satisfied: entrypoints in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-client>=6->sas_kernel) (0.4)
Requirement already satisfied: jupyter-core>=4.9.2 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-client>=6->sas_kernel) (5.1.2)
Requirement already satisfied: nest-asyncio>=1.5.4 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-client>=6->sas_kernel) (1.5.6)
Requirement already satisfied: python-dateutil>=2.8.2 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-client>=6->sas_kernel) (2.8.2)
Requirement already satisfied: pyzmq>=23.0 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-client>=6->sas_kernel) (24.0.1)
Requirement already satisfied: tornado>=6.2 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-client>=6->sas_kernel) (6.2)
Requirement already satisfied: ipykernel>=5.5.6 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from metakernel>=0.27.5->sas_kernel) (6.19.4)
Requirement already satisfied: pexpect>=4.8 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from metakernel>=0.27.5->sas_kernel) (4.8.0)
Requirement already satisfied: comm>=0.1.1 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipykernel>=5.5.6->metakernel>=0.27.5->sas_kernel) (0.1.2)
Requirement already satisfied: debugpy>=1.0 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipykernel>=5.5.6->metakernel>=0.27.5->sas_kernel) (1.6.4)
Requirement already satisfied: packaging in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipykernel>=5.5.6->metakernel>=0.27.5->sas_kernel) (22.0)
Requirement already satisfied: psutil in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from ipykernel>=5.5.6->metakernel>=0.27.5->sas_kernel) (5.9.4)
Requirement already satisfied: parso<0.9.0,>=0.8.0 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jedi>=0.16->ipython>=7->sas_kernel) (0.8.3)
Requirement already satisfied: platformdirs>=2.5 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-core>=4.9.2->jupyter-client>=6->sas_kernel) (2.6.2)
Requirement already satisfied: pywin32>=1.0 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from jupyter-core>=4.9.2->jupyter-client>=6->sas_kernel) (305)
Requirement already satisfied: ptyprocess>=0.5 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from pexpect>=4.8->metakernel>=0.27.5->sas_kernel) (0.7.0)
Requirement already satisfied: wcwidth in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from prompt-toolkit<3.1.0,>=3.0.11->ipython>=7->sas_kernel) (0.2.5)
Requirement already satisfied: six>=1.5 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from python-dateutil>=2.8.2->jupyter-client>=6->sas_kernel) (1.16.0)
Requirement already satisfied: executing>=1.2.0 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from stack-data->ipython>=7->sas_kernel) (1.2.0)
Requirement already satisfied: asttokens>=2.1.0 in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from stack-data->ipython>=7->sas_kernel) (2.2.1)
Requirement already satisfied: pure-eval in c:\users\sastpw\appdata\local\programs\python\python311\lib\site-packages (from stack-data->ipython>=7->sas_kernel) (0.2.2)
Building wheels for collected packages: sas_kernel
  Building wheel for sas_kernel (pyproject.toml) ... done
  Created wheel for sas_kernel: filename=SAS_kernel-2.4.13-py3-none-any.whl size=95564 sha256=1a6eee5540627927ad4a6930a048d7f3ec5e36eaeba7e9866fe1429c5328f452
  Stored in directory: c:\users\sastpw\appdata\local\pip\cache\wheels\fe\7d\0a\f288ede14e73b91655d8573df0b14e460ca0e95f641f899657
Successfully built sas_kernel
Installing collected packages: sas_kernel
Successfully installed sas_kernel-2.4.13

[notice] A new release of pip is available: 23.1 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip

C:\Users\sastpw>
angelfish0808 commented 3 months ago

@tomweber-sas

C:\Users\angelfish>pip show sas_kernel WARNING: Package(s) not found: sas_kernel

C:\Users\angelfish>pip uninstall sas_kernel WARNING: Skipping sas_kernel as it is not installed.

C:\Users\angelfish>pip install sas_kernel Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting sas_kernel Using cached https://pypi.tuna.tsinghua.edu.cn/packages/6e/8c/ff91ab09cc8fc1b7ac0b8539d6021717853e7168359200eae02bddbc2910/SAS_kernel-2.4.13.tar.gz (89 kB) 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 "", line 2, in File "", line 34, in File "D:\temp\pip-install-p840gvc0\sas-kernel_9051b7a2637241299b2215e8c4773c23\setup.py", line 25, in from sas_kernel.version import version ModuleNotFoundError: No module named 'sas_kernel' [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.

C:\Users\angelfish>pip show saspy Name: saspy Version: 5.14.0 Summary: A Python interface to SAS Home-page: https://github.com/sassoftware/saspy Author: Tom Weber Author-email: Tom.Weber@sas.com License: Location: D:\python\Lib\site-packages Requires: Required-by:

tomweber-sas commented 3 months ago

Ok, I see this same traceback in different links when I google the first error. Having never seen a trackback that looked like that, and you're on python 3.12, I'm guessing it's related to changes that came along having to do with building packages. Looking back, I made changes for that in SASPy over a year ago, in V5.0.2. Assuming everything is fine and normal on your side, that could explain this failure while installing saspy on the same system works. Since I can't reproduce this (assuming because I don't have 3.12) could you try something quickly to see if my guess is right? Can you uninstall saspy then try installing the version before I changes how it builds to the newer way? If you get that same kind of traceback, that should mean I'm correct. Else, more to figure out. Just do the following:

pip uninstall -y saspy
pip install http://github.com/sassoftware/saspy/releases/saspy-5.0.0.tar.gz

then either way, uninstall if that worked and just do a pip install again and it'll get you back to the current version. doing an uninstall then install won't mess up your config, and it's the cleanest way that's simple. If you get that same traceback with that version of saspy, then it's this problem I'm thinking of. I'll have to see about trying to update the sas_kernel in the same way I did saspy a year ago.

Thanks! Tom

angelfish0808 commented 3 months ago

@tomweber-sas

C:\Users\angelfish>pip uninstall saspy Found existing installation: saspy 5.14.0 Uninstalling saspy-5.14.0: Would remove: d:\python\lib\site-packages\saspy-5.14.0.dist-info* d:\python\lib\site-packages\saspy* Would not remove (might be manually added): d:\python\lib\site-packages\saspy\sascfg_personal.py Proceed (Y/n)? y Successfully uninstalled saspy-5.14.0

C:\Users\angelfish>pip install saspy==5.0.0 Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting saspy==5.0.0 Downloading https://pypi.tuna.tsinghua.edu.cn/packages/3e/2e/22ca1f6f1ff9dd30a762c91d93f57b81d5a9de1087f42a020add73d8a213/saspy-5.0.0.tar.gz (9.9 MB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 9.9/9.9 MB 4.1 MB/s eta 0:00:00 Preparing metadata (setup.py) ... done Building wheels for collected packages: saspy Building wheel for saspy (setup.py) ... done Created wheel for saspy: filename=saspy-5.0.0-py3-none-any.whl size=9939007 sha256=f5b9b9d6990548495ed8d6d92faa07083af0ee2fe98c3d5e70f0956b5d0d4942 Stored in directory: d:\python\pipcache\wheels\8b\e0\fd\6a97fdb87fe6360a3de55099eb6cc1767e5fe2713c64c0279f Successfully built saspy Installing collected packages: saspy Successfully installed saspy-5.0.0

tomweber-sas commented 3 months ago

So that seems to negate my guess that it has to do with the new .toml build process. In the issues I found online that had tracebacks that looked like yours, I didn't find any good answers that gave a an idea of what this may be. They mentioned upgrading pip, but you have a newer python, and I suspect pip; I don't see the warnings on your install above, like I get when I run pip, since mine's is older:

[notice] A new release of pip is available: 23.1 -> 24.0
[notice] To update, run: python.exe -m pip install --upgrade pip

So I'm guessing you have the latest pip and that's not relevant. I still think it must have something to do with the new install process. One thing I see different is that saspy was downloaded while the sas_kernel was from some cache. Could you try the following option in your pip install:

pip install --no-cache-dir sas_kernel

and see if that makes any difference?

angelfish0808 commented 3 months ago

@tomweber-sas There is a cache because it has been downloaded before

C:\Users\angelfish>pip install --no-cache-dir sas_kernel Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Collecting sas_kernel Downloading https://pypi.tuna.tsinghua.edu.cn/packages/6e/8c/ff91ab09cc8fc1b7ac0b8539d6021717853e7168359200eae02bddbc2910/SAS_kernel-2.4.13.tar.gz (89 kB) ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.3/89.3 kB 1.3 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 "", line 2, in File "", line 34, in File "D:\temp\pip-install-wk509sk1\sas-kernel_e65a25a994974ac2be66b04b442b8b17\setup.py", line 25, in from sas_kernel.version import version ModuleNotFoundError: No module named 'sas_kernel' [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.

tomweber-sas commented 3 months ago

Hey I'm sorry this is taking so long. I still can't reproduce this and I've been pulled off on other things. But looking at the error more, it may be due to the temp path it's creating for the install.

File "D:\temp\pip-install-wk509sk1\sas-kernel_e65a25a994974ac2be66b04b442b8b17\setup.py", line 25, in
from sas_kernel.version import version
ModuleNotFoundError: No module named 'sas_kernel'

when I install I don't get that sas-kernel_e65a25a994974ac2be66b04b442b8b17 path, it's sas_kernel. So the error about not finding sas_kernel may be due to that naming convention your install seems to be using.

Sorry to keep asking you to try things, but again, I can't see anything like this to prove anything here. Are you able to go to the sas_kernel release page and download the zip file with this package? Then unzip it to a directory on your filesystem. Then cd to the root directory of the repo, under where it was unzipped; where setup.py is and then do a pip install .
where . (dot) means current dir.

 C:\Users\sastpw\SKissue93>cd sas_kernel-2.4.13

C:\Users\sastpw\SKissue93\sas_kernel-2.4.13>dir
 Volume in drive C is Windows
 Volume Serial Number is E862-9DB5

 Directory of C:\Users\sastpw\SKissue93\sas_kernel-2.4.13

06/20/2024  03:57 PM    <DIR>          .
06/20/2024  03:57 PM    <DIR>          ..
06/20/2024  03:57 PM    <DIR>          .github
12/01/2022  02:34 PM               153 .gitignore
06/20/2024  03:57 PM    <DIR>          binder
12/01/2022  02:34 PM             2,565 ContributorAgreement.txt
12/01/2022  02:34 PM             4,152 iris.sas
12/01/2022  02:34 PM            11,358 LICENSE.txt
06/20/2024  03:57 PM    <DIR>          notebook
12/01/2022  02:34 PM             9,501 Readme.md
06/20/2024  03:57 PM    <DIR>          sas_kernel
12/01/2022  02:34 PM             1,173 setup.cfg
12/01/2022  02:34 PM             1,648 setup.py
12/01/2022  02:34 PM             1,123 __init__.py
               8 File(s)         31,673 bytes
               6 Dir(s)  13,944,807,424 bytes free

C:\Users\sastpw\SKissue93\sas_kernel-2.4.13>pip install .

and let's see if that solves this error.

angelfish0808 commented 3 months ago

@tomweber-sas

PS C:\Users\angelfish\Downloads\sas_kernel-2.4.13> dir

目录: C:\Users\angelfish\Downloads\sas_kernel-2.4.13

Mode LastWriteTime Length Name


d----- 2022/12/2 5:34 .github d----- 2022/12/2 5:34 binder d----- 2022/12/2 5:34 notebook d----- 2022/12/2 5:34 sas_kernel -a---- 2022/12/2 5:34 153 .gitignore -a---- 2022/12/2 5:34 2565 ContributorAgreement.txt -a---- 2022/12/2 5:34 4152 iris.sas -a---- 2022/12/2 5:34 11358 LICENSE.txt -a---- 2022/12/2 5:34 9501 Readme.md -a---- 2022/12/2 5:34 1173 setup.cfg -a---- 2022/12/2 5:34 1648 setup.py -a---- 2022/12/2 5:34 1123 init.py

PS C:\Users\angelfish\Downloads\sas_kernel-2.4.13> pip install . Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing c:\users\angelfish\downloads\sas_kernel-2.4.13 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 "", line 2, in File "", line 34, in File "C:\Users\angelfish\Downloads\sas_kernel-2.4.13\setup.py", line 25, in from sas_kernel.version import version ModuleNotFoundError: No module named 'sas_kernel' [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.

tomweber-sas commented 3 months ago

Ok, you did that just as I asked and that still didn't get it to work. There must be something that's changed or different with the version of pip or python, as I can't see anything like this. To get this installed, let's try one more thing to directly address the error. Since you have the repo right there, can you make a change to the setup.py file and then try the pip install . again after?

In that file, comment out the following line: from sas_kernel.version import version change to

from sas_kernel.version import version

And then change this line from version=version, to version='2.4.13',

From what I can tell that ought to get rid of the error it's complaining about. Sorry to make you keep trying things. Can you also run pip -V so I can see what version of pip you're using?

C:\Users\sastpw\SKissue93\sas_kernel-2.4.13>pip -V
pip 24.0 from C:\Users\sastpw\AppData\Local\Programs\Python\Python311\Lib\site-packages\pip (python 3.11)
angelfish0808 commented 3 months ago

@tomweber-sas I did other tests and it worked when I installed the zip file downloaded from github through a virtual environment, using "pip install C:\Users\angelfish\Downloads\sas_kernel-2.4.13.zip", but it also failed if I pip install sas_kernel directly. It also failed to install it in the global environment using "pip install C:\Users\angelfish\Downloads\sas_kernel-2.4.13.zip". image

angelfish0808 commented 3 months ago

@tomweber-sas (venv) D:\python\test>pip install C:\Users\angelfish\Downloads\sas_kernel-2.4.13.zip Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple Processing c:\users\angelfish\downloads\sas_kernel-2.4.13.zip Installing build dependencies ... done Getting requirements to build wheel ... done Installing backend dependencies ... done Preparing metadata (pyproject.toml) ... done Collecting saspy>=3.6 (from SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/01/f7/edea0333aba2a92550dc3813563538518603466578f2d4bc5c59d1846e04/saspy-5.14.0-py3-none-any.whl (9.9 MB) Collecting metakernel>=0.27.5 (from SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/07/b2/dabf31fd598a777f43e08b33de6540b16df1bd13c1b917ead58ac21bb245/metakernel-0.30.2-py3-none-any.whl (217 kB) Collecting jupyter-client>=6 (from SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/cf/d3/c4bb02580bc0db807edb9a29b2d0c56031be1ef0d804336deb2699a470f6/jupyter_client-8.6.2-py3-none-any.whl (105 kB) Collecting ipython>=7 (from SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c0/78/fae11aa2dd7e948fbf6283f8abaff267b37a4a3cba531d0aa4274137e793/ipython-8.25.0-py3-none-any.whl (817 kB) Collecting decorator (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6/decorator-5.1.1-py3-none-any.whl (9.1 kB) Collecting jedi>=0.16 (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/20/9f/bc63f0f0737ad7a60800bfd472a4836661adae21f9c2535f3957b1e54ceb/jedi-0.19.1-py2.py3-none-any.whl (1.6 MB) Collecting matplotlib-inline (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/8f/8e/9ad090d3553c280a8060fbf6e24dc1c0c29704ee7d1c372f0c174aa59285/matplotlib_inline-0.1.7-py3-none-any.whl (9.9 kB) Collecting prompt-toolkit<3.1.0,>=3.0.41 (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e8/23/22750c4b768f09386d1c3cc4337953e8936f48a888fa6dddfb669b2c9088/prompt_toolkit-3.0.47-py3-none-any.whl (386 kB) Collecting pygments>=2.4.0 (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f7/3f/01c8b82017c199075f8f788d0d906b9ffbbc5a47dc9918a945e13d5a2bda/pygments-2.18.0-py3-none-any.whl (1.2 MB) Collecting stack-data (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f1/7b/ce1eafaf1a76852e2ec9b22edecf1daa58175c090266e9f6c64afcd81d91/stack_data-0.6.3-py3-none-any.whl (24 kB) Collecting traitlets>=5.13.0 (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/00/c0/8f5d070730d7836adc9c9b6408dec68c6ced86b304a9b26a14df072a6e8c/traitlets-5.14.3-py3-none-any.whl (85 kB) Collecting colorama (from ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d1/d6/3965ed04c63042e047cb6a3e6ed1a63a35087b6a609aa3a15ed8ac56c221/colorama-0.4.6-py2.py3-none-any.whl (25 kB) Collecting jupyter-core!=5.0.,>=4.12 (from jupyter-client>=6->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c9/fb/108ecd1fe961941959ad0ee4e12ee7b8b1477247f30b1fdfd83ceaf017f0/jupyter_core-5.7.2-py3-none-any.whl (28 kB) Collecting python-dateutil>=2.8.2 (from jupyter-client>=6->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/ec/57/56b9bcc3c9c6a792fcbaf139543cee77261f3651ca9da0c93f5c1221264b/python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB) Collecting pyzmq>=23.0 (from jupyter-client>=6->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/6c/45/905ec497208808aa0ba2470b2ab36d779b53f4016617feca93baffb6ba7f/pyzmq-26.0.3-cp312-cp312-win_amd64.whl (770 kB) Collecting tornado>=6.2 (from jupyter-client>=6->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d9/2f/3f2f05e84a7aff787a96d5fb06821323feb370fe0baed4db6ea7b1088f32/tornado-6.4.1-cp38-abi3-win_amd64.whl (438 kB) Collecting ipykernel<7,>=5.5.6 (from metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/53/9d/40d5207db523363d9b5698f33778c18b0d591e3fdb6e0116b894b2a2491c/ipykernel-6.29.4-py3-none-any.whl (117 kB) Collecting pexpect>=4.8 (from metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/9e/c3/059298687310d527a58bb01f3b1965787ee3b40dce76752eda8b44e9a2c5/pexpect-4.9.0-py2.py3-none-any.whl (63 kB) Collecting comm>=0.1.1 (from ipykernel<7,>=5.5.6->metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/e6/75/49e5bfe642f71f272236b5b2d2691cf915a7283cc0ceda56357b61daa538/comm-0.2.2-py3-none-any.whl (7.2 kB) Collecting debugpy>=1.6.5 (from ipykernel<7,>=5.5.6->metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/f5/6d/d4e819e7e8a9f946eb1ce51492fbe8f8d03ad033f233096da864a5262084/debugpy-1.8.1-cp312-cp312-win_amd64.whl (4.6 MB) Collecting nest-asyncio (from ipykernel<7,>=5.5.6->metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/a0/c4/c2971a3ba4c6103a3d10c4b0f24f461ddc027f0f09763220cf35ca1401b3/nest_asyncio-1.6.0-py3-none-any.whl (5.2 kB) Collecting packaging (from ipykernel<7,>=5.5.6->metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/08/aa/cc0199a5f0ad350994d660967a8efb233fe0416e4639146c089643407ce6/packaging-24.1-py3-none-any.whl (53 kB) Collecting psutil (from ipykernel<7,>=5.5.6->metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/73/44/561092313ae925f3acfaace6f9ddc4f6a9c748704317bad9c8c8f8a36a79/psutil-6.0.0-cp37-abi3-win_amd64.whl (257 kB) Collecting parso<0.9.0,>=0.8.3 (from jedi>=0.16->ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/c6/ac/dac4a63f978e4dcb3c6d3a78c4d8e0192a113d288502a1216950c41b1027/parso-0.8.4-py2.py3-none-any.whl (103 kB) Collecting platformdirs>=2.5 (from jupyter-core!=5.0.,>=4.12->jupyter-client>=6->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/68/13/2aa1f0e1364feb2c9ef45302f387ac0bd81484e9c9a4c5688a322fbdfd08/platformdirs-4.2.2-py3-none-any.whl (18 kB) Collecting pywin32>=300 (from jupyter-core!=5.0.*,>=4.12->jupyter-client>=6->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/83/1c/25b79fc3ec99b19b0a0730cc47356f7e2959863bf9f3cd314332bddb4f68/pywin32-306-cp312-cp312-win_amd64.whl (9.2 MB) Collecting ptyprocess>=0.5 (from pexpect>=4.8->metakernel>=0.27.5->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/22/a6/858897256d0deac81a172289110f31629fc4cee19b6f01283303e18c8db3/ptyprocess-0.7.0-py2.py3-none-any.whl (13 kB) Collecting wcwidth (from prompt-toolkit<3.1.0,>=3.0.41->ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/fd/84/fd2ba7aafacbad3c4201d395674fc6348826569da3c0937e75505ead3528/wcwidth-0.2.13-py2.py3-none-any.whl (34 kB) Collecting six>=1.5 (from python-dateutil>=2.8.2->jupyter-client>=6->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/d9/5a/e7c31adbe875f2abbb91bd84cf2dc52d792b5a01506781dbcf25c91daf11/six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting executing>=1.2.0 (from stack-data->ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/80/03/6ea8b1b2a5ab40a7a60dc464d3daa7aa546e0a74d74a9f8ff551ea7905db/executing-2.0.1-py2.py3-none-any.whl (24 kB) Collecting asttokens>=2.1.0 (from stack-data->ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/45/86/4736ac618d82a20d87d2f92ae19441ebc7ac9e7a581d7e58bbe79233b24a/asttokens-2.4.1-py2.py3-none-any.whl (27 kB) Collecting pure-eval (from stack-data->ipython>=7->SAS_kernel==2.4.13) Using cached https://pypi.tuna.tsinghua.edu.cn/packages/2b/27/77f9d5684e6bce929f5cfe18d6cfbe5133013c06cb2fbf5933670e60761d/pure_eval-0.2.2-py3-none-any.whl (11 kB) Building wheels for collected packages: SAS_kernel Building wheel for SAS_kernel (pyproject.toml) ... done Created wheel for SAS_kernel: filename=SAS_kernel-2.4.13-py3-none-any.whl size=99060 sha256=fe6df0e9573617c0f4404c2ca0ee6a84a8a9ecfbff56b0a5fa190c1d6711c19d Stored in directory: d:\python\pipcache\wheels\be\14\a1\527940697620c915adf9c736aa9a0be246765e26ab4c75d6d7 Successfully built SAS_kernel Installing collected packages: wcwidth, saspy, pywin32, pure-eval, ptyprocess, traitlets, tornado, six, pyzmq, pygments, psutil, prompt-toolkit, platformdirs, pexpect, parso, packaging, nest-asyncio, executing, decorator, debugpy, colorama, python-dateutil, matplotlib-inline, jupyter-core, jedi, comm, asttokens, stack-data, jupyter-client, ipython, ipykernel, metakernel, SAS_kernel Successfully installed SAS_kernel-2.4.13 asttokens-2.4.1 colorama-0.4.6 comm-0.2.2 debugpy-1.8.1 decorator-5.1.1 executing-2.0.1 ipykernel-6.29.4 ipython-8.25.0 jedi-0.19.1 jupyter-client-8.6.2 jupyter-core-5.7.2 matplotlib-inline-0.1.7 metakernel-0.30.2 nest-asyncio-1.6.0 packaging-24.1 parso-0.8.4 pexpect-4.9.0 platformdirs-4.2.2 prompt-toolkit-3.0.47 psutil-6.0.0 ptyprocess-0.7.0 pure-eval-0.2.2 pygments-2.18.0 python-dateutil-2.9.0.post0 pywin32-306 pyzmq-26.0.3 saspy-5.14.0 six-1.16.0 stack-data-0.6.3 tornado-6.4.1 traitlets-5.14.3 wcwidth-0.2.13

tomweber-sas commented 3 months ago

Wow, I just don't have any idea what the problem is with that in all of the other cases, since nothing else worked. In the case where you were able to install it, what will work for you?

Well, looking at the log above, that worked, I see a difference that's about the newer build system I mentioned to begin with:

Preparing metadata (pyproject.toml) ... done

While the others had this error (which is why I thought the new build to start with):

Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error

That's the new way, instead of the old setup.py way. BUT, sas_kernel doesn't have the pyproject.toml file in it. So where did that come from such that this now worked? That's very strange!

What I need to do is to update sas_kernel to use the new pyproject.toml way and see if that will make it work by default for you. That's something that should be done, but it'll take a bit of time, as I'll have to re-research that to figure out how to make it work. SASPy was easy, esp. because it has no dependencies. SAS_kernel has a bunch, and I will have to see if that makes any difference in how to structure the new install way of doing this.

I'll try to get to that next week, and if you don't mind trying it out for me once I get it implemented, I would be grateful! I appreciate you trying these different things out for me since I can't reproduce what you're seeing.

Thanks! Tom

angelfish0808 commented 3 months ago

@tomweber-sas Sure, I will test it and give you feedback in time after you release the new version. Thanks!

angelfish0808 commented 3 months ago

@tomweber-sas By the way, a bug was found when the virtual environment was running. If Jupyter selected two dark-colored themes, the parameter values ​​of the generated images could not be seen. Only when a light color was selected, the parameter values ​​of the images could be seen. image image image

tomweber-sas commented 3 months ago

Yes, Jupyter doesn't handle embedded html the best, especially when color schemes don't match. If you change jupyter to use dark theme's you will need to change the theme for the ODS output to be compatible. In SASPy there's an attribute on the SASsession object you can change, on the fly, to whatever ODS color theme you want, but since you can't get at that in a SAS_kernel notebook, I added a configuration option in the SAS_config_options dictionary in the sascfg_personl.py file. See the doc here. For a dark theme, you could specify 'style' : 'Raven' which is a dark theme. The ODS styles are documented here under HTML5 ODS even lets you define your own style, so you could create one that matches how you want if none of the provided ones are to your liking.

angelfish0808 commented 2 months ago

@tomweber-sas HI, when will the new version be released?

tomweber-sas commented 2 months ago

Hey @angelfish0808 , I'm sorry, I've been busy on other things. But, I've recently been staging new machines and installing the latest Python (3.12) and pip, and I've yet to find a situation the sas_kernal failed to install and I've still never been able to reproduce the failure you saw. I haven't had a chance to try to convert sas_kernel to use the new build with the pyproject.toml instead of setup.py. Did you ever figure out the difference between when it worked for you and when it failed? Also, did changing the ods style help with the color confusion? I'll try to experiment with the pyproject.toml to see if I can get that to work. But since I still can't reproduce your error, I'm not sure if that with adress it or not. Still just a guess. I'll need you to try it with the cases where it doesn't work for you.

tomweber-sas commented 2 months ago

Well, I tried adding a pyproject.toml file (same as I have for saspy) to see if that would work like it does for saspy, but it didn't work. the install for the kernel is complicated because it's a jupyter extension, not just a python package, and it tries to install itself into jupyter. I don't know how all of that works and that's going to take more time to try to understand, esp, the failure when trying to do this other new build style.

But, in case it's just some issue with the specific error that you're getting (that I've never seen yet), I just pushed a minor change to the setup.py file, to main, to see if that makes any difference in your case. Can you try installing what's at main now? looking back it seems you tried downloading it as the .zip and it worked in some env but not others. Can you see if this change helps in the places where you get the failure? I'm also curious what's different in those environments such that it works in one but not the other? What versions of pip are in those?

The change I made is hoping to address this error you're getting:

File "D:\temp\pip-install-jfhdal8_\sas-kernel_fafbcfc3f52446a78ab7c7a4fe56aa02\setup.py", line 25, in
from sas_kernel.version import version
ModuleNotFoundError: No module named 'sas_kernel'

but since I can't reproduce the error, I can't know if it will address this or not. Need you to try it where it fails for you.

ShuguangSun commented 2 months ago

Just for your information. I try to install sas_kernel to python 3.12 @ conda-forge but the the kernel is not added automatically that is, there is no sas subfolder in the jupyter kernels dir. I added it manually as those in the install.py and it works. I used to intall sas_kernel to python 3.11 @ conda-forge and sas kernel was added automatically.

I tried to run: python install.py --user However it raised an error:

Traceback (most recent call last):
  File "path\to\sas_kernel\install.py", line 23, in <module>
    from .data import _dataRoot
ImportError: attempted relative import with no known parent package
tomweber-sas commented 2 months ago

Thanks for the additional issue @ShuguangSun . I haven't tried installing the sas_kernel from conda-forge. One thing about this issue in general is that I can't make the reported failure happen (the one for this issue, not the one you're showing; haven't tried that). I've tried with older python and pip and with the latest python and pip. The other thing is that the code that is getting the error, in both cases, is the same code that's been part of the install code in this package for years. So, it seems as though something else has changed out from under it. Python or the installers. Looking at conda-forge, they did change their packaging, and maybe how it installs, like a year and a half ago. Only the latest version of sas_kernel is packaged in the new format (or whatever the differences are). You can see here it changed from tar to conda. Again, I'm not sure what differences that makes. The error you show, seems to be with how the install is set up. That code worked for years as is, so I'm guessing it's something to do with changes in how it's installed. I don't have a conda environment currently to try this case out with, at the moment. But I'll see if I can set something up to try to reproduce this too.

angelfish0808 commented 3 weeks ago

In the latest python3.12.6, executing pip install sas_kernel can actually be installed normally. Suddenly I find it incredible that there is no need to install sas_kernel through the python virtual environment. The win virtual machine can also be installed normally after testing. I can’t explain why. It may be a bug in the previous version of python. However, it would be a better thing if some new updates can be made for this jupyter kernel in the future. @tomweber-sas

tomweber-sas commented 3 weeks ago

Thanks for letting me know it's working now. It does sound like an issue with what you had in your environment (python modules/versions/...). I've never been able to see that error, and so don't have anything to fix it. I did installs w/ python3.12 on some new machines I was setting up and never saw anything like that.; worked fine as is.

I also ran into some issues like this, this week trying to publish a new release of SASPy. First the doc wasn't building right, like I've done a hundred times, got some error that seemed to be due to some change in my deployment. So I upgraded sphinx (that's what builds the saspy doc), and then it started failing even worse. I had to keep downgrading till it started working again. Then I went to upload to PyPI and that failed (again, I've done that a hundred times). And there was some bug introduced in a package that got upgraded due to the sphinx update I did. So I had to go figure out which thing had a bug in it and reinstall a different version. I finally got the release published and the doc updated. But it was all because of some bugs/changes in some other packages in my python deployment which I had to track down and replace w/ version that would work again; like it had previously all of the time.

Your issue seems a lot like that. And now it works with what you have again after changing/updating things in your deployment. I still don't have anything to change or fix in the sas_kernel, as it works in every case I've tried.

Did you try the change I made to main, a while back. From the last post on July 17th? https://github.com/sassoftware/sas_kernel/issues/93#issuecomment-2234200155

Tom

tomweber-sas commented 1 day ago

Since I still have nothing to fix, the problem only existed in some transient state of your repo, which now works, I'm going to close this. If you ever see it again, feel free to reopen.

Thanks, Tom