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

Spyder IDE doesn't start #208567

Closed
hervyqa opened this issue Jan 1, 2023 · 5 comments · Fixed by #208734
Closed

Spyder IDE doesn't start #208567

hervyqa opened this issue Jan 1, 2023 · 5 comments · Fixed by #208734

Comments

@hervyqa
Copy link

hervyqa commented Jan 1, 2023

Describe the bug

Can't run spyder IDE

Steps To Reproduce

Steps to reproduce the behavior:

  1. add spyder pkgs in configuration.nix
  2. run spyder in terminal.

Expected behavior

the application runs properly.

Additional context

➜  ~ spyder 
Traceback (most recent call last):
  File "/nix/store/yxmyyvpimj4rilwk9s5vcjwpnc86bz3s-python3.10-spyder-5.4.0/bin/..spyder-wrapped-wrapped", line 6, in <module>
    from spyder.app.start import main
  File "/nix/store/yxmyyvpimj4rilwk9s5vcjwpnc86bz3s-python3.10-spyder-5.4.0/lib/python3.10/site-packages/spyder/app/start.py", line 42, in <module>
    import zmq
ModuleNotFoundError: No module named 'zmq'

Notify maintainers

@gebner

Metadata

~ nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 5.15.85, NixOS, 22.11 (Raccoon), 22.11.1198.913a47cd064`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.11.1`
 - channels(hervyqa): `""`
 - channels(root): `"nixos-22.11"`
 - nixpkgs: `/nix/var/nix/profiles/per-user/root/channels/nixos`
@bjornfor
Copy link
Contributor

bjornfor commented Jan 1, 2023

I wonder if something clears PYTHONPATH between the wrapper setting it up and spyder importing zmq. Because if you look at the spyder wrapper script, it does add pyzmq to the search path.

bjornfor added a commit to bjornfor/nixpkgs that referenced this issue Jan 2, 2023
Upstream clears out all sys.path entries that come from PYTHONPATH,
which completely breaks Nixpkgs packaging. Patch out that code to fix
running spyder.

Before:

  $ spyder
  Traceback (most recent call last):
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/bin/..spyder-wrapped-wrapped", line 6, in <module>
      from spyder.app.start import main
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/lib/python3.10/site-packages/spyder/app/start.py", line 42, in <module>
      import zmq
  ModuleNotFoundError: No module named 'zmq'
  (exit with error code 1)

After:

  $ spyder
  (succeeds startup)

Note that once the GUI is up, it complains (inside GUI) that we've got
wrong version of 2 deps and
"ModuleNotFoundError: No module named 'spyder_kernels'".

Fixes NixOS#208567
@bjornfor
Copy link
Contributor

bjornfor commented Jan 2, 2023

Fix here: #208734

If anyone has time/motivation to discuss this with upstream that'd be great.

@hervyqa
Copy link
Author

hervyqa commented Jan 4, 2023

sorry, duplicated issue. #205497

@hervyqa
Copy link
Author

hervyqa commented Jan 10, 2023

Screenshot_20230111_044615

i found double .desktop in /nix/store/1339apxlb2wnhghq6z1dkk1l57k7cxhi-python3.10-spyder-5.4.0/share/applications/, can you delete one of them?

remove this.

  desktopItem = makeDesktopItem {
    name = "Spyder";
    exec = "spyder";
    icon = "spyder";
    comment = "Scientific Python Development Environment";
    desktopName = "Spyder";
    genericName = "Python IDE";
    categories = [ "Development" "IDE" ];
  };

or

cp -r $desktopItem/share/applications/ $out/share

bjornfor added a commit that referenced this issue Jan 11, 2023
Upstream clears out all sys.path entries that come from PYTHONPATH,
which completely breaks Nixpkgs packaging. Patch out that code to fix
running spyder.

Before:

  $ spyder
  Traceback (most recent call last):
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/bin/..spyder-wrapped-wrapped", line 6, in <module>
      from spyder.app.start import main
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/lib/python3.10/site-packages/spyder/app/start.py", line 42, in <module>
      import zmq
  ModuleNotFoundError: No module named 'zmq'
  (exit with error code 1)

