Anaconda Navigator won't launch, download_api error (Windows 10) - windows

Last night I ran a Windows update and this morning Anaconda Navigator hangs when I try to launch it. After googling I ran some updates in Anaconda prompt:
conda update
conda update anaconda-navigator
And then when I try to launch anaconda navigator from the prompt I get this error:
2019-03-01 09:23:00,212 - ERROR download_api._get_url:416
Expecting value: line 1 column 1 (char 0)
Traceback (most recent call last):
File "C:\Users\xxxx\Anaconda3\lib\site-packages\anaconda_navigator\widgets\main_window.py", line 539, in setup
self.post_setup(conda_data=conda_data)
File "C:\Users\xxxx\Anaconda3\lib\site-packages\anaconda_navigator\widgets\main_window.py", line 576, in post_setup
self.tab_home.setup(conda_data)
File "C:\Users\xxxx\Anaconda3\lib\site-packages\anaconda_navigator\widgets\tabs\home.py", line 169, in setup
self.set_applications(applications, packages)
File "C:\Users\xxxx\Anaconda3\lib\site-packages\anaconda_navigator\widgets\tabs\home.py", line 204, in set_applications
apps = self.api.process_apps(applications, prefix=self.current_prefix)
File "C:\Users\xxxx\Anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py", line 888, in process_apps
versions=[vsdata.get('productVersion')],
AttributeError: 'str' object has no attribute 'get'
I use Jupyter Notebook and Spyder and this is causing me a major headache. Thanks in advance!

There's another solution (not the best, but it works). Anaconda can't retrieve vscode version for any reason.
You need to replace line 888 in file "C:\Users\xxxx\Anaconda3\lib\site-packages\anaconda_navigator\api\anaconda_api.py"
from versions=[vsdata.get('productVersion')], to versions=["1b8e8302e405050205e69b59abb3559592bb9e60"],

After lots of restarts and lots of googling I found a simple fix:
conda update navigator-updater
It works...for now

For me it worked only when I'm connected to the internet. Offline, it fails to start.

Related

Spyder 5 ModuleNotFoundError

I have just updated my spyder4 to spyder5 as:
conda update spyder
as I try to launch spyder it gives an Error : No module named 'qdarkstyle.colorsystem'
Here is the complete information :
Traceback (most recent call last):
File "/home/sina/anaconda3/envs/py37/bin/spyder", line 11, in <module>
sys.exit(main())
File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/app/start.py", line 210, in main
from spyder.app import mainwindow
File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/app/mainwindow.py", line 72, in <module>
from spyder.app import tour
File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/app/tour.py", line 37, in <module>
from spyder.utils.qthelpers import add_actions, create_action
File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/utils/qthelpers.py", line 34, in <module>
from spyder.utils.icon_manager import ima
File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/utils/icon_manager.py", line 23, in <module>
from spyder.utils.palette import QStylePalette, SpyderPalette
File "/home/sina/anaconda3/envs/py37/lib/python3.7/site-packages/spyder/utils/palette.py", line 12, in <module>
from qdarkstyle.colorsystem import Blue, Gray
ModuleNotFoundError: No module named 'qdarkstyle.colorsystem'
I would appreciate any comments on it.
Met with similar problem. I reverted back to previous version till the devs sort the problem out.
conda install spyder=4.2.5
Same problem on Win. To rollback, using miniconda command is the same:
conda install spyder=4.2.5
If you have activated a dedicated environment (named "xyz" here) first go to "base" and update the package repository (in miniconda its conda update conda), then activate the environment you want to operate on. Note: the package repository resides only in "base", however you can have as many custom environments, each installing and running its own version of Sypder (and any other packages installed, dedicated to that environment)
activate base #go to the base to update the package repository first
conda update conda #in miniconda just update conda, not anaconda
activate xyz
conda install spyder=4.2.5
Version 5 reportedly unstable till May-June
For all people that have this problem right now: if you want to use a
very stable and well tested Spyder version, please stay with our
latest version of Spyder 4 (we plan to maintain it for two more months
with small bug fixes). Spyder 5 is still a work in progress and it'll
take us two or three months until reaches the same level of stability.
ccordoba12 https://github.com/spyder-ide/spyder/issues/15113
If you want to play with 5.0 first in a new environment named "tmp":
conda create --name tmp
activate tmp
conda install spyder=5.0.0
Later, can easily blow away that entire environment and everything in it.
conda env remove --name tmp
I tried conda install -c conda-forge qdarkstyle=3.0.2 and it worked. But yeah there are few other bugs but spyder does seem to start.
They notified me that the problem had been fixed and how to get a working version. The remedy is
conda install spyder=5.0.0=*_1
I did so and it is working as expected.
On windows 10 using conda install qdarkstyle=3.0.2
return spyder to ver 4.2.3, but it is working. Anaconda typically fix such a bugs after few days.
I tried downgrading qdarkstyle package using conda install qdarkstyle 2.8.1 and it worked for me. Win 10 64 bit anaconda spyder IDE
On Windows 10 using WinPython and Spyder 5.0.3. I was having this issue with a local module import.
The simple fix was that my PYTHONPATH had gotten reset in the upgrade, and adding back in the relevant folders fixed this.

