Spyder fails to launch with psutils ImportError - Windows Anaconda - python

I'v been having a issue were Spyder has been failing to launch from the Anaconda Navigator. I launched my environment with a terminal and ran spyder and I'm getting a ImportError.
I'v uninstalled Anaconda multiple times and still no dice.
Here are all my conda packages listed with conda list > list.txt
and here are all my pip packages listed with pip freeze > requirements.txt
EDIT:
Here is my PYTHONPATH

I ended up fixing this issue my removing Anaconda and every Python installation on my machine as well the Python environment variables.
I fixed it by getting mad thinking how about removing every python and just reinstalling Anaconda. :D

Related

Jupyter not recognizing installed 'statsmodels' package

I have a Jupyter notebook running inside an Anaconda virtual environment that won't recognize the statsmodels package. I've used both pip and conda, and I've reinstalled the whole environment several times in between restarting my computer. As you can see in this link, both pip and conda show that it is installed. However, I continue to get this error:
---> 43 import statsmodels.api as sm
ModuleNotFoundError: No module named 'statsmodels'
At first I thought it was the kernel, but that wouldn't explain why every other package I've installed is recognized properly.
The only thing I haven't done is tried it on another computer (I'm running Windows 10 x64). I just want to know if anyone can see something that I'm missing before I do so.
Thanks!
Edit:
I've tried the following commands to install it:
pip install statsmodels
conda install -c conda-forge statsmodels
conda install statsmodels
I've tried using each command individually, making sure to uninstall the previous installation. I've tried using only two at a time, with the same methodology. I've tried every permutation of the above installations, with a computer restart in between. I don't think the problem is that it's not installing. I have no clue why but Jupyter notebooks just isn't recognizing this one package.
I'm running all of my commands from an Anaconda command prompt, and I make sure to activate my focal virtual environment. I also run Jupyter lab by typing it directly into the command prompt and hitting enter (I make sure I've activated my environment).
I'll try running it on a different OS and update.
Thanks duffymo! My notebook wasn't using the correct kernel. I thought all I needed to do was run Jupyter lab from my virtual environment, but it needs to be purposefully added. I followed the directions shown here to add my conda environment to Jupyter lab:
How to add conda environment to jupyter lab

Python interpreter is in a Conda environment, but the environment has not been activated

Installation:
I'm a newbie in Python and I'm facing issues with Anaconda. Whenever I launch Anaconda Navigator it shows Python stopped working and crashes.
Also if I type python in the command prompt I get a warning:
"Python interpreter is in a conda environment, but the environment has not been activated. Libraries may fail to load. To activate this environment please see https://conda.io/activation"
I have seen such questions before and tried the solutions, but nothing seems to work. I also tried to reinstall, but it's the same every time.
Try:
conda activate base
Or create a venv:
conda create my_env
conda activate my_env
Or install the Python system directly. Download from here.
This seems to be two separate issues:
Crashing on Anaconda Navigator startup
Try to update PyQt. For more information, see: Spyder and Anaconda Navigator do not open - "Python has stopped working" (Fixed) #10088
For the Python commands, try to activate your environment: conda activate base.

Why is Miniconda not running the latest version of Spyder?

I am in my tensorflow env on my minicoda prompt and I have just installed the latest version of Spyder via the following prompt: conda update spyder. Before I updated spyder I was on v4.1.3. I then searched to see if it was installed correctly with the following prompt: conda search -f spyder which brought up this list:
However, when I run spyder from miniconda: spyder (or even startup the application by clicking on the icon) it still launches my previous version of 4.1.3
What I then tried to do was run the prompt spyder=5.05 but it still launches version 4.1.3.
In my miniconda3\Lib\site-packages directory my spyder folder's file __init__.py has version = 4.1.3 so I understand that that is why it is launching 4.1.3. I do not know why this spyder folder was not updated. You can also see the pkgs folder there is only Spyder v4.1.3
Can someone please help me get the latest version of spyder to run without me having to uninstall and reinstall it, as I have all my preferences set on spyder and apparently there is no way of exporting and then importing them. Thanks
In my environment on my Miniconda prompt I typed in conda install spyder=5.0.5 and this resolved the issue. I now have Spyder 5.0.5! Acknowledgements to MB-F for giving the solution in the comment section.
Try to do it in this order:
conda update anaconda
and then
conda install spyder=5
this will allow you to successfully upgrade to version 5.
If it didn't help, then do this:
conda install conda-forge::spyder[version='>=5.0.0]
You can put another version

After updating Anaconda-Navigator environments dont work

I updated Anaconda-Navigator to 1.9.12 on ubuntu and now my environments dont work.
I can still start a jupyter notebook from the environment but all my installed packages are not available even though they are displayed in the anaconda-navigator gui under installed packages for this env.
but when I import a package in a notebook : ModuleNotFoundError: No module named ....
The standard packages like numpy are available though...
Please help me... why did I update!!!!????
maybe a path problem? Please help me in simple terms
Thanks
I think this is a bug. My experiance is that when you upgrade to Navigator to 1.9.12.
the enviroment variables in GUI(Navigator UI), are taken from base enviroment not from second enviroment and if you work from console it work, so it looks like it not executes conda activate new_environment in gui. When you work from terminal everythings works fine.
To be honest it has the same behaviour if fresh install last anaconda too. This was the reason i have downgraded conda isntallation, and than i found out that last version of navigator was making the issues . Or you can downgrade:
conda install anaconda-navigator=1.9.7.

Segmentation fault when I try to run Anaconda Navigator

I have recently Installed Anaconda for Python 3.6 but it shows the error "Segmentation fault" whenever I try to run Anaconda-Navigator.
I've tried just writting in the terminal Anaconda-Navigator and also going to my Anaconda3 folder and try to execute it inside bin.
The only solution that works so far is accessing the previously bin folder as root. My problem is that I need to activate TensorFlow before I run anything in my console, but that is imposible as a root user.
I've already try to upgrade both, Anaconda and Navigator and reinstall them but nothing ocurrs
Anyone here has any idea of what is happening?
Had the same problem with my anaconda install. It is probably related to incompatible versions of conda and anaconda navigator.
conda update --all
worked for me.
I had the same issue today, and I solved by running:
conda upgrade anaconda
The output said:
The following packages will be DOWNGRADED due to dependency conflicts:
anaconda-navigator: 1.5.1-py36_0 --> 1.5.0-py36_0
after that, I launched anaconda-navigator (no segfault this time) and a window prompted me to upgrade to 1.5.1. I clicked yes, and now running anaconda-navigator 1.5.1 without segfaults on launch. Don't know what is the reason
I tried to install opencv via conda then I got the same error. Later I followed the
conda update conda
conda update anaconda-navigator
conda update navigator-updater
Then I did
conda update --all
Voila, its working again
I had the same issue when I install OpenCV library using conda.Most probably downgrading something makes this issue happen. Just type :
conda update --all
I had the same problem.I solved it by adding /lib to mt LD_LIBRARY_PATH.
Note: On my system Anaconda installation path is /home/pushyamik/anaconda3.

Categories