problem launching Jupyter notebook or Jupyter lab anaconda - jupyter-notebook

I have a problem launching the Jupyter notebook on a remote Windows computer. running Jupyter from conda prompt returns WinError 1326 as below:
Traceback (most recent call last):
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 535, in get
value = obj._trait_values[self.name]
KeyError: 'runtime_dir'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "D:\Anaconda3\Scripts\jupyter-notebook-script.py", line 10, in <module>
sys.exit(main())
File "D:\Anaconda3\lib\site-packages\jupyter_core\application.py", line 254, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "D:\Anaconda3\lib\site-packages\traitlets\config\application.py", line 844, in launch_instance
app.initialize(argv)
File "D:\Anaconda3\lib\site-packages\traitlets\config\application.py", line 87, in inner
return method(app, *args, **kwargs)
File "D:\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 2127, in initialize
self.init_configurables()
File "D:\Anaconda3\lib\site-packages\notebook\notebookapp.py", line 1650, in init_configurables
connection_dir=self.runtime_dir,
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 575, in __get__
return self.get(obj, cls)
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 538, in get
default = obj.trait_defaults(self.name)
File "D:\Anaconda3\lib\site-packages\traitlets\traitlets.py", line 1578, in trait_defaults
return self._get_trait_default_generator(names[0])(self)
File "D:\Anaconda3\lib\site-packages\jupyter_core\application.py", line 85, in _runtime_dir_default
ensure_dir_exists(rd, mode=0o700)
File "D:\Anaconda3\lib\site-packages\jupyter_core\utils\__init__.py", line 11, in ensure_dir_exists
os.makedirs(path, mode=mode)
File "D:\Anaconda3\lib\os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "D:\Anaconda3\lib\os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "D:\Anaconda3\lib\os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
[Previous line repeated 3 more times]
File "D:\Anaconda3\lib\os.py", line 223, in makedirs
mkdir(name, mode)
OSError: [WinError 1326] Username or password is incorrect: 'MY_SERVER_ADDRESS'
I tried changing some values in config file but no luck! please help me fix this problem

This might help:->
steps include:->
1-open cmd
2-paste the path of your Jupyter folder
3-write "Jupyter notebook" and press enter you will redirect to Jupyter
4-still not working check your python path is configured or not and then go to step1,2,3:->
upvote if it's helpful
or
you can made another folder jupyter folder and then configure python
and install jupyter notebook and use above steps.

Related

Script compiled with pyinstaller is missing a .dll file, when the file is manually copied in the program's folder it just dies