PermissionError while starting the kernel in Spyder's IPython console

When I launch spyder, this error appears :
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site‑packages\spyder\plugins\ipythonconsole.py", line 1572, in create_kernel_manager_and_kernel_client
kernel_manager.start_kernel(stderr=stderr_handle)
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\manager.py", line 240, in start_kernel
self.write_connection_file()
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 547, in write_connection_file
kernel_name=self.kernel_name
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 212, in write_connection_file
with secure_write(fname) as f:
File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 112, in __enter__
return next(self.gen)
File "C:\ProgramData\Anaconda3\lib\site‑packages\jupyter_client\connect.py", line 102, in secure_write
with os.fdopen(os.open(fname, open_flag, 0o600), mode) as f:
PermissionError: [Errno 13] Permission denied: 'C:\\Users\\Sébastien\\AppData\\Roaming\\jupyter\\runtime\\kernel‑e1f2b044843b.json'
I am not experienced at all in programming but I tried to enter commands in the Anaconda prompt but none of this worked ("conda update jupyter_client" and "conda update --all")
I also tried to install and uninstall but I still get the same error.
This seems a permissions issue. Running Spyder as administrator (right click on it-> run as administrator) solves the problem.
UPDATE:
As per #CarlosCordoba: "To fix this the OP needs to run conda update anaconda and then conda update jupyter_client in the Anaconda Prompt"
Note that the original workaround worked as well in this case.
What did help for me was to allow insecure writes:
yourPythonPath\scripts\activate.bat
set JUPYTER_ALLOW_INSECURE_WRITES=1
spyder
Alternatively you could also set JUPYTER_ALLOW_INSECURE_WRITES to 1 in your global Windows environment variables.

PyInstaller win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryExW', 'The system cannot find the file specified.')

