Repository: spyder-ide/spyder

Issue:
Error when trying to update from a conda installation
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

clicking "yes" when it says there is a new version and if I want to install the new SPyder version

### Traceback
```python-traceback
Traceback (most recent call last):
  File "C:\ProgramData\miniconda3\Lib\site-packages\spyder\plugins\application\container.py", line 330, in _check_updates_ready
    self.application_update_status.start_installation(
    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'start_installation'
```

## Versions

* Spyder version: 5.5.0  (conda)
* Python version: 3.11.6 64-bit
* Qt version: 5.15.2
* PyQt5 version: 5.15.10
* Operating System: Windows-10-10.0.22631-SP0

### Dependencies

```
# Mandatory:
atomicwrites >=1.2.0             :  1.4.1 (OK)
chardet >=2.0.0                  :  5.2.0 (OK)
cloudpickle >=0.5.0              :  3.0.0 (OK)
cookiecutter >=1.6.0             :  2.5.0 (OK)
diff_match_patch >=20181111      :  20230430 (OK)
intervaltree >=3.0.2             :  3.1.0 (OK)
IPython >=8.13.0,<9.0.0,!=8.17.1 :  8.18.1 (OK)
jedi >=0.17.2,<0.20.0            :  0.19.1 (OK)
jellyfish >=0.7                  :  1.0.3 (OK)
jsonschema >=3.2.0               :  4.20.0 (OK)
keyring >=17.0.0                 :  24.3.0 (OK)
nbconvert >=4.0                  :  7.12.0 (OK)
numpydoc >=0.6.0                 :  1.6.0 (OK)
paramiko >=2.4.0                 :  3.3.1 (OK)
parso >=0.7.0,<0.9.0             :  0.8.3 (OK)
pexpect >=4.4.0                  :  4.9.0 (OK)
pickleshare >=0.4                :  0.7.5 (OK)
psutil >=5.3                     :  5.9.6 (OK)
pygments >=2.0                   :  2.17.2 (OK)
pylint >=2.5.0,<3.1              :  3.0.3 (OK)
pylint_venv >=3.0.2              :  3.0.3 (OK)
pyls_spyder >=0.4.0              :  0.4.0 (OK)
pylsp >=1.9.0,<1.10.0            :  1.9.0 (OK)
pylsp_black >=1.2.0,<3.0.0       :  1.3.0 (OK)
qdarkstyle >=3.2.0,<3.3.0        :  3.2.3 (OK)
qstylizer >=0.2.2                :  0.2.2 (OK)
qtawesome >=1.2.1                :  1.3.0 (OK)
qtconsole >=5.5.0,<5.6.0         :  5.5.1 (OK)
qtpy >=2.1.0                     :  2.4.1 (OK)
rtree >=0.9.7                    :  1.1.0 (OK)
setuptools >=49.6.0              :  69.0.2 (OK)
sphinx >=0.6.6                   :  7.2.6 (OK)
spyder_kernels >=2.5.0,<2.6.0    :  2.5.0 (OK)
textdistance >=4.2.0             :  4.6.0 (OK)
three_merge >=0.1.1              :  0.1.1 (OK)
watchdog >=0.10.3                :  3.0.0 (OK)
zmq >=22.1.0                     :  25.1.2 (OK)

# Optional:
cython >=0.21                    :  3.0.6 (OK)
matplotlib >=3.0.0               :  None (NOK)
numpy >=1.7                      :  1.26.2 (OK)
pandas >=1.1.1                   :  2.1.4 (OK)
scipy >=0.17.0                   :  None (NOK)
sympy >=0.7.3                    :  1.12 (OK)
```



Discussion:
Hey @alexandrewillame, thanks for reporting. We'll take a look at this problem for our next version (5.5.2), to be released shortly.

In the meantime, please ignore this error.

Resolving patch:
diff --git a/installers/macOS/setup.py b/installers/macOS/setup.py
--- a/installers/macOS/setup.py
+++ b/installers/macOS/setup.py
@@ -15,8 +15,8 @@
 import shutil
 from logging import getLogger, StreamHandler, Formatter
 from pathlib import Path
+import platform
 from setuptools import setup
-from platform import machine
 
 from spyder import get_versions
 
