Spyder 4 launching from anaconda prompt but not from shortcut nor .exe
See original GitHub issueProblem Description
I have a just installed fresh version of spyder in a local anaconda env using:
conda create -n my_env python=3 spyder=4
Starting spyder from the prompt (after activate my_env) works fine and starts Spyder4.
However, when opening using the shortcut Spyder does not open. To figure out what was happening I manually ran:
C:\Users\MyUser\AppData\Local\conda\conda\envs\gmv\pythonw.exe C:\ProgramData\Anaconda3\cwp.py C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env "C:/Users/MyUser/AppData/Local/conda/conda/envs/my_env /pythonw.exe" "C:/Users/MyUser/AppData/Local/conda/conda/envs/my_env /Scripts/spyder-script.py"
which does not do anything. To recover an error message I thought of using python.exe instead of pythonw.exe. This gave:
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\cwp.py", line 9, in <module>
from menuinst.knownfolders import FOLDERID, get_folder_path, PathNotFoundException
ModuleNotFoundError: No module named 'menuinst'
So I installed “menuinst” using conda install menuinst. After re-running I got:
menuinst called from non-root env C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env
I do not know what to do at that point.
I also tried running from spyder.exe but get:
Traceback (most recent call last):
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\Scripts\spyder-script.py", line 6, in <module>
from spyder.app.start import main
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\lib\site-packages\spyder\app\start.py", line 22, in <module>
import zmq
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\lib\site-packages\zmq\__init__.py", line 47, in <module>
from zmq import backend
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\lib\site-packages\zmq\backend\__init__.py", line 40, in <module>
reraise(*exc_info)
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\lib\site-packages\zmq\utils\sixcerpt.py", line 34, in reraise
raise value
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\lib\site-packages\zmq\backend\__init__.py", line 27, in <module>
_ns = select_backend(first)
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\lib\site-packages\zmq\backend\select.py", line 28, in select_backend
mod = __import__(name, fromlist=public_api)
File "C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\lib\site-packages\zmq\backend\cython\__init__.py", line 6, in <module>
from . import (constants, error, message, context,
ImportError: DLL load failed while importing error: The specified module could not be found.
I tried “upgrading” zmq" but there is no such package.
Furthermore I tried running “spyder3.exe” but again got an error message saying:
Unable to create process using '“c:\ci\spyder_1589206422876_h_env\pythonw.exe” “C:\Users\MyUser\AppData\Local\conda\conda\envs\my_env\Scripts\spyder.exe” ': The system cannot find the file specified
I do not know what else to do to spot the bug but I think it is an issue with the latest Spyder 4 install?
What steps reproduce the problem?
- Create a new environment with python 3 and spyder 4
- Launch spyder using the .exe or by clicking the created shortcut lnk
- Spyder does not open
Versions
alabaster 0.7.12 py_0
argh 0.26.2 py38_0
astroid 2.4.2 py38_0
atomicwrites 1.4.0 py_0
attrs 19.3.0 py_0
autopep8 1.5.3 py_0
babel 2.8.0 py_0
backcall 0.2.0 py_0
bcrypt 3.1.7 py38he774522_1
bleach 3.1.5 py_0
brotlipy 0.7.0 py38he774522_1000
ca-certificates 2020.1.1 0
certifi 2020.6.20 py38_0
cffi 1.14.0 py38h7a1dbc1_0
chardet 3.0.4 py38_1003
cloudpickle 1.4.1 py_0
colorama 0.4.3 py_0
cryptography 2.9.2 py38h7a1dbc1_0
decorator 4.4.2 py_0
defusedxml 0.6.0 py_0
diff-match-patch 20181111 py_0
docutils 0.16 py38_1
entrypoints 0.3 py38_0
flake8 3.8.3 py_0
future 0.18.2 py38_1
icu 58.2 vc14hc45fdbb_0 [vc14]
idna 2.9 py_1
imagesize 1.2.0 py_0
importlib-metadata 1.6.1 py38_0
importlib_metadata 1.6.1 0
intervaltree 3.0.2 py_0
ipykernel 5.3.0 py38h5ca1d4c_0
ipython 7.15.0 py38_0
ipython_genutils 0.2.0 py38_0
isort 4.3.21 py38_0
jedi 0.15.2 py38_0
jinja2 2.11.2 py_0
jpeg 9b vc14h4d7706e_1 [vc14]
jsonschema 3.2.0 py38_0
jupyter_client 6.1.3 py_0
jupyter_core 4.6.3 py38_0
keyring 21.1.1 py38_2
lazy-object-proxy 1.4.3 py38he774522_0
libpng 1.6.37 h2a8f88b_0
libsodium 1.0.16 h9d3ae62_0
libspatialindex 1.9.3 h33f27b4_0
markupsafe 1.1.1 py38he774522_0
mccabe 0.6.1 py38_1
mistune 0.8.4 py38he774522_1000
nbconvert 5.6.1 py38_0
nbformat 5.0.7 py_0
numpydoc 1.0.0 py_0
openssl 1.1.1g he774522_0
packaging 20.4 py_0
pandoc 2.2.3.2 0
pandocfilters 1.4.2 py38_1
paramiko 2.7.1 py_0
parso 0.5.2 py_0
pathtools 0.1.2 py_1
pexpect 4.8.0 py38_0
pickleshare 0.7.5 py38_1000
pip 20.1.1 py38_1
pluggy 0.13.1 py38_0
prompt-toolkit 3.0.5 py_0
psutil 5.7.0 py38he774522_0
pycodestyle 2.6.0 py_0
pycparser 2.20 py_0
pydocstyle 5.0.2 py_0
pyflakes 2.2.0 py_0
pygments 2.6.1 py_0
pylint 2.5.3 py38_0
pynacl 1.3.0 py38h62dcd97_0
pyopenssl 19.1.0 py38_0
pyparsing 2.4.7 py_0
pyqt 5.9.2 py38ha925a31_4
pyrsistent 0.16.0 py38he774522_0
pysocks 1.7.1 py38_0
python 3.8.3 he1778fa_0
python-dateutil 2.8.1 py_0
python-jsonrpc-server 0.3.4 py_0
python-language-server 0.31.9 py38_0
pytz 2020.1 py_0
pywin32 227 py38he774522_1
pywin32-ctypes 0.2.0 py38_1000
pyyaml 5.3.1 py38he774522_0
pyzmq 18.1.1 py38ha925a31_0
qdarkstyle 2.8.1 py_0
qt 5.9.7 vc14h73c81de_0 [vc14]
qtawesome 0.7.2 py_0
qtconsole 4.7.5 py_0
qtpy 1.9.0 py_0
requests 2.24.0 py_0
rope 0.17.0 py_0
rtree 0.9.4 py38h21ff451_1
setuptools 47.3.1 py38_0
sip 4.19.22 py38ha925a31_0
six 1.15.0 py_0
snowballstemmer 2.0.0 py_0
sortedcontainers 2.2.2 py_0
sphinx 3.1.1 py_0
sphinxcontrib-applehelp 1.0.2 py_0
sphinxcontrib-devhelp 1.0.2 py_0
sphinxcontrib-htmlhelp 1.0.3 py_0
sphinxcontrib-jsmath 1.0.1 py_0
sphinxcontrib-qthelp 1.0.3 py_0
sphinxcontrib-serializinghtml 1.1.4 py_0
spyder 4.1.3 py38_0
spyder-kernels 1.9.1 py38_0
sqlite 3.32.3 h2a8f88b_0
testpath 0.4.4 py_0
toml 0.10.0 pyh91ea838_0
tornado 6.0.4 py38he774522_1
traitlets 4.3.3 py38_0
ujson 1.35 py38he774522_0
urllib3 1.25.9 py_0
vc 14.1 h21ff451_4
vs2015_runtime 14.16.27012 hf0eaf9b_2
watchdog 0.10.2 py38_0
wcwidth 0.2.4 py_0
webencodings 0.5.1 py38_1
wheel 0.34.2 py38_0
win_inet_pton 1.1.0 py38_0
wincertstore 0.2 py38_0
wrapt 1.11.2 py38he774522_0
yaml 0.1.7 vc14hb31d195_1 [vc14]
yapf 0.29.0 py_0
zeromq 4.3.1 h33f27b4_3
zipp 3.1.0 py_0
zlib 1.2.11 vc14h1cdd9ab_1 [vc14]
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (6 by maintainers)

Top Related StackOverflow Question
Hey, thanks for your detailed followup, and for your patience. It has essentially ruled out the great majority of potential issues with your environment; aside from something esoteric, the remaining likely possibilities are some unpredictable failure when installing Anaconda, or security software on your machine interfering with the install, shortcut or startup process. Does the same behavior occur when Spyder is launched via the shortcut from the default
baseenvironment, or just the shortcut for the copy of Spyder installed inmy_env? What is the output whenmenuinstruns after installing or updating Spyder?In any case, until our standalone installers are out soon, my best advice would again be to do a clean uninstall and reinstall of Anaconda, and if problems persist, report it to them. It is conda and menuinst that installs the shortcut, not our code, so we have very limited control over that process. Do other shortcuts work (like Jupyter) in the same env? Our standalone installers should not experience the same issue, and if they do we’ll be able to swiftly fix it for you (unless it has to do with interference by some security software that we don’t have control over).
As for the issue of admin rights, Anaconda by default is installed “Just for me” (i.e. per-user, without admin), and that’s typically how most of our users (including myself) have successfully used it across a variety of both personal and institutional machines. In the past, there have occasionally been problems reported related to this, but they usually have to do with Anaconda installed as admin, and then being used from a different, non-admin user account. Back when that was more frequently reported, I actually spend several days and a number of attempts to reproduce those errors myself on a clean Win 10 test box but was never able to, and I don’t think we’ve seen this problems reported lately, so I’m not sure that’s what’s going on here.
What I think may be more likely is some sort of security software interfering, and that’s unfortunately not anything we have direct control over from the Spyder side; it most has a very high degree of machine to machine variation that we cannot account for, and usually operates at a much higher privilege level than us such that the only real solution is to ensure your IT folks perform the appropriate whitelisting such that your software functions as you need it to.
That was actually what I was about to suggest, if all else failed, since given your technical skill level I figured it would be a pretty easy task for you even without my help.
Its possible that a later version of conda/menuinst/etc fixes this, if you can get it updated; I know there have been some improvements on this in the past couple years. Not sure how old your environment is.
Me neither, I was just curious if menuinst was acting up with other application in the env, or just Spyder. But it seems like the former.
It was at the one I worked at, fortunately. Otherwise, there are two ways to fix this long-term. You could install Anaconda (or the much lighter weight Miniconda) “Just for me” rather than using the system install (which you can do without admin and alongside your existing system Anaconda install, so long as your system doesn’t have restrictive security policies. In fact, you can install Spyder in your per-user install and use it with your existing environments in your system install, just as easily as using it between environments in the same install. Alternatively, you can wait for our own installers, which install Spyder as a standalone application and can be done either per-user or system-wide (admin), and will again work with your existing Anaconda envs.
In any case, thanks for your help on this, best of luck and happy Spydering!