spyder
spyder copied to clipboard
Error when starting kernel: "The following argument was not expected: /path/to/environment/"
Issue Report Checklist
- [x] Searched the issues page for similar reports
- [x] Read the relevant sections of the Spyder Troubleshooting Guide and followed its advice
- [x] Reproduced the issue after updating with
conda update spyder
(orpip
, if not using Anaconda) - [x] Could not reproduce inside
jupyter qtconsole
(if console-related) -- could not reproduce in IPython: running jupyter qtconsole gave an error (see below) - [x] Tried basic troubleshooting (if a bug/error)
- [x] Restarted Spyder
- [x] Reset preferences with
spyder --reset
- [x] Reinstalled the latest version of Anaconda -- Did reinstall, but using Miniconda, not Anaconda
- [x] Tried the other applicable steps from the Troubleshooting Guide
- [x] Completed the Problem Description, Steps to Reproduce and Version sections below
Error from jupyter qtconsole
:
(spyder-env) C:\WINDOWS\system32>jupyter qtconsole
usage: jupyter [-h] [--version] [--config-dir] [--data-dir] [--runtime-dir] [--paths] [--json] [--debug] [subcommand]
Jupyter: Interactive Computing
positional arguments:
subcommand the subcommand to launch
optional arguments:
-h, --help show this help message and exit
--version show the versions of core jupyter packages and exit
--config-dir show Jupyter config dir
--data-dir show Jupyter data dir
--runtime-dir show Jupyter runtime dir
--paths show all Jupyter paths. Add --json for machine-readable format.
--json output paths as machine-readable json
--debug output debug information about paths
Available subcommands: kernel kernelspec migrate run script troubleshoot
Jupyter command `jupyter-qtconsole` not found.
(spyder-env) C:\WINDOWS\system32>
Problem Description
What steps reproduce the problem?
- Install new version of Spyder (5.3.3)
- Agree to uninstall previous version
- Start Spyder
What is the expected output? What do you see instead?
Expected: Start Spyder with an active prompt in the IPython console
Instead:
- "An error ocurred while starting the kernel"
- "The following argument was not expected: C:/ProgramData/Miniconda3/envs/spyder‑env"
- Followed by other errors
Paste Traceback/Error Below (if applicable)
The following argument was not expected: C:/ProgramData/Miniconda3/envs/spyder-env
Run with --help for more information.
Versions
- Spyder version: 5.3.3
- Python version: 3.9.13
- Qt version: Unknown
- PyQt version: Unknown
- Operating System name/version: Windows 11 Enterprise version 21H2
Dependencies
# Mandatory:
atomicwrites >=1.2.0 : 1.4.1 (OK)
chardet >=2.0.0 : 5.0.0 (OK)
cloudpickle >=0.5.0 : 2.1.0 (OK)
cookiecutter >=1.6.0 : 2.1.1 (OK)
diff_match_patch >=20181111 : 20200713 (OK)
intervaltree : None (OK)
IPython >=7.31.1;<8.0.0 : 7.34.0 (OK)
jedi >=0.17.2;<0.19.0 : 0.18.1 (OK)
jellyfish >=0.7 : 0.9.0 (OK)
jsonschema >=3.2.0 : 4.14.0 (OK)
keyring >=17.0.0 : 23.8.2 (OK)
nbconvert >=4.0 : 7.0.0 (OK)
numpydoc >=0.6.0 : 1.4.0 (OK)
paramiko >=2.4.0 : 2.11.0 (OK)
parso >=0.7.0;<0.9.0 : 0.8.3 (OK)
pexpect >=4.4.0 : 4.8.0 (OK)
pickleshare >=0.4 : 0.7.5 (OK)
psutil >=5.3 : 5.9.1 (OK)
pygments >=2.0 : 2.13.0 (OK)
pylint >=2.5.0;<3.0 : 2.15.0 (OK)
pyls_spyder >=0.4.0 : 0.4.0 (OK)
pylsp >=1.5.0;<1.6.0 : 1.5.0 (OK)
pylsp_black >=1.2.0 : 1.2.1 (OK)
qdarkstyle >=3.0.2;<3.1.0 : 3.0.3 (OK)
qstylizer >=0.1.10 : 0.2.1 (OK)
qtawesome >=1.0.2 : 1.1.1 (OK)
qtconsole >=5.3.2;<5.4.0 : 5.3.2 (OK)
qtpy >=2.1.0 : 2.2.0 (OK)
rtree >=0.9.7 : 1.0.0 (OK)
setuptools >=49.6.0 : 65.3.0 (OK)
sphinx >=0.6.6 : 5.1.1 (OK)
spyder_kernels >=2.3.3;<2.4.0 : 2.3.3 (OK)
textdistance >=4.2.0 : 4.4.0 (OK)
three_merge >=0.1.1 : 0.1.1 (OK)
watchdog : 2.1.9 (OK)
zmq >=22.1.0 : 23.2.1 (OK)
# Optional:
cython >=0.21 : 0.29.32 (OK)
matplotlib >=3.0.0 : 3.5.3 (OK)
numpy >=1.7 : 1.22.4 (OK)
pandas >=1.1.1 : 1.4.3 (OK)
scipy >=0.17.0 : 1.9.1 (OK)
sympy >=0.7.3 : 1.11 (OK)
# Spyder plugins:
spyder_terminal.terminalplugin 1.2.2 : 1.2.2 (OK)
Hey @erickb, thanks for reporting. It seems you installed Spyder using our Windows installer and then you installed Miniconda to use additional Python packages.
Is that correct?
Hi, Carlos,
Thanks for getting back to me. I already had a Miniconda3/Spyder installation. I was prompted to download the most recent version of Spyder, so I did that and installed it.
When I started, I got a large number of errors, but I updated conda, added conda-forge and got the spyder-kernel packages, and updated all of my modules. That took care of nearly everything, but I still go the error message that I reported.
So, I:
- Reset my Spyder settings
- Pointed Spyder back to Minconda3, and my environment (envs/spyder-env/)
- Restarted and still go the error
- Deleted my conda installation and reinstalled it, created a new spyder-env, and installed spyder-kernel packages and spyder
- Restarted and still go the error
- Completely reinstalled Spyder and still got the error
I hope that makes sense.
Eric
[https://www.sei.org/signature/SEI.png]https://www.sei.org/?utm_source=email-signature
[https://www.sei.org/signature/twitter.png]https://twitter.com/SEIresearch[https://www.sei.org/signature/facebook.png]http://www.facebook.com/StockholmEnvironmentInstitute[https://www.sei.org/signature/linkedin.png]http://www.linkedin.com/company/stockholm-environment-institute Eric Kemp-Benedict Equitable Transitions Program Director @.*** +1 (617) 590-5436 Stockholm Environment Institute 11 Curtis Avenue, Somerville, MA 02144-1224, USA
Pronouns: he, him, his From: Carlos Cordoba @.> Sent: Sunday, September 4, 2022 2:47 PM To: spyder-ide/spyder @.> Cc: Eric Kemp-Benedict @.>; Mention @.> Subject: Re: [spyder-ide/spyder] Error when starting kernel: "The following argument was not expected: /path/to/environment/" (Issue #19298)
Hey @erickbhttps://github.com/erickb, thanks for reporting. It seems you installed Spyder using our Windows installer and then you installed Miniconda to use additional Python packages.
Is that correct?
— Reply to this email directly, view it on GitHubhttps://github.com/spyder-ide/spyder/issues/19298#issuecomment-1236395005, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AAFYPIFWWEJM4ZVBYZ3T63DV4TVDPANCNFSM6AAAAAAQEBG7ZU. You are receiving this because you were mentioned.Message ID: @.@.>>
Hi, @ccordoba12 An error occurred while starting the IPython kernel I have the same problem when use a custom Python interpreter. With the default Python interpreter, no problem I installed spyder using windows installer
Versions
- Spyder version: 5.3.3 (standalone)
- Python version: 3.8.10 64-bit
- Qt version: 5.15.2
- PyQt5 version: 5.15.7
- Operating System: Windows 10
Dependencies
Mandatory:
atomicwrites >=1.2.0 : 1.4.1 (OK) chardet >=2.0.0 : 5.0.0 (OK) cloudpickle >=0.5.0 : 2.1.0 (OK) cookiecutter >=1.6.0 : 2.1.1 (OK) diff_match_patch >=20181111 : 20200713 (OK) intervaltree : None (OK) IPython >=7.31.1;<8.0.0 : 7.34.0 (OK) jedi >=0.17.2;<0.19.0 : 0.18.1 (OK) jellyfish >=0.7 : 0.9.0 (OK) jsonschema >=3.2.0 : 4.14.0 (OK) keyring >=17.0.0 : 23.8.2 (OK) nbconvert >=4.0 : 7.0.0 (OK) numpydoc >=0.6.0 : 1.4.0 (OK) paramiko >=2.4.0 : 2.11.0 (OK) parso >=0.7.0;<0.9.0 : 0.8.3 (OK) pexpect >=4.4.0 : 4.8.0 (OK) pickleshare >=0.4 : 0.7.5 (OK) psutil >=5.3 : 5.9.1 (OK) pygments >=2.0 : 2.13.0 (OK) pylint >=2.5.0;<3.0 : 2.15.0 (OK) pyls_spyder >=0.4.0 : 0.4.0 (OK) pylsp >=1.5.0;<1.6.0 : 1.5.0 (OK) pylsp_black >=1.2.0 : 1.2.1 (OK) qdarkstyle >=3.0.2;<3.1.0 : 3.0.3 (OK) qstylizer >=0.1.10 : 0.2.1 (OK) qtawesome >=1.0.2 : 1.1.1 (OK) qtconsole >=5.3.2;<5.4.0 : 5.3.2 (OK) qtpy >=2.1.0 : 2.2.0 (OK) rtree >=0.9.7 : 1.0.0 (OK) setuptools >=49.6.0 : 65.3.0 (OK) sphinx >=0.6.6 : 5.1.1 (OK) spyder_kernels >=2.3.3;<2.4.0 : 2.3.3 (OK) textdistance >=4.2.0 : 4.4.0 (OK) three_merge >=0.1.1 : 0.1.1 (OK) watchdog : 2.1.9 (OK) zmq >=22.1.0 : 23.2.1 (OK)
Optional:
cython >=0.21 : 0.29.32 (OK) matplotlib >=3.0.0 : 3.5.3 (OK) numpy >=1.7 : 1.22.4 (OK) pandas >=1.1.1 : 1.4.3 (OK) scipy >=0.17.0 : 1.9.1 (OK) sympy >=0.7.3 : 1.11 (OK)
Spyder plugins:
spyder_terminal.terminalplugin 1.2.2 : 1.2.2 (OK)
Just in case, this could be related with the behavior I was able to reproduce at https://github.com/spyder-ide/spyder/issues/16562#issuecomment-1202968973 (related with the installation using the For all users installation
vs Just for the current user installation
)
@dalthviz, yeah, it looks like the same error. Should we catch this message as a benign error?
I think it could be worty to understand why this happens, also I'm not sure if by just letting the error pass enables to fully use the console or if the console env is actually not activated correctly
Ok, no problem. Then, should we close this one in favor of #16562?
Actually re-reading #16562 seems like the original issue there is different to the error The following argument was not expected: /path/to/environment/
. I think the issues are related but not completly the same. So actually maybe is worthy to keep both :+1:
This error also appears when launching Spyder after a "install for just me" installation (although path has been modified).
Also, in Spyder, running a new kernel usually allows me to use the console. However, the warning still persists afterwards.
First initialization:
After starting new kernel:
Hopefully this provides a clue to the issue.
@dalthviz, according to @woudreus's comment above and @Pigankle's one in https://github.com/spyder-ide/spyder/issues/19731#issuecomment-1276576712, I think this is a benign error, so we should catch and dismiss it.
My guess is that the error doesn't show up the second time a console is started because we've cached the kernel parameters in the previous run, so the kernel starts really fast and that doesn't give time to block the console.
@ccordoba12 to be clear, the first time the error appears (on startup), the kernel will not work. If if I restart the kernel by closing the tab, then the error reappears but it works anyways.
Yep, that's what I understood from your comment and it's very similar to what @woudreus said above. That's why I think this is a benign error, i.e. a spurious one that we can simply skip.