@@ -103,7 +103,8 @@ def disk_image_name(make_lite=False):
     """
     Return disk image name
     """
-    dmg_name = f'Spyder-{SPYVER}_{machine()}'
+    mach = "_arm64" if "ARM64" in platform.version() else ""
+    dmg_name = f'Spyder{mach}'
     if make_lite:
         dmg_name += '-Lite'
     dmg_name += '.dmg'
diff --git a/spyder/plugins/application/container.py b/spyder/plugins/application/container.py
--- a/spyder/plugins/application/container.py
+++ b/spyder/plugins/application/container.py
@@ -106,15 +106,21 @@ def setup(self):
 
         # Attributes
         self.dialog_manager = DialogManager()
-        self.application_update_status = None
-        if is_pynsist() or running_in_mac_app():
-            self.application_update_status = ApplicationUpdateStatus(
-                parent=self)
-            (self.application_update_status.sig_check_for_updates_requested
-             .connect(self.check_updates))
-            (self.application_update_status.sig_install_on_close_requested
-                 .connect(self.set_installer_path))
-            self.application_update_status.set_no_status()
+
+        self.application_update_status = ApplicationUpdateStatus(
+            parent=self
+        )
+
+        # Users can only use this widget in our apps.
+        if not is_pynsist() and not running_in_mac_app():
+            self.application_update_status.hide()
+
+        (self.application_update_status.sig_check_for_updates_requested
+         .connect(self.check_updates))
+        (self.application_update_status.sig_install_on_close_requested
+             .connect(self.set_installer_path))
+        self.application_update_status.set_no_status()
+
         self.give_updates_feedback = False
         self.thread_updates = None
         self.worker_updates = None
diff --git a/spyder/workers/updates.py b/spyder/workers/updates.py
--- a/spyder/workers/updates.py
+++ b/spyder/workers/updates.py
@@ -8,10 +8,12 @@
 import logging
 import os
 import os.path as osp
+import platform
 import tempfile
 import traceback
 
 # Third party imports
+from packaging.version import parse
 from qtpy.QtCore import QObject, Signal
 import requests
 from requests.exceptions import ConnectionError, HTTPError, SSLError
@@ -225,16 +227,38 @@ def _progress_reporter(self, block_number, read_size, total_size):
     def _download_installer(self):
         """Donwload latest Spyder standalone installer executable."""
         tmpdir = tempfile.gettempdir()
-        is_full_installer = (is_module_installed('numpy') or
-                             is_module_installed('pandas'))
-        if os.name == 'nt':
-            name = 'Spyder_64bit_{}.exe'.format('full' if is_full_installer
-                                                else 'lite')
+
+        # If running on macOS under Rosetta, platform.machine will not be
+        # correct so check for ARM64 in version instead. All other
+        # platforms will be x86_64.
+        mach = "arm64" if "ARM64" in platform.version() else "x86_64"
+
+        if parse(self.latest_release_version) > parse("5"):
+            # conda-based installer name
+            if os.name == 'nt':
+                plat, ext = 'Windows', 'exe'
+            elif platform.system == 'Darwin':
+                plat, ext = 'macOS', 'pkg'
+            else:
+                plat, ext = 'Linux', 'sh'
+            name = f'Spyder-{plat}-{mach}.{ext}'
         else:
-            name = 'Spyder{}.dmg'.format('' if is_full_installer else '-Lite')
+            # 5.x installer name
+            is_full_installer = (is_module_installed('numpy') or
+                                 is_module_installed('pandas'))
+            if os.name == 'nt':
+                name = 'Spyder_64bit_{}.exe'.format(
+                    'full' if is_full_installer else 'lite'
+                )
+            else:
+                name = 'Spyder{}{}.dmg'.format(
+                    f'_{mach}' if mach == 'arm64' else '',
+                    '' if is_full_installer else '-Lite'
+                )
+
+        url = ('https://github.com/spyder-ide/spyder/releases/download/'
+               f'v{self.latest_release_version}/{name}')
 
-        url = ('https://github.com/spyder-ide/spyder/releases/latest/'
-               f'download/{name}')
         dir_path = osp.join(tmpdir, 'spyder', 'updates')
         os.makedirs(dir_path, exist_ok=True)
         installer_dir_path = osp.join(


Test patch: