Anaconda update for Spyder has failed - python

Windows 10, 64 bit Anaconda 4.2, Python 3.5
I opened Spyder today to do some work. (so much for that idea, several hours later)
Spyder gave notice that there was new (3.1) version. I was on 3.0.2
So, I tried updating
conda update spyder
but it told me that it needed to DOWNGRADE it because of dependencies (I think, I wasn't taking notes at the time - so much for optimism)
Then I tried to update conda but that made things worse at this point, Spyder wouldn't start at all.
So, I uninstalled everything. At least, I think I did.
I went through Windows Programs and looked for anything that looked like it might be part of Anaconda, python, or Spyder.
I tried reinstalling Anaconda.
I got the 3 error messages about menus, path, and directories (there's a bunch of tickets on those). My path is short (800 characters or so) and my user name is in English.
I uninstalled and tried again.
Same results.
I created and ran the Fix.bat
"C:\My_Stuff\Program_Files\Anaconda3\pythonw.exe" -E -s "C:\My_Stuff\Program_Files\Anaconda3\Lib\_nsis.py" addpath
"C:\My_Stuff\Program_Files\Anaconda3\pythonw.exe" -E -s "C:\My_Stuff\Program_Files\Anaconda3\Lib\_nsis.py" mkdirs
"C:\My_Stuff\Program_Files\Anaconda3\pythonw.exe" -E -s "C:\My_Stuff\Program_Files\Anaconda3\Lib\_nsis.py" mkmenus
and that at least gave me my menus.
From a command prompt (either Anaconda or Windows),
conda list
shows no packages.
Spyder and Anaconda Navigator do not start ("This application failed to start because it could not find or load the Qt platform plugin "windows"
in "".)
Typing python from a command prompt (either one) appears to work and references Anaconda 4.2.0
I'm going around in circles.
Any help appreciated.
Craig

I had posted this on Github too, as I ran into a larger problem while trying to get my system back.
The last comment from that thread (https://github.com/conda/conda/issues/4369) is repeated here:
I have, I believe, successfully installed Anaconda 4.2 64bit Python 3.5 version
I uninstalled the software again using the Windows 10 uninstall from Programs and Features.
I manually removed the Anaconda paths from the user PATH variable.
I manually removed the Anaconda folder from the Startup menu.
I manually removed selected references to Anaconda in the registry.
(I did not see the Anaconda clean program until later - https://docs.continuum.io/anaconda/install)
I rebooted.
I installed from the exe I had downloaded last year (4.2)
This time, I installed for all users, not just me.
Testing
`conda list
returns many packages. Yeah!
Calling python from a command prompt works too.
Spyder starts and remember my previous project, so that is nice too.
I think I can work again.
I may need to upgrade some packages, so hopefully that will go well too.
Craig

Related

Unable to install PsychoPy module in Python

I tried to install the psychopy module in python, using Anaconda Prompt and python -m pip install PsychoPy and it gave me error messages I have no idea how to interpret:
enter image description here
followed by a bunch of white text mostly starting with "Requirement already satisfied: [...]" and two other red walls of text "ERROR: Command errored out with exit status 1: [...]" (I can also post pictures of them, if needed)
Additional Info:
I use a Windows 10, Version 21H2, x64-based System
For Python (3.8.8) I use Sypder
Anaconda Navigator is Version 2.0.3
I also have the PsychoPy Standalone (Coder, Runner & Builder) installed (version 2022.2.0)
Any and all help is appreciated!!
Please also tell me if I did this question-thing right, this is my first time posting here and I don't know the etiquette yet
This is not for sure.
Maybe you already solve this problem.
I have experienced some problem of psychopy.
So, I hope this is helpful for you and many other researchers with psychopy.
First, update conda will solve many kind of problems.
'''
conda update --all
'''
Second, In anaconda environment using 'conda' command is recommendation.
In anaconda environment use(except for impossible) 'conda' command is recommended. Generally, mixed use of 'pip' and 'conda' command is not matter. BUT, SOMETIMES, this could occur minor error like this question.
Third, use anaconda virtual environment.
Anaconda provide virtual environment. Initially virtual environment looks confused but, this could safe and secured develop your experiment program.
Lastly, this probelem.
In the middle of your error message. "requires-python>=3.6" <- maybe this means your environment is not appropriate the environment. but your environment is 3.8.8.
For now this is just hypothesis. I think your environment have more than 2 of python could be installed. So, delete all python and reinstall the anaconda and use virtual environment could be safe.
I haven't used this community for a long time so I don't know the etiquette. If I was rude, thank you for your understanding.

Spyder on MacOS. Typing is very laggy

I am using Spyder with Anaconda on macOS. I have already updated Anaconda and Spyder to version 4.2.0 (4.2.1 was not found). The problem is now, that if I am typing in Spyder it takes about one second until the letters appear, which is very annoying. Is there somebody who also has this problem? Or does somebody have a suggestion on what might be the problem?
Had the same exact issue with Spyder 5.0.0, on Catalina; editor being very laggy (the console was fine).
Solution worked for me: Disable Kite!
From the top menus:
Python > Preferences... > Completion and linting,
Deselect any option that calls Kite:
Notify me when Kite can provide missing completions (but is unavailable!)
Enable Kite provider
PS: Tried pyqt solutions with no success (this now generates warnings in the terminal every time I open Spyder).
(Spyder maintainer here) There are two main causes of this problem:
We had several memory leakages and other serious inefficiencies that were causing a lot of sluggishness in the editor. Most of them are fixed in our 5.1.5 version, released in September 2021. Other improvements will come in 5.2.0, to be released in November 2021.
If you're still experiencing this problem with those versions, it could be because you're in Big Sur. The only way to get a fix for that is by using our mac OS installer
I'd like to chime in and say I'm getting this on Catalina (not Big Sur).
Using Spyder 5.0.5 seemed to fix it.
-- Edit
No it didn't. I'm on Catalina and it's still laggy as hell. Using v5.0.5
read: https://github.com/spyder-ide/spyder/issues/14218
One solution suggests downgrading pyqt and pyqtwebengine.
vancromy commented on 17 Nov 2020 I just pip installed pyqt==5.12 and pyqtwebengine=5.12 in my base conda environment and noticed a
substantial decrease in the latency! Still a bit of latency but not as
pronounced as before. :)
Note: Please don't use this solution if you're using Anaconda because it could break your environments.
tools -> reset spyder to factory defaults
and it worked
Two years later, and this is still an issue. Sypder recommends installing from their DMG, which resolves the issue.
What I did was create my virtual environment and instead of installing Spyder there, I installed:
conda install spyder-kernels=2.2
v2.2 is important because otherwise there may be conflicts and it won't install.
Then, deactivate your environment and launch Spyder from the conda base environment.
In the bottom right of Spyder is text with the environment name. For example, mine says: conda:base(Python:3.9.12)
Click that and then "Change default environment in Preferences"
In the Preferences frame, under Python Interpreter, select Use the Following Python Interpreter
From the drop down menu, select the one with the name of your environment. It should look something like:
/Users/YourComputerName/opt/anaconda3/envs/environmentname/bin/python
Click Apply, then okay.
Spyder works flawlessly when you install its standalone version and not from the anaconda distribution (not sure why anaconda is still not fixing it).
If you want to make use of conda virtual environment with Spyder standalone IDE, see the solution detailed below. It worked for me very well.
https://medium.com/#apremgeorge/using-conda-python-environments-with-spyder-ide-and-jupyter-notebooks-in-windows-4e0a905aaac5
# install Anaconda and create a new conda environment
conda create -n env_name python=3.7.4
# activate environment
conda activate env_name
conda install package_name
# get path of the environment
python -c “import sys; print(sys.executable)”
# install spyder-kernels (version >= 2.3.0 and <= 2.4.0)
pip install spyder-kernels
# copy the env path in Spyder IDE and restart Spyder IDE
Spyder -> preferences -> python interpreter -> use the following Python interpreter -> choose from the drop-down list or copy the env path
Experienced this issue on MacOS Mojave via Anaconda. Upgrading both Anaconda (v4.10.3) and Spyder (v5.0.5) didn't help. Ended up following this guide, which suggested upgrading PyQt5 and PyQtWebEngine modules. A warning was produced upon upgrading:
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
spyder 5.0.5 requires pyqtwebengine<5.13, which is not installed.
spyder 5.0.5 requires pyqt5<5.13, but you have pyqt5 5.15.4 which is incompatible.
Despite the incompatibility warning, I no longer experience latency.
Note: Please don't use this solution if you're using Anaconda because it could break your environments.

IDLE and python is different, not able to install modules properly

thanks for reading this. I am using macOS High Sierra. I am not very familiar with terminal or environment variables, but am trying to learn more. From reading other threads and google, it seems like I either have multiple pythons installed, or have pythons running from different paths. However I am not able to find a solution to resolving this, either by re-pathing my IDLE or deleting it entirely.
I do have python, python launcher, and anaconda (not very sure how anaconda works, have it installed a few years back and didn't touch it) installed. I am trying to install pandas (pip install pandas), which tells me that I have it installed, but when I run it on IDLE, it says module not found. Though if i run python3 on terminal and type my code in, it works (so pandas has indeed been installed).
When i run which python on terminal, it returns
/Users/myname/anaconda3/bin/python
(when i enter into this directory from terminal, it shows that in the bin folder, I have python, python.app, python3, python3-config, python3.7, python3.7-config, python3.7m, python3.7m-config)
When i run which idle on terminal, it returns
/usr/bin/idle (im not even sure how to find this directory from the terminal)
When i run import os; print(os.path) on IDLE, it returns module 'posixpath' from '/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/posixpath.py'
Would really appreciate some help to figure out how to ensure that when i install modules from terminal, it would be installed into the same python as the one IDLE is using. Also, I would like to know whether it is possible for me to work on VSCode instead of IDLE. I cant seem to find suitable extensions for data science and its related modules (like statsmodels, pandas etc). Thanks a lot!
First of all, a quick description of anaconda:
Anaconda is meant to help you manage multiple python "environments", each one potentially having its own python version and installed packages (with their own respective versions). This is really useful in cases where you would like multiple python versions for different tasks or when there is some conflict in versions of packages, required by other ones. By default, anaconda creates a "base" environment with a specific python version, IDLE and pip. Also, anaconda provides an improved way (with respect to pip) of installing and managing packages via the command conda install <package-name>.
For the rest, I will be using the word "vanilla" to refer to the python/installation that you manually set up, independent of anaconda.
Explanation of the problem:
Now, the problem arises since you also installed python independently. The details of the problem depend on how exactly you set up both python and anaconda, so I cannot tell you exactly what went wrong. Also, I am not an OSX user, so I have no idea how python is installed and what it downloads/sets alongside.
By your description however, it seems that the "vanilla" python installation did not overwrite neither your anaconda python nor anaconda's pip, but it did install IDLE and set it up to use this new python.
So right now, when you are downloading something via pip, only the python from anaconda is able to see that and not IDLE's python.
Possible solutions:
1. Quick fix:
Just run IDLE via /Users/myname/anaconda3/bin/idle3 every time. This one uses anaconda's python and should be able to see all packages installed via conda install of pip install (*). I get this is tiresome, but you don't have to delete anything. You can also set an "alias" in your ~/.bashrc file to make the command idle specifically linking you there. Let me know with a comment if you would like me to explain how to do that, as this answer will get too long and redundant.
2. Remove conda altogether (not recommended)
You can search google on how to uninstall anaconda along with everything that it has installed. What I do not know at this point is whether your "vanilla" python will become the default, whether you will need to also manually install pip again and whether there is the need to reinstall python in order for everything to work properly.
3. Remove your python "vanilla" installation and only use anaconda
Again, I do not know how python installation works in OSX, but it should be reasonably straightforward to uninstall it. The problem now is that probably you will not have a launcher for IDLE (since I am guessing anaconda doesn't provide one on OSX) but you will be able to use it via the terminal as described in 1..
4. Last resort:
If everything fails, simply uninstall both your vanilla python (which I presume will also uninstall IDLE) and anaconda which will uninstall its own python, pip and idle versions. The relevant documentation should not be difficult to follow. Then, reinstall whichever you want anew.
Finally:
When you solve your problems, any IDE you choose, being VScode (I haven't use that either), pycharm or something else, will probably be able to integrate with your installed python. There is no need to install a new python "bundle" with every IDE.
(*): Since you said that after typing pip install pandas your anaconda's python can import pandas while IDLE cannot, I am implying in my answer that pip is also the one that comes with anaconda. You can make sure this is the case by typing which pip which should point to an anaconda directory, probably /Users/myname/anaconda3/bin/pip
First: This would be a comment if I had enough reputation.
Second: I would just delete python. Everything. And reinstall it.
To repeat and summarized what has been said on various other question answers:
1a. 3rd party packages are installed for a particular python(3).exe binary.
1b. To install multiple packages to multiple binaries, see the option from python -m pip -h.
To find out which python binary is running, execute import sys; print(sys.executable).
3a. For 3rd party package xyz usually installed in some_python/Lib/site-packages, IDLE itself has nothing to do with whether import xyz works. It only matters whether xyz is installed for 'somepython' (see 1a).
3b. To run IDLE with 'somepython', run somepython -m idlelib in a terminal or console.
somepython can be a name recognized by the OS or a path to a python executable.

'python' points to anaconda installation

I've installed anaconda, but I still want to use python as normal within a Terminal window (zsh). At the moment, running which python shows /Users/USERNAME/opt/anaconda3/bin/python.
I don't want this command to point to my anaconda installation. I want to use python as I have in the past, and for it to point to my python 2.7 installation (/usr/bin/python).
The same issue is present with pip and with python3. How do I change these paths back to their default locations?
I want to start out by saying I personally have never used Anaconda, but I have many friends who have and they always seem to wind up getting into hot water as far as configurations go. If you don't need the data-science specific tools that Anaconda offers (most of which I imagine you can get just as easily by using pip install <package_name>), then I STRONGLY urge you to not use Anaconda. I would suggest you instead use homebrew to install python 3.7 and leave the system version of python 2.7 alone... Anyways...
I recently fixed an issue similar to the one you're describing for a friend. I ended up deleted his anacaonda build and reinstalling fresh from homebrew (link: https://brew.sh/), so this is how I helped him and hopefully this will help you too.
Firstly, I would check the configuration of your ~/.bash_profile (or potentially ~/.bashrc) file. Comment out any lines you find that have to do with Anaconda by preceding with the # character. I believe when anaconda installs it puts the location of the anaconda-version-of-python higher in the PATH hierarchy, therefore you computer sees it first before it has the chance to look in /usr/bin...
Secondly, you need to move the anaconda-python to the trash... I would start by trashing the whole '/Users/USERNAME/opt/anaconda3' directory. If memory serves me correctly anaconda stores other python related things in the /MacitoshHD/Library/Frameworks directory, but don't quote me on that. I would advise looking there and trashing whatever seems to be related to the anaconda install.
After that, in a new terminal (so that your PATH refreshes), I installed homebrew, and then ran the command brew install python3 to install python3. I think perhaps I ran the command recommended in the installer output, something like "brew link python3" to symlink python3 where it needs to be linked after the installation.
Finally, everything is done python2 and python3 are installed and working with no issues. python2 is the system default version and python3 is the homebrew installed version. Feel free to ask any questions and I will try to help more, hopefully those instructions will get you started though.

Problems in fully uninstalling Python 2.7 from Windows 7

some months ago, I installed Python 2.7 on my laptop (my os is Windows 7).
After, I decided to use Python xy 2.7.3 instead of 'pure' Python; so, as suggested, I removed Python 2.7 and tried to install Python xy 2.7.3. However, when I tried to run the .exe file for installation, a warning window appears telling me that Python 2.7 is already installed on my computer. I tried to install a different version of Python xy (2.6) and everything went fine; however, I'd really prefer to use the latest version of Python xy.
Actually, I can't figure out what went wrong whie uninstalling Python 2.7; does someone have any clue?
I can tell you that I followed the 'normal' procedure for programm uninstalltion; control panel -> Programs -> Remove Program
Thanks in advance
Stefano
Run regedit, backup and delete the registry keys:
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
My problem occurred when changing from Canopy to Python(x,y).
So, also delete all folders that are left behind when uninstalling.
https://support.enthought.com/entries/23580651-Uninstalling-Canopy
I also had this issue as well. It was due to third party installs. Even though you have uninstalled python, it leaves all the third party libraries that were installed and I think Python(x,y) just detects the directory.
To fix, uninstall Python 2.7 and then check to see if C:\Python27 still exists. If it does, go ahead and delete and then try installing Python(x,y). That is what worked for me.
I faced this issue: I tried to uninstall the python and fresh install, reason my pip version issue was not getting resolved. So I deleted the python folder, removed python from system path, and when I tried to uninstall from "Uninstall a program" in control panel, it showed "Windows installation package" error window and could not clean uninstall.
Solution what i found was: In the "Uninstall a program" select python and click repair. And then uninstall the python, it worked for me. Hope this helps and save some time.
PS: I am pretty new to python, and any help correcting me would be appreciated.
Maybe to put an answer out there.
Uninstalling anything from windows can have multiple side effects residing completly on your specific machine. As to what is common:
-> Python sets itself in your windows path. Here is how to modify your windows path: http://www.computerhope.com/issues/ch000549.htm
It means that there is a probability that python is gone but the path entry might not be. That is a guess however -> more information needed
-> Are you sure that everything was removed from your computer? If you already did the normal uninstalling process - try to look up if any python directory is still present.
-> Thirdparty installed? Have you downloaded any libs that are still on your machine.
Besides from that - it could be anything - the more information you give us the more we can say about it.
Maybe this post will help you: How to completely remove Python from a Windows machine?
I had python 2.7.12 and wanted to uninstall it for 2.7.9. I had the same problem as you and to fix it I tried to delete all of the local files and then uninstall however it still gave me the same error. So instead I decided to repair the python 2.7.12 and then uninstall which worked perfectly and completely got rid of the error.
I had python 2.7 installed and enthought canopy. I wanted to switch to python(x,y) to access a full version of the OpenCV library. python(x,y) installation complained about python 2.7 already being installed after:
1)Using windows control panel
2)Removing all lingering python files
3)Removing the windows path as suggested above
Not until I removed all registry entries related to python/enthough did python(x,y) install without issue.
I installed Enthought before. When I wanted to install Python(x,y) instead, I met the problems above.
After I had tried to uninstall Enthought and Python(x,y) from the Control Panel and then restart the PC, the problem still occured the next time I installed Python(x,y).
I solved this problem by:
deleting all the relevant files in C:/User/UserName/AppData/ about Python, including the third party softwares like Enthought;
deleting the Path in user and system Environment;
=====the two steps were failed if I didn't do the third step.=====
deleting the register keys as #Daniel said. (include all the relevant keys with the prefix py if you installed the third party software about Python. )
HKEY_LOCAL_MACHINE\Software\Python\
HKEY_CURRENT_USER\Software\Python
Locate that set up file which was used to install Python. Run it and choose repair. If that doesn't solve the problem. Go to c:\Python(x,y) and delete this folder completely by shift+Del.
Run that set up file again and click on "Change" which will ultimately install the Python again. By default in my case option to add path and making that version of Python the default on my system was unchecked which can be figured out by seeing the red cross mark in one of the installation screen. Click on it if you want set up to make it default Python version and also click on the option to indicate you want the path to be added in windows environment variable.
No need to touch registry as previous ones will be overwritten again.
In my case it worked. I was getting error like:
Fatal Python error: Py_Initialize: unable to load the file system codec
LookupError: no codec search functions registered: can't find encoding
Besides that un-installation was failing from control panel. So above steps solved all of my problem. Hope it helps.
I Repaired/Modified to install all the components for the Python
version I wanted to uninstall.
Once that was done, I clicked on Uninstall/Change and that uninstalled it for good.

Categories