Closed DiegoF90 closed 4 years ago
@CAM-Gerlach can you take a look at this?
Hey, not sure what's going on; running Spyder on Windows myself I haven't run into this specific issue. Just to confirm, have you ever used pip
to install Python packages on this machine? Just in case, you'll want to complete Part 1, Step 3 of our tutorial video on troubleshooting issues with Spyder, Pip and Conda. You can also try running the following commands in your Anaconda Prompt in the base
environment to ensure everythiing is up to date:
conda update conda
conda update anaconda
Then, if it still doesn't work, force-reinstall menuinst in base:
conda install --force menuinst
and then force reinstall spyder in your environment:
conda activate my_env
conda install --force spyder
If that doesn't work; I'm not sure what is going on...sometimes installing the shortcut fails randomly on the Anaconda side. Its possible this may be due to a permissions issue, e.g. installing Anaconda for all users and running as a non-admin, for example, or something else machine-specific. If that's the case, all I can recommend is doing a clean uninstall and reinstalling Anaconda, preferably with a different install type than before,
The other suggestions in our Spyder Troubleshooting Guide, specifically the Basic First Aid and Emergency CPR sections, may also be of help, if you haven't already tried them.
Let us know how it goes, and best of luck!
Hi @CAM-Gerlach, No I have not used pip. This is a new fresh installation. I have also forced install spyder and menuinst with no change. Is there anything else I should try? Any additional information I can provide you so that you can replicate?
Hey, really sorry for the trouble. Once I fixed the formatting of your environment list (which I should have done before, sorry), I noticed that like prompt_toolkit
in your previous issue #13228 , importlib-metadata
is included twice (once with dash and once with underscore, and with the same version but different build codes), though I'm not sure if that is actually an issue given one of my Spyder envs on Windows also has two copies of the same but I'm unable to reproduce the issue.
Is there anything else I should try?
There are some more things you could try from our Troubleshooting Guide, given the information we have. Specifically, I suggest step 7 under Basic First Aid, clean-uninstalling and reinstalling Anaconda, and then if problems persist, completing steps 4-8 under Emergency CPR.
As I describe under step 3 of Emergency CPR, typically one method of launching Spyder working (e.g. command line) but not another (shortcut) is almost certainly indicative of a problem with your Anaconda install, not anything that Spyder has any control over. To resolve the issues uses have been experiencing with Anaconda lately, we are in the final stages of building standalone installers for Spyder that will avoid almost all of these issues and make it easier to install, launch and update Spyder on all the platforms we support, as well as for us to fix problems when they do occur.
With the information I have available, assuming you have just completed a clean reinstall of Anaconda itself, I either suspect something went wrong with your Anaconda install somehow, some sort of security software is interfering with either the install or the launch. Otherwise, if you are using the same install as in #13228 (which was well over 3 years out of date), I would suspect either a pip, conda-forge or botched default package installation upgrade somewhere, or simply the age of the environment and/or the huge stretch upgrading exposed an issue.
Any additional information I can provide you so that you can replicate?
You've provided a lot of useful information already, though as the problem is apparently outside our direct control and something specific to your environment, it doesn't look like we can actually repro it. Could you let us know your Windows version, if your Anaconda install was the same one from #13228 , describe how you have your conda environments set up and any other troubleshooting steps you tried? Also, have you ever had any Python installs on this machine, check if there is anything in the %appdata%/Python
directory (if it exists), check your PATH
for any other Python entries and provide us the output of your PYTHONPATH
environment variable (if it exists)? Thanks!
Hi @CAM-Gerlach,
Thanks for your help. No this is not the same install as that of #13228 this is a new fresh install in a different PC. The env was set up simply by running the code posted above:
conda create -n my_env python=3 spyder=4
I am using Windows 10, I also tried all the above steps you suggest. There is another python install (3.6) which is the one the base Anaconda installation comes with. There are no other Python entries in my PATH and my PYTHONPATH only contains references to the internal library (which does not contain any python or spyder versions).
I believe, as you suggest, that it is some security software as I am not using admin rights. This is sadly not an option here as those systems are used inside an organization. I actually believe that this is the case for many of the users, more so with the current trend of python becoming a must have language at several banks and startups. It would be great if you manage to replicate this by building the installation by not using admin rights? also, it would be very helpful if when building future releases of Spyder there is a small portion dedicated to making sure it works for non admin users.
Feel free to close the issue if you like :)
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 base
environment, or just the shortcut for the copy of Spyder installed in my_env
? What is the output when menuinst
runs 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.
Hey @DiegoF90 , did you manage to resolve your problem? Just checking in, thanks!
Hi @CAM-Gerlach, many thanks for your support and not giving up on the issue. I actually did not manage to make it work but just decided to build my own shortcut as a workaround. For completeness to address your questions above:
Traceback (most recent call last):
File "C:\Users\1520797\AppData\Local\conda\conda\envs\gmv\Scripts\jupyter-script.py", line 10, in <module>
sys.exit(main())
File "C:\Users\1520797\AppData\Local\conda\conda\envs\gmv\lib\site-packages\jupyter_core\command.py", line 247, in main
command = _jupyter_abspath(subcommand)
File "C:\Users\1520797\AppData\Local\conda\conda\envs\gmv\lib\site-packages\jupyter_core\command.py", line 133, in _jupyter_abspath
raise Exception(
Exception: Jupyter command `jupyter-notebook` not found.
But, I would trust myself on knowing what this means or how to properly run it.
My case is def the one you mentioned, i.e. Anaconda installed in admin and individual user using it. Also, digging a bit more I found that I was also having this issue when installing Spyder using my anaconda version, which might be related. I believe the issue was fixed in a later version of menuinst, but I cannot update the menuinst in my root (to make an installation of spyder using an updated version).
Hopefully it will come the time Spyder is whitelisted by default in most companies. Looking forward to the standalone installers. Cheers!
just decided to build my own shortcut as a workaround.
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.
The output of menuinst after installing and updating is the same as above
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.
I am afraid I have never used Jupyter,
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.
Hopefully it will come the time Spyder is whitelisted by default in most companies. Looking forward to the standalone installers. Cheers!
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!
Problem 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:
So I installed "menuinst" using
conda install menuinst
. After re-running I got:I do not know what to do at that point.
I also tried running from spyder.exe but get:
I tried "upgrading" zmq" but there is no such package.
Furthermore I tried running "spyder3.exe" but again got an error message saying:
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?
Versions