While using PyInstaller (dev version 4.0.dev0+8196c57ab), produced an OSError: [WinError 2] 'The system cannot find the file specified.'
Python version: 3.7
GUI: PySide2 5.13.0
Other packages: lxml, BeautifulSoup, Matplotlib (with dependencies like numpy), Pandas, pypiwin32, reportlab, Theano
Anaconda 3, Windows
Compiled with PyInstaller --onedir
What I've tried:
Tried downgrading PyInstaller to 2.1 as suggested here: https://github.com/pyinstaller/pyinstaller/issues/3916 but doesn't work as Python 3 is not supported
Was originally on PyInstaller 3.5, upgraded to dev version as suggested under some of the issues on PyInstaller github
Tried including --exclude-module=.git
import PyInstaller.__main__
if __name__ == '__main__':
PyInstaller.__main__.run([
'--name=%s' % 'Dummy App',
'--onedir',
'--nowindowed',
r'--workpath=C:\Users\User1\Desktop\build7',
r'--distpath=C:\Users\User1\Desktop\dist7',
'--hidden-import=theano.tensor.shared_randomstreams',
'--hidden-import=pandas._libs.tslibs.timedeltas',
'--clean',
'--add-data={0};.'.format('redacted.xml'),
'--add-data={0};{0}'.format('redacted_folder'),
'--add-data={0};.'.format('redacted.pdf'),
'--exclude-module={0}'.format('.git'),
'--log-level=WARN',
'MainWindow.py'
])
Full stacktrace:
79702 DEBUG: Analyzing .git\objects\78\e83411cea88cd038acb12c005a984fc0d6d423
Traceback (most recent call last):
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 35, in pywin32error
yield
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\core\ctypes\_util.py", line 42, in check_null
raise make_error(function, function_name)
OSError: [WinError 2] The system cannot find the file specified.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/User1/Dropbox/GitHub_Repos/DiabetesReportGenerator_v2/pyinstaller_freeze.py", line 37, in <module>
'MainWindow.py'
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\__main__.py", line 112, in run
run_build(pyi_config, spec_file, **vars(args))
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\__main__.py", line 63, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 732, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 679, in build
exec(code, spec_namespace)
File "C:\Users\User1\Dropbox\GitHub_Repos\DiabetesReportGenerator_v2\Risk Calculator.spec", line 17, in <module>
noarchive=False)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 242, in __init__
self.__postinit__()
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\datastruct.py", line 158, in __postinit__
self.assemble()
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\building\build_main.py", line 468, in assemble
redirects=self.binding_redirects))
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\depend\bindepend.py", line 226, in Dependencies
for ftocnm, fn in getAssemblyFiles(pth, manifest, redirects):
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\depend\bindepend.py", line 402, in getAssemblyFiles
for assembly in getAssemblies(pth):
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\depend\bindepend.py", line 353, in getAssemblies
res = GetManifestResources(pth)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\utils\win32\winmanifest.py", line 1005, in GetManifestResources
return winresource.GetResources(filename, [RT_MANIFEST], names, languages)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\PyInstaller\utils\win32\winresource.py", line 168, in GetResources
hsrc = win32api.LoadLibraryEx(filename, 0, LOAD_LIBRARY_AS_DATAFILE)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\win32api.py", line 43, in LoadLibraryEx
return _dll._LoadLibraryEx(fileName, 0, flags)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\contextlib.py", line 130, in __exit__
self.gen.throw(type, value, traceback)
File "C:\Users\User1\Anaconda3\envs\ids_gui\lib\site-packages\win32ctypes\pywin32\pywintypes.py", line 37, in pywin32error
raise error(exception.winerror, exception.function, exception.strerror)
win32ctypes.pywin32.pywintypes.error: (2, 'LoadLibraryExW', 'The system cannot find the file specified.')
P.S. Compilation and the exe functioned perfectly with virtualenv environment created from Anaconda environment earlier (without need for --exclude-module=.git), but was too bloated with packages because the virtualenv environment is still considered to be part of the conda environment. So I used a new conda environment, and this error appeared
I've gotten it to work by creating another virtualenv environment in this new conda environment, but that is a very roundabout way. Is there any workaround?
For me, PyInstaller seems to search through .git folder and redacted_folder unnecessarily
I solved this problem by:
MOVING the folder(s) out of the directory before freezing
Additionally, if the folder is required for the frozen app to run (e.g. as a data folder), I would also either:
Comment / remove the corresponding part for --add-data and manually copy the folder over, or
Change the path for --add-data e.g. if you moved redacted_folder to your Desktop, you can change to '--add-data=C:/Users/User1/Desktop/redacted_folder'
You'll still need .git and redacted_folder back in the original directory to use Git and run your code without freezing
For example, I had trouble with .git and redacted_folder. The frozen executable needed redacted_folder to run parts of the code.
What I did was:
Move .git and redacted_folder to a separate directory
Then, I commented out the line to add data for redacted_folder:
import PyInstaller.__main__
if __name__ == '__main__':
PyInstaller.__main__.run([
'--name=%s' % 'Dummy App',
'--onedir',
'--nowindowed',
r'--workpath=C:\Users\User1\Desktop\build7',
r'--distpath=C:\Users\User1\Desktop\dist7',
'--hidden-import=theano.tensor.shared_randomstreams',
'--hidden-import=pandas._libs.tslibs.timedeltas',
'--clean',
'--add-data={0};.'.format('redacted.xml'),
# Remove `redacted_folder` and comment out the following line
# '--add-data={0};{0}'.format('redacted_folder'),
'--add-data={0};.'.format('redacted.pdf'),
'--exclude-module={0}'.format('.git'),
'--log-level=WARN',
'MainWindow.py'
])
After freezing, I copied redacted_folder over to the appropriate location relative to the frozen executable in distpath
This was fixed. Update PyInstaller.
I installed pyinstaller in a new conda environment using pip, however pywin32 did not get installed by default (eventhough documentation mentioned it would). Installing it fixed the error for me.
I had this same issue and found another thread where somebody uninstalled Python and then reinstalled Python to fix it.
The key information to understand the problem though, was that they had originally installed Python using Microsoft Store. When they reinstalled Python, they just downloaded Python from python.org and this took care of the problem. It worked for me too.
It seems very likely that something in the Microsoft Store version is causing problems like this.
Start from administrator cmd or ide and try again, it's helped me.
Running from Jupyter Notebook with elevated privilegies worked for me!