I have a python script which is basically a graphic interface (pysimpleguy) to a mysql database.
I am working in python 3.8; my dependencies are:
PySimpleGUI 4.55.1
sqlalchemy 1.3.20
pymysql 1.0.2
pandas 1.1.3
regex 2020.10.15
pillow 8.0.1
The code works and I'd like to compile it to .exe to distribute it to users in my organization.
I tried to compile it with:
pyinstaller -D .\db_interface_v3.6.1_release.py --debug=imports
However, pyinstaller throws some errors when compiling:
201667 INFO: Building COLLECT COLLECT-00.toc
Traceback (most recent call last):
File "c:\users\spit\anaconda3\lib\runpy.py", line 194, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\spit\anaconda3\lib\runpy.py", line 87, in _run_code
exec(code, run_globals)
File "C:\Users\Spit\anaconda3\Scripts\pyinstaller.exe\__main__.py", line 7, in <module>
File "c:\users\spit\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 124, in run
run_build(pyi_config, spec_file, **vars(args))
File "c:\users\spit\anaconda3\lib\site-packages\PyInstaller\__main__.py", line 58, in run_build
PyInstaller.building.build_main.main(pyi_config, spec_file, **kwargs)
File "c:\users\spit\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 782, in main
build(specfile, kw.get('distpath'), kw.get('workpath'), kw.get('clean_build'))
File "c:\users\spit\anaconda3\lib\site-packages\PyInstaller\building\build_main.py", line 714, in build
exec(code, spec_namespace)
File "C:\Users\Spit\Desktop\DIPEx db parser\db_interface_v3.6.1_release.spec", line 37, in <module>
coll = COLLECT(exe,
File "c:\users\spit\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 818, in __init__
self.__postinit__()
File "c:\users\spit\anaconda3\lib\site-packages\PyInstaller\building\datastruct.py", line 155, in __postinit__
self.assemble()
File "c:\users\spit\anaconda3\lib\site-packages\PyInstaller\building\api.py", line 866, in assemble
shutil.copy(fnm, tofnm)
File "c:\users\spit\anaconda3\lib\shutil.py", line 415, in copy
copyfile(src, dst, follow_symlinks=follow_symlinks)
File "c:\users\spit\anaconda3\lib\shutil.py", line 261, in copyfile
with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
FileNotFoundError: [Errno 2] No such file or directory: 'C:\\Users\\Spit\\Desktop\\DIPEx db parser\\dist\\db_interface_v3.6.1_release\\share\\jupyter\\lab\\staging\\node_modules\\.cache\\terser-webpack-p
lugin\\content-v2\\sha512\\2e\\ba\\cfce62ec1f408830c0335f2b46219d58ee5b068473e7328690e542d2f92f2058865c600d845a2e404e282645529eb0322aa4429a84e189eb6b58c1b97c1a'
If I try to run the compiled exe, I get an error regarding a specific .dll:
INTEL MKL ERROR: Impossibile trovare il modulo specificato. mkl_intel_thread.dll.
Intel MKL FATAL ERROR: Cannot load mkl_intel_thread.dll.
If I take this missing .dll from my Anaconda environment and copy it into the program's folder, when I try to run the .exe again it just dies without further messages:
import 'numpy.ma' # <pyimod03_importers.FrozenImporter object at 0x000001F6A455BEE0>
PS C:\Users\Spit\Desktop\DIPEx db parser\dist\db_interface_v3.6.1_release>
Any idea on how to sort it out?
Thanks!
Sorted out. As a future reference if someone stumbles upon this question, the error is caused by Windows' PATH_MAX limitation, preventing pyinstaller to find all the necessary files.
In order to disable said limitation: https://learn.microsoft.com/en-us/windows/win32/fileio/maximum-file-path-limitation?tabs=cmd
Kudos to https://github.com/bwoodsend

jupyter notebook list error after drive ran out of room

another user on my ubuntu server was trying to install anaconda in their home directory. they downloaded anaconda to their home directory and installed it, and it took up all remaining room for users on the server. So my user who is a different user, in a different home directory could no longer run jupyter notebook and I got a dead kernel error. After moving their copy of anaconda from the their home directory to a different drive with more room, I am now able to again launch and run jupyter notebooks with my user, but I'm now getting the error below when I try to check for running notebook servers and get the token. Does anyone know what the issue might be and can you suggest how to fix? Again this was another user installing anaconda in their home directory. I'm confused why that would effect my user with a completely different home directory, except that we ran out of room on the drive momentarily.
code:
jupyter notebook list
error:
Traceback (most recent call last):
File "/home/user/anaconda3/bin/jupyter-notebook", line 11, in <module>
sys.exit(main())
File "/home/user/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 254, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/home/user/anaconda3/lib/python3.7/site-packages/traitlets/config/application.py", line 845, in launch_instance
app.start()
File "/home/user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 2288, in start
super().start()
File "/home/user/anaconda3/lib/python3.7/site-packages/jupyter_core/application.py", line 243, in start
self.subapp.start()
File "/home/user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 596, in start
serverinfo_list = list(list_running_servers(self.runtime_dir))
File "/home/user/anaconda3/lib/python3.7/site-packages/notebook/notebookapp.py", line 2388, in list_running_servers
info = json.load(f)
File "/home/user/anaconda3/lib/python3.7/json/__init__.py", line 296, in load
parse_constant=parse_constant, object_pairs_hook=object_pairs_hook, **kw)
File "/home/user/anaconda3/lib/python3.7/json/__init__.py", line 348, in loads
return _default_decoder.decode(s)
File "/home/user/anaconda3/lib/python3.7/json/decoder.py", line 337, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/home/user/anaconda3/lib/python3.7/json/decoder.py", line 355, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
I was able to solve the issue by going to the directory
/home/user/.local/share/jupyter/runtime
and deleting files with names like
nbserver-xxxx.json
that were empty. After that jupyter notebook list worked fine.

importlib.metadata.PackageNotFoundError: regex while building an .exe with pyinstaller

I am trying to build an executable with pyinstaller and I am getting the following errors:
Traceback (most recent call last):
File "transformers/utils/versions.py", line 105, in require_version
File "importlib/metadata.py", line 551, in version
File "importlib/metadata.py", line 524, in distribution
File "importlib/metadata.py", line 187, in from_name
importlib.metadata.PackageNotFoundError: regex
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "chatbot2.py", line 8, in <module>
File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
File "transformers/__init__.py", line 43, in <module>
File "PyInstaller/loader/pyimod03_importers.py", line 546, in exec_module
File "transformers/dependency_versions_check.py", line 41, in <module>
File "transformers/utils/versions.py", line 120, in require_version_core
File "transformers/utils/versions.py", line 107, in require_version
importlib.metadata.PackageNotFoundError: The 'regex!=2019.12.17' distribution was not found and is required by this application.
Try: pip install transformers -U or pip install -e '.[dev]' if you're working with git master
[30391] Failed to execute script 'chatbot2' due to unhandled exception!
I am using PyInstaller version 5.0.dev0 and Python version 3.9.1.
I tried pip3.9 install transformers, pip3.9 install regex, I tried adding hooks hook-regex.py and hook-transformers.py.
I would really appreciate any suggestions! Thank you!

