Why CMD is running while Spyder is open within Anaconda? - python

I have recently updated Anaconda and Spyder.
However, once I opened Spyder within Anaconda, I got an issue with Spyder.
Command Prompt (cmd) is running while I open Spyder (picture is attached).
The problem is that when I close the cmd window Spyder is crashing.
Can someone help me with fixing this issue?
Thanks
P.S. I have to note that no similar issue is noticed when Spyder is running not within Anaconda

Detach the Spyder process from the console. On windows, this can be accomplished with the command start.
start \path_to_python\Scripts\spyder.exe

Reset the configuration:
File > Preferences > Configure navegator / Configure conda > Reset to defaults
If you have "Kite" installed, try to remove it. And Reset again

Related

Different Environment of Anaconda Prompt and Jupyter Notebook

I have always been executing my python script through a drag and drop approach to the anaconda prompt as the script is executed in the anaconda environment. I have this script in which it should be executed on another pc through a drag and drop approach in that pc's anaconda prompt. Turns out a certain library wasn't able to be imported. I tried running the script on jupyter notebook in that PC and it works. This would be the first time that I feel that anaconda prompt and jupyter notebook aren't running in the same environment.
Any help would greatly be appreciated, thanks!!
Every time you start you anaconda prompt, if you don't change your enviornment, it will be default in 'base' environment.
And I don't know where your run your jupyternotebook, but you may double check which anaconda environment it is running with.
PS: Since i am still not able to comment. I will write the reply here, hope it helps you a bit.

Completion and linting in the editor for Python files will not work during current session, or stopped working

I don't know how to repair the error. Every time I open Spyder the warnings shows up and restarting the aplication doesn't solve the problem.
If you can help me I would appreciate it.
Spyder Completion Warning
Disabling the firewall and antivirus didn't work for me. I was able to fix this issue by resetting Spyder. In the Anaconda prompt, enter:
spyder --reset
As the dialog says you need to check your firewall or antivirus since probably one of them is stopping/preventing the launching of the process that Spyder uses to provide completions and linting. To check if either your firewall or antivirus is causing the problem you could try to deactivate/disable them temporarly and try to launch Spyder again. If that helps then you need to create rules to allow Python processes.
Another option, if you are ok without having those services (completion and linting), is to ignore this message and select the Don't show again checkbox to prevent seen it again.
For more details regarding completion and linting services that Spyder provides you can check the documentation here:
For Spyder 4: https://docs.spyder-ide.org/4/faq.html#troubleshooting-completion
For SPyder 5: https://docs.spyder-ide.org/5/faq.html#troubleshooting-completion
In my case the error was caused by incompatible versions and fixed by (here for Python 3.10)
python3.10 -m pip install -U python-language-server

Spyder(Anaconda) does not start after forced shut down

I stupidly tried to read a massive .bin file in Python, which resulted in the laptop freezing, so I had to force shut down the laptop entirely.
After that, Spyder does not start - I get a 'Spyder crashed during last session' message. I tried reinstalling Anaconda, I tried updating Spyder, I tried resetting Spyder, I tried restarting the laptop. Absolutely nothing works. Qt Console and Powershell open successfully.
Any ideas what else I can try?
For anyone who might encounter this, I solved the problem by following the advice from here:
https://github.com/spyder-ide/spyder/issues/3868
More specifically, I deinstalled Anaconda, cleared the Roaming/.anaconda directory, re-installed Anaconda again, and updated Spyder again using conda update Spyder in the Anaconda Prompt.

How to specify python3 kernel in jupyter in pyCharm?

Here is my setting
and this is my script
I am trying to use jupyter notebook in pyCharm, but it kept using python2 instead of python3.
Any idea about this problem?
Add:
this pic is running jupyter notebook in chrome.
My problem was that I had multiple kernels, and PyCharm launches the default kernel. One approach might be to configure PyCharm to specify the kernel of choice to start up, I didn't investigate how to do that. I simply changed the default kernel in Jupyter and this worked for me (I have a virtualenv for tensorflow). c.MultiKernelManager.default_kernel_name = 'tensorflow'.
The preferences image you show is indeed how you would setup your interpreter for PyCharm, but that's not what the output/logging of PyCharm looks like. I'm guessing that's a jupyter-notebook display, which means you are running into the issue in jupyter-notebook and not PyCharm. So you need to change your setup for jupyter. Based on some quick searching pip install jupyter will install a python 2.7 version of jupyter. Sounds like what you want is
pip3 install jupyter
which will install the python3 version for you. You will likely have to uninstall your current version of jupyter.
When you kick off Jupyter-notebook from within PyCharm there is a configuration which is created. If the configuration is initially 2.7 ( I think it defaults to the current interpreter), and then keep using that same configuration, it wouldn't matter the state of the current project interpreter because it would be using the value saved in the run configuration.
You can modify your run configuration by
Run | Run...
Edit Configurations...
Select your Jupyter Notebook run configuration on the left (here is untitled4)
Make sure the python interpreter is correct here on the right
I was able to start a jupyter notebook like this and get it to output python 3 by doing this. Hope this is what you are needing.

Can't open pip in Python version 3.5

Using Python version 3.5 on Windows 10 64bit,
I'm unable to run the pip command. When I try running the application, the window will just open for a brief second and then closes.
I already tried adding the directory to the PATH environment variable and rebooting the system - didn't work.
when i try running the application the window will just open for brief second and then closes
Sounds like you are trying to open the pip.exe file and expect an interactive interface of some kind.
Unfortunately, that's not how you use pip. Open up a cmd, type your pip commands there. The command prompt will print and error, and not close, if there is a problem.

Categories

Resources