Anaconda: An unexpected error ocurred on Navigator start-up

I had installed Anaconda, I had managed to launch it and then use R or python, and today I can no longer launch it and I get this error (I get the same error when I run the software in administrator mode)
An unexpected error ocurred on Navigator start-up
psutil.AccesDenied(pid=5740)
Traceback (most recent call last):
File "C:\Users\user\Anaconda3\lib\site-packages\psutil\_pswindows.py", line 620, in wrapper
return fun(self, *args, **kwargs)
File "C:\Users\user\Anaconda3\lib\site-packages\psutil\_pswindows.py", line 690, in cmdline
ret = cext.proc_cmdline(self.pid)
PermissionError: [WinError 5] Access Denied
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\user\Anaconda3\lib\site-packages\anaconda_navigator\exceptions.py", line 75, in exception_handler
return_value = func(*args, **kwargs)
File "C:\Users\user\Anaconda3\lib\site-packages\anaconda_navigator\app\start.py", line 108, in start_app
if misc.load_pid() is None: # A stale lock might be around
File "C:\Users\user\Anaconda3\lib\site-packages\anaconda_navigator\utils\misc.py", line 384, in load_pid
cmds = process.cmdline()
File "C:\Users\user\Anaconda3\lib\site-packages\psutil\__init__.py", line 701, in cmdline
return self._proc.cmdline()
File "C:\Users\user\Anaconda3\lib\site-packages\psutil\_pswindows.py", line 623, in wrapper
raise AccessDenied(self.pid, self._name)
psutil.AccessDenied: psutil.AccessDenied (pid=5740)
I follow the suggestions:
https://github.com/ContinuumIO/anaconda-issues/issues/6006
,
https://github.com/ContinuumIO/anaconda-issues/issues/1984
These commands helped me:
conda update anaconda-navigator
conda update navigator-updater
anaconda-navigator --reset
I use the anaconda in win10 x64 (python3.x) and I got this problem this morning as well. All the things had been done in anaconda was that I installed a package called pywinauto, then I turned off the computer and went home.
I follow the suggestion from https://groups.google.com/a/continuum.io/forum/#!topic/anaconda/4hBTDOcDzgo by lan, I update the anaconda by using the command.
conda update anaconda-navigator
However, the error occurred the same.
Then I reboot the computer and restart the anaconda, magic thing happens! the anaconda works fine!
I think maybe some configuration has been changed when I install the new package, and this change is conflicted with the current configuration which you need to reboot the computer to fix it. you should note that turn off computer then restart it is not equal to reboot it.
So, just reboot the computer and it will be fine.
Facing the same error initially, I tried other solutions given here by executing the commands in anaconda terminal but nothing works in my case as I was getting the following error on executing command
Load Error: invalid yaml at position 0
This means .condarc file is either corrupted due to some reason or there may be some changes in it.
The solution that worked for me is to delete .condarc. As the .condarc configuration file follows simple YAML syntax.
.condarc is automatically created in your home directory the time you run anaconda navigator.
Conda will re-create it, again.
Hope it Helps!!
Try removing .condarc from your directory and check if it works. I had the same issue and it worked for me. I hope it works for you.
I had same Problem , when i tried to update the anaconda navigator, there was conda memory error...Finally,Simple Reset Command Worked for me...!!
anaconda-navigator --reset
If the above solutions are not work,just turn off the proxy.
enter image description here
I faced the same issue.I used the v2ray and proxyfier throught the connect internet.Then I exit the proxyfier and v2ray and reopen the anaconda navigator.finally slove the problem.