Jupyter path error when on different server with mapped home directory

I work on two servers, serverA and serverB. On both of them, my home directory is mapped to the same location. Other than the home directory, the servers have independent file systems. This includes system directories and application directories. So, I created a special .bashrc_serverb file that is sourced if my hostname is serverB. This resets my path.
balter#serverB:~$ echo $PATH
/mnt/scratch/miniconda3/bin:/bin:/usr/local/bin:/usr/bin
I first installed conda and jupyter while logged in to serverA. Apparently it created a file ~/.local/share/jupyter/kernels/python3. I also installed conda and jupyter on serverB. Now when I try to run jupyter notebook or jupyter-console on serverB, I get:
```
balter#serverB:~$ jupyter-console
[ZMQTerminalIPythonApp] ERROR | Failed to run command:
['/home/...miniconda3/bin/python', '-m', 'ipykernel', '-f', '/home/users/balter/.local/share/jupyter/runtime/kernel-26741.json']
PATH='/mnt/scratch/miniconda3/bin:/bin:/usr/local/bin:/usr/bin'
with kwargs:
{'stdin': -1, 'cwd': None, 'start_new_session': True, 'stdout': None, 'stderr': None}
Traceback (most recent call last):
File "/mnt/scratch/miniconda3/bin/jupyter-console", line 5, in
app.main()
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_core/application.py", line 267, in launch_instance
return super(JupyterApp, cls).launch_instance(argv=argv, **kwargs)
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 657, in launch_instance
app.initialize(argv)
File "", line 2, in initialize
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/traitlets/config/application.py", line 87, in catch_config_error
return method(app, *args, **kwargs)
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_console/app.py", line 141, in initialize
self.init_shell()
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_console/app.py", line 109, in init_shell
JupyterConsoleApp.initialize(self)
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_client/consoleapp.py", line 334, in initialize
self.init_kernel_manager()
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_client/consoleapp.py", line 288, in init_kernel_manager
self.kernel_manager.start_kernel(**kwargs)
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_client/manager.py", line 243, in start_kernel
**kw)
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_client/manager.py", line 189, in _launch_kernel
return launch_kernel(kernel_cmd, **kw)
File "/mnt/scratch/miniconda3/lib/python3.5/site-packages/jupyter_client/launcher.py", line 123, in launch_kernel
proc = Popen(cmd, **kwargs)
File "/mnt/scratch/miniconda3/lib/python3.5/subprocess.py", line 947, in init
restore_signals, start_new_session)
File "/mnt/scratch/miniconda3/lib/python3.5/subprocess.py", line 1551, in _execute_child
raise child_exception_type(errno_num, err_msg)
FileNotFoundError: [Errno 2] No such file or directory: '/home/...miniconda3/bin/python'
```
The last line is the crucial one. That path is on serverA (full path obscured for security).
What is the fix for this?
Cross-posted as jupyter issue.

Plone 4 buildout error

Does anyone know how I can fix this error that I get when I do a buildout?
An internal error occurred due to a bug in either zc.buildout or in a
recipe being used:
Traceback (most recent call last):
File "/usr/local/Plone/buildout-cache/eggs/zc.buildout-1.7.1-py2.7.egg/zc/buildout/buildout.py", line 1866, in main
getattr(buildout, command)(args)
File "/usr/local/Plone/buildout-cache/eggs/zc.buildout-1.7.1-py2.7.egg/zc/buildout/buildout.py", line 625, in install
installed_files = self[part]._call(recipe.install)
File "/usr/local/Plone/buildout-cache/eggs/zc.buildout-1.7.1-py2.7.egg/zc/buildout/buildout.py", line 1345, in _call
return f()
File "/usr/local/Plone/buildout-cache/eggs/plone.recipe.precompiler-0.6-py2.7.egg/plone/recipe/precompiler/__init__.py", line 29, in install
return self._run()
File "/usr/local/Plone/buildout-cache/eggs/plone.recipe.precompiler-0.6-py2.7.egg/plone/recipe/precompiler/__init__.py", line 35, in _run
self._compile_eggs()
File "/usr/local/Plone/buildout-cache/eggs/plone.recipe.precompiler-0.6-py2.7.egg/plone/recipe/precompiler/__init__.py", line 67, in _compile_eggs
py_compile.compile(fn, None, None, True)
File "/usr/lib/python2.7/py_compile.py", line 123, in compile
with open(cfile, 'wb') as fc:
IOError: [Errno 13] Permission denied: '/usr/local/Plone/zeocluster/products/MyScriptModules/__init__.pyc'
Remove the file that causes the problem. which is:
/usr/local/Plone/zeocluster/products/MyScriptModules/__init__.pyc
Then re-run buildout as the user that removed the above file.

Resources