Unable to start Spyder after conda update/install packages? - python

I was playing around with Spyder today, and ran ONLY the following in the cmd window:
conda update scikit-learn
conda install matlibplot --force
Both ran successfully, to completion. Now, all of a sudden, Spyder doesn't start after updating one package and installing one package. I rebooted my machine; sitll can't gte Spyder to run. Is there some kind of master reset, or some trick to manually get Spyder to statup? Thanks to all.
When I reun 'spyder --reset', I think it's supposed to reset everything. That's what I'm seeing from various posts. When I enter that into the Anaconda prompt, all I get is 'Python has stopped working. Windows is checking for a solution'. Then I have to close the error prompt, and that's then end of it. There should be an easy way to fix something like this. Literally, all I did was upgrade 2 packages. There's no way Python can be this unstable, or fragile.

Related

Miniconda doesn't activate

I am working on a remote machine for my internship and ran into the following problem.
I ran conda install -c huggingface -c conda-forge datasets, which ended up taking ages (and for some reason downloaded a lot of useless packages) and seemingly got stuck, so I ctrl-c'ed the process. From there on, running source ./miniconda3/bin/activate would take upwards of 20 minutes. I tried deleting the entire folder ./miniconda3 and re-installing it from the shell file -- that didn't help.
I interact with conda using VSCode with Python and Jupyter Notebook extensions installed. I re-installed these extensions too out of despair, it also didn't fix the issue. I cannot run any cells in Jupyter, because activating the virtual environement times out. Is there something so that conda activation takes 1-2 seconds like it used to?
I'm not sure if this will fix it for you, but you could try making sure that you full uninstall miniconda before you re-install it. It makes changes to bashrc and has some other hidden folders. The vscode extension isn't going to be able to handle a 20 minute start up wait, so you'll need to resolve that issue first.
https://zditect.com/guide/python/uninstall-miniconda.html
Also I'm not sure that you should be calling source on the activation function of miniconda. At least for me, when using miniconda you should end up with conda on your terminal path. Then you just use conda activate to activate the environment you are working with.

Why aren't conda commands working in Spyder?

I recently downloaded Spyder using Python 3.9.12. For some reason, every time I try to use a conda command (such as conda activate env), the Spyder terminal gives the message 'Note: you may need to restart the kernel to use updated packages.' I've restarted the kernel multiple times, but the same message persists, essentially meaning that I cannot use conda commands in Spyder. However, they work fine in the regular Anaconda3 prompt. Does anyone know how to fix this? Thanks in advance!

"pythonw.exe entry point not found" when running spyder in an environment

Error Notification:
The proceduce entry point
?PyWinObject_AsWriteBuffer##YAHPEAU_object##PEAPEAXPEAKH#Z could not
be located in the dynamic link library
C:\Users\Admin\anaconda3:ibrary\bin\pythoncom38.dll
I was using virtualenv to create an environment for my Python project instead of using "anaconda navigator" because it takes me too long to switch and run spyder in it. So I installed spyder inside my environment with pip install spyder and ran spyder via my env prompt. The error message appears and, although it's still working, it's kind of annoying. What is the problem, and how I can fix it?
I'm having the same issue, and I've tested all new installations via pip that will encounter this issue. It seems the problem is related to creating the virtual environment on Windows OS.
As Ten Kho posted, the only error message is a pop-out window that says entry point error.
I fixed the problem by install scoop (guide can be found here https://scoop.sh/), and use scoop to reinstall python on windows. This fixed the pythoncom38.dll issue for me.

I am not able to install pytorch in jupyter and Spyder?

I have tried installing pytorch on jupyter and spyder but it is not working. I have install it in conda env, from pytorch documentation tried everything.
From pytorch documentation and it shows pytorch installed 100%
In conda env. Installed for jupyter and spyder
In conda list pytorch is not showing
I have tried to open from app after installing in conda env. But it is Not opening here in jupyter, a pop up window appears each time for 1-2 seconds then disappears.
Is there any other way to install it ?? Please help
Your issue is simply that conda fails to install pytorch; this can have multiple causes. Forget about spyder and jupyter, they're not the issue.
1. From pytorch documentation and it shows pytorch installed 100%
No it doesn't. Look at the bottom line: Rolling back transaction: ...working... done. conda did not successfully install the package. You need to debug further why (permissions issue on directory? installing under userid? dependency conflict?) Follow my suggestions at bottom.
2. In conda env. Installed for jupyter and spyder
No they don't! They only show that conda has (previously) installed the jupyter and spyder executables. Those don't tell you which conda packages are installed. That's what conda list does.
3. In conda list pytorch is not showing
Correct. Because it never installed it in the first place, as per 1. above.
You must debug why step 1. fails. There are many possible causes and you haven't given enough debugging information that we can tell which.
Please post extra information on why it fails. Suggest you do the following:
Try just conda install pytorch -c pytorch by itself, not all the other packages, they make constraint solving harder.
Try verbose mode: conda install -v pytorch -c pytorch
verbose mode should show you why conda thinks it needs to roll back the transaction (e.g. conflicting dependencies for 2+ different packages)
Check which user and permissions you're doing conda install under, are they the same as the Anaconda install? (often if you use the GUI installer under Windows/Linux/Mac, it assumes it can/should as admin or else user, without asking you).
In rare cases, you might need to nuke your conda environment and create a new env. I'd do this if you can't debug it after say 48+ hours. If you install every package under 'base', in particular for R as well as Python, this is a known issue. Even if doesn't break things, using 'base' environment for too many things tends to slow down constraint solving to take many hours, or hang forever.
Finally, after you do finally get the package installed, see if you need to set PYTHONPATH (either/both inside the Anaconda GUI package manager, and in the Unix shell .bashrc/Windows environment settings).
See the anaconda doc and also SO and the many good third-party blogs out there.

spyder/juypter not working after downgrading python

I had to download my python version from 3.5 to 3.4 because one of the packages I needed wasn't supported in 3.5. I downgraded the python version using the conda command prompt, and everything worked fine - got my package to install with all its dependencies and no conflicts. But now when I try to open Juypter notebook or Spyder, nothing happens. My IPython works just fine. I'm thinking maybe i have to downgrade Juypter and Spyder, but I'm not sure. Anyone have any ideas?
After a day of searching I finally figured it out.
I initially used
conda install python=3.4
Bad idea - ended up having to do a fresh install of anaconda to get spyder and juypter working again.
What ended up working is creating a separate environment.
conda create -n py34 python=3.4 anaconda
activate py34
... then install packages ...
This added spyder(py34), juypter(py34), and all its "py34 brothers and sisters" to my start menu. Using these new shortcuts/environment, I now have access to the packages I need by choosing the appropriate short cut. Yes, my start menu has extra python shortcuts now, but whatever - it works.
Just make sure Make sure you install the packages you're looking for before you close the anaconda console. Perfect for installing theano dependencies mingw and libpython.

Categories

Resources