Configparser error leads to crash of Spyder 3 under Python(x,y)

During its startup, Spyder3 IDE crashes under Python(x,y). I have installed a Python(x,y) distribution (2.7.10.0) of Python2.7 under Windows 7 and after updating the package spyder to the most recent version (with pip: V3.0.x), it does not restart anymore. Resetting the spyder config does not help.
It is reproducible as I checked it on 3 computers and also with the Enthought distribution, it has the same problem. Only under Anaconda, it keeps working properly.
The error message is stored in the contents of file spyder_crash.log:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 3001, in main
mainwindow = run_spyder(app, options, args)
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 2905, in run_spyder
main.setup()
File "c:\python27\lib\site-packages\spyder\app\mainwindow.py", line 1010, in setup
from xy.config import DOC_PATH as xy_doc_path
File "c:\python27\lib\site-packages\xy\config.py", line 40, in <module>
CONF = UserConfig('xy', defaults=DEFAULTS, version=__version__, subfolder='.xy')
File "c:\python27\lib\site-packages\xy\userconfig.py", line 110, in __init__
if version != self.get_version(version):
File "c:\python27\lib\site-packages\xy\userconfig.py", line 130, in get_version
return self.get(self.DEFAULT_SECTION_NAME, 'version', version)
File "c:\python27\lib\site-packages\xy\userconfig.py", line 269, in get
value = cp.ConfigParser.get(self, section, option, raw=self.raw)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 811, in get
d)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 384, in before_get
self._interpolate_some(parser, option, L, value, section, defaults, 1)
File "c:\python27\lib\site-packages\backports\configparser\__init__.py", line 397, in _interpolate_some
rawval = parser.get(section, option, raw=True, fallback=rest)
TypeError: get() got an unexpected keyword argument 'raw'
PS: I see that I could post an issue directly on Github but there are over 600 issues open. Maybe there is someone who knows a fix directly.
Different causes that Spyder crashes:
Spyder IDE won't start WinPython-64bit- 2.7.10.2
Broken links and probably different cause - Spyder/Pythonxy crashes
Edit:
Installation details:
C:\Users\strpeter>pip install spyder
Successfully installed configparser-3.5.0 jupyter-core-4.2.1 nbformat-4.2.0
setuptools-30.0.0 spyder-3.0.2
When uninstalling configparser, as recommended in the comment below, pythonw.exe stops working during the initialization of spyder3. I have no details at hand to report about the crash.
C:\Users\strpeter>pip uninstall configparser
Uninstalling configparser-3.5.0:
c:\python27\lib\site-packages\backports\configparser\__init__.py
c:\python27\lib\site-packages\backports\configparser\__init__.pyc
c:\python27\lib\site-packages\backports\configparser\helpers.py
c:\python27\lib\site-packages\backports\configparser\helpers.pyc
c:\python27\lib\site-packages\configparser-3.5.0-py2.7-nspkg.pth
c:\python27\lib\site-packages\configparser-3.5.0-py2.7.egg-info
c:\python27\lib\site-packages\configparser.py
c:\python27\lib\site-packages\configparser.pyc
Proceed (y/n)? y
Successfully uninstalled configparser-3.5.0
(Spyder developer here) This is an error between PythonXY and Spyder. I opened an issue about it, which we're going to solve in Spyder 3.1.0 (to be released in mid January/2017).
This might be due to incompatibilities due to different Qt wrappers. To test this in Enthought Python, please open a Canopy Command Prompt (or otherwise ensure that Enthought Python is your default python). Then ensure that PyQt is installed and make it the default Qt wrapper:
enpkg pyqt
set QT_API=pyqt
Now does Spyder 3 run ok?

Resources