After:

  $ spyder
  (succeeds startup)

Note that once the GUI is up, it complains (inside GUI) that we've got
wrong version of 2 deps and
"ModuleNotFoundError: No module named 'spyder_kernels'".

Fixes #208567
@bjornfor
Copy link
Contributor

i found double .desktop in /nix/store/1339apxlb2wnhghq6z1dkk1l57k7cxhi-python3.10-spyder-5.4.0/share/applications/, can you delete one of them?

Thanks for reporting. See #210170.

github-actions bot pushed a commit that referenced this issue Jan 12, 2023
Upstream clears out all sys.path entries that come from PYTHONPATH,
which completely breaks Nixpkgs packaging. Patch out that code to fix
running spyder.

Before:

  $ spyder
  Traceback (most recent call last):
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/bin/..spyder-wrapped-wrapped", line 6, in <module>
      from spyder.app.start import main
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/lib/python3.10/site-packages/spyder/app/start.py", line 42, in <module>
      import zmq
  ModuleNotFoundError: No module named 'zmq'
  (exit with error code 1)

After:

  $ spyder
  (succeeds startup)

Note that once the GUI is up, it complains (inside GUI) that we've got
wrong version of 2 deps and
"ModuleNotFoundError: No module named 'spyder_kernels'".

Fixes #208567

(cherry picked from commit 82ed3c7)
bjornfor added a commit that referenced this issue Jan 13, 2023
Upstream clears out all sys.path entries that come from PYTHONPATH,
which completely breaks Nixpkgs packaging. Patch out that code to fix
running spyder.

Before:

  $ spyder
  Traceback (most recent call last):
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/bin/..spyder-wrapped-wrapped", line 6, in <module>
      from spyder.app.start import main
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/lib/python3.10/site-packages/spyder/app/start.py", line 42, in <module>
      import zmq
  ModuleNotFoundError: No module named 'zmq'
  (exit with error code 1)

After:

  $ spyder
  (succeeds startup)

Note that once the GUI is up, it complains (inside GUI) that we've got
wrong version of 2 deps and
"ModuleNotFoundError: No module named 'spyder_kernels'".

Fixes #208567

(cherry picked from commit 82ed3c7)
miker2049 pushed a commit to miker2049/nixpkgs that referenced this issue Jan 15, 2023
Upstream clears out all sys.path entries that come from PYTHONPATH,
which completely breaks Nixpkgs packaging. Patch out that code to fix
running spyder.

Before:

  $ spyder
  Traceback (most recent call last):
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/bin/..spyder-wrapped-wrapped", line 6, in <module>
      from spyder.app.start import main
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/lib/python3.10/site-packages/spyder/app/start.py", line 42, in <module>
      import zmq
  ModuleNotFoundError: No module named 'zmq'
  (exit with error code 1)

After:

  $ spyder
  (succeeds startup)

Note that once the GUI is up, it complains (inside GUI) that we've got
wrong version of 2 deps and
"ModuleNotFoundError: No module named 'spyder_kernels'".

Fixes NixOS#208567

(cherry picked from commit 82ed3c7)
adamcstephens pushed a commit to adamcstephens/nixpkgs that referenced this issue Jan 25, 2023
Upstream clears out all sys.path entries that come from PYTHONPATH,
which completely breaks Nixpkgs packaging. Patch out that code to fix
running spyder.

Before:

  $ spyder
  Traceback (most recent call last):
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/bin/..spyder-wrapped-wrapped", line 6, in <module>
      from spyder.app.start import main
    File "/nix/store/icbklw22yrzy7s8k2ai8chkhrvna8pxr-python3.10-spyder-5.4.0/lib/python3.10/site-packages/spyder/app/start.py", line 42, in <module>
      import zmq
  ModuleNotFoundError: No module named 'zmq'
  (exit with error code 1)

After:

  $ spyder
  (succeeds startup)

Note that once the GUI is up, it complains (inside GUI) that we've got
wrong version of 2 deps and
"ModuleNotFoundError: No module named 'spyder_kernels'".

Fixes NixOS#208567
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants