Problem displaying widgets / ipywidgets install unsuccessful - python

I'm implementing widgets in my jupyter notebook (via anaconda). I tried first by using an old code from a professor of mine, but it's not displaying widgets.
I tried installing:
jupyter labextension install #jupyter-widgets/jupyterlab-manager
But it was unsuccessful
This was presented when I attempted installation of the package via windows command prompt:
C:\Users\davio>jupyter labextension install #jupyter-widgets/jupyterlab-manager
Traceback (most recent call last): File
"C:\Users\davio\Anaconda3\lib\site-packages\jupyterlab_server\server.py",
line 14, in
from notebook.base.handlers import ( File "C:\Users\davio\Anaconda3\lib\site-packages\notebook\base\handlers.py",
line 30, in
from tornado import web, gen, escape, httputil File "C:\Users\davio\Anaconda3\lib\site-packages\tornado\web.py", line 87,
in
from tornado.httpserver import HTTPServer File "C:\Users\davio\Anaconda3\lib\site-packages\tornado\httpserver.py",
line 29, in
import ssl File "C:\Users\davio\Anaconda3\lib\ssl.py", line 98, in
import _ssl # if we can't import it, let the error propagate ImportError: DLL load failed: The specified procedure could
not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last): File
"C:\Users\davio\Anaconda3\Scripts\jupyter-labextension-script.py",
line 6, in
from jupyterlab.labextensions import main File "C:\Users\davio\Anaconda3\lib\site-packages\jupyterlab\labextensions.py",
line 16, in
from .commands import ( File "C:\Users\davio\Anaconda3\lib\site-packages\jupyterlab\commands.py",
line 27, in
from jupyterlab_server.process import which, Process, WatchHelper File
"C:\Users\davio\Anaconda3\lib\site-packages\jupyterlab_server__init__.py",
line 4, in
from .app import LabServerApp File "C:\Users\davio\Anaconda3\lib\site-packages\jupyterlab_server\app.py",
line 9, in
from .server import ServerApp File "C:\Users\davio\Anaconda3\lib\site-packages\jupyterlab_server\server.py",
line 26, in
from jupyter_server.base.handlers import ( # noqa ModuleNotFoundError: No module named 'jupyter_server'
I expect to:
i) Be able to install all the required ipy packages in order to display widgets properly
ii) View and manipulate widgets properly
Thank you!!!!

Maybe if you had alredy python installed before installing anaconda, that's the problem. Try uninstalling python and only working with anaconda's python, that worked for me.
(Sorry for bad english)

Related

Jupyter suddenly won't start without (already-installed) packages

I was having issues installing a package. I cancelled the install mid-solving environment.
Now, when I try to open Jupyter notebook, I receive the following error:
Traceback (most recent call last):
File "/Users/Me/opt/anaconda3/bin/jupyter-notebook", line 7, in <module>
from notebook.notebookapp import main
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 80, in <module>
from .services.contents.manager import ContentsManager
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/notebook/services/contents/manager.py", line 17, in <module>
from nbformat import sign, validate as validate_nb, ValidationError
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/nbformat/__init__.py", line 32, in <module>
from .validator import validate, ValidationError
File "/Users/Me/opt/anaconda3/lib/python3.7/site-packages/nbformat/validator.py", line 23, in <module>
raise ImportError(str(e) + verbose_msg)
ImportError: No module named 'importlib_metadata'
Jupyter notebook format depends on the jsonschema package:
https://pypi.python.org/pypi/jsonschema
Please install it first.
I tried installing jsonschema and importlib_metadata via conda install. When I do that, I receive this (for both):
# All requested packages already installed.
I tried turning it off and on again; I tried removing and reinstalling Jupyter. Neither worked. This is abhorrently frustrating. What the heck is going on, and why is Jupyter suddenly deciding to not work when it worked perfectly before the weekend? And more importantly, how do I fix this?

Issue running python script via PyCharm but not Anaconda Prompt

When I run a script in Anaconda Prompt, it works fine.
When I try to run it via PyCharm, I get this error related to the import of pandas.
C:\ProgramData\Anaconda3\python.exe C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py
Traceback (most recent call last):
File "C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py", line 2, in <module>
import pandas as pd
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
Process finished with exit code 1
If I try to import numpy and run it via PyCharm I get:
C:\ProgramData\Anaconda3\python.exe C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py", line 2, in <module>
import numpy as np
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
Process finished with exit code 1
Running the same script in Anaconda prompt...no problem
My run configuration in PyCharm uses the Anaconda python distribution?
It should be noted that I am not using envirnoments, just the base Anaconda installation. More worryingly I dont see ANY Conda options in the project settings in PyCharm which a lot of tutorials seem to allude to.
Seems like a problem with the path for your scripts. Are you sure You have included your scripts in the PATH variable? If so are you sure your libraries are downloading/installing in that path?

Anaconda Navigator Removed Itself

I went on to my computer today to work on a code I had been chiseling away at for school. I clicked on my anaconda navigator, only for anaconda to quickly show up in my running task bar at the bottom of my screen then disappear. I read on a other post that perhaps my Macbook wasn't updated and that was affecting it. I updated my Macbook and when I went to my launchpad to open Anaconda, it had completely disappeared. I tried opening a terminal and running "Anaconda-navigator" and I got this:
(base) xxxxx-MBP:~ xxxxx$ anaconda-navigator
Traceback (most recent call last):
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/qtpy/__init__.py", line 199, in <module>
from PySide import __version__ as PYSIDE_VERSION # analysis:ignore
ModuleNotFoundError: No module named 'PySide'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Users/xxxxx/Desktop/anaconda3/bin/anaconda-navigator", line 7, in <module>
from anaconda_navigator.app.main import main
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/anaconda_navigator/app/main.py", line 22, in <module>
from anaconda_navigator.utils.conda import is_conda_available
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/anaconda_navigator/utils/__init__.py", line 15, in <module>
from qtpy.QtGui import QIcon
File "/Users/xxxxx/Desktop/anaconda3/lib/python3.7/site-packages/qtpy/__init__.py", line 205, in <module>
raise PythonQtError('No Qt bindings could be found')
qtpy.PythonQtError: No Qt bindings could be found
I'm quite concerned, as my code was important for school and I can't access it. I tried installing it, but it said Anaconda was still downloaded, but it is nowhere to be found in my downloads or applications. Also, I ran the command to show my packages and they were still installed.

Cannot run anaconda

I just installed anaconda and I have udpated the PATH variable.
However, I cannot run any conda related commands.
Every time I run a command starting with "conda" I get the following error.
Can anyone help?
I am using macOs High Sierra 10.13.6.
Traceback (most recent call last):
File "/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 18, in <module>
from urllib.request import url2pathname
File "/anaconda3/lib/python3.6/urllib/request.py", line 2585, in <module>
from _scproxy import _get_proxy_settings, _get_proxies
ImportError: dlopen(/anaconda3/lib/python3.6/lib-dynload/_scproxy.cpython-36m-darwin.so, 2): Symbol not found: __cg_jpeg_resync_to_restart
Referenced from: /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
Expected in: /anaconda3/lib/libJPEG.dylib
in /System/Library/Frameworks/ImageIO.framework/Versions/A/ImageIO
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/anaconda3/bin/conda", line 11, in <module>
sys.exit(main())
File "/anaconda3/lib/python3.6/site-packages/conda/cli/main.py", line 112, in main
from ..exceptions import conda_exception_handler
File "/anaconda3/lib/python3.6/site-packages/conda/exceptions.py", line 18, in <module>
from .common.io import timeout
File "/anaconda3/lib/python3.6/site-packages/conda/common/io.py", line 24, in <module>
from .path import expand
File "/anaconda3/lib/python3.6/site-packages/conda/common/path.py", line 21, in <module>
from urllib import unquote, url2pathname # NOQA
ImportError: cannot import name 'unquote'
I seem to recall something similar when I first ran Anaconda on my Mac as well. I believe I solved it by doing two things:
Uninstalling Anaconda (Link)
Reinstalling Anaconda (potentially in a different location, say, under your User home)
I think in the process of installation my PATH pointed finally to a different location than the Conda/Python install.

"No module named zlib" error anytime I use pip

I'm using terminal on mac, and anytime I attempt to use pip, I get the following error message telling me that it cannot find a module named zlib:
$ pip --version
Traceback (most recent call last):
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py", line 27, in <module>
from . import urllib3
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/connectionpool.py", line 42, in <module>
from .response import HTTPResponse
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/urllib3/response.py", line 3, in <module>
import zlib
ModuleNotFoundError: No module named 'zlib'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.5/bin/pip", line 7, in <module>
from pip import main
File "/usr/local/lib/python3.6/site-packages/pip/__init__.py", line 21, in <module>
from pip._vendor.requests.packages.urllib3.exceptions import DependencyWarning
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/__init__.py", line 62, in <module>
from .packages.urllib3.exceptions import DependencyWarning
File "/usr/local/lib/python3.6/site-packages/pip/_vendor/requests/packages/__init__.py", line 29, in <module>
import urllib3
File "/usr/local/lib/python3.6/site-packages/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/usr/local/lib/python3.6/site-packages/urllib3/connectionpool.py", line 36, in <module>
from .response import HTTPResponse
File "/usr/local/lib/python3.6/site-packages/urllib3/response.py", line 3, in <module>
import zlib
ModuleNotFoundError: No module named 'zlib'
I've read several SO posts with the same error message, and have tried their solutions, including attempting to install zlib using homebrew, which fails, and updating my Xcode developer tools. I also installed pip earlier using python get-pip.py, and it said it installed successfully.
The reason I need pip is to install a package for use on python 2.7, but doing $ pip install "package-name" produces the same error as above. I have both Python 2 and 3 installed on my machine, if that helps. I'm kind of new to pip and using the command line in general, and I'm super confused; if anyone could help me out I'd really appreciate it.
This is the OP. I was able to fix the issue, and wanted to post my solution here in case it would help others.
Essentially I believe it occurred because Python2 is default on my machine, but pip is by default pointing to resources pertaining to Python3, or something like that. Doing pip2 --version instead provided the expected response.

Categories

Resources