Jupyter on Anaconada on OSX, cells not showing results in browser - python

Opening Jupyter 6.0.2 from Anaconda Navigator 1.9.12, on OSX 10.13.6, Cells in notebooks on "run cell", do not show results.
It seems the standard output of a cell upon running can not be returned to the notebook in the browser to be displayed.
This seems a small technical issue, but after many several hours and days, I can not resolve.
Experience of this behaviour first comes with downloading a workbook (scipy_con_2019-master.zip, open Jupyter notebook "2_Gaussian_HMM_INSTRUCTOR.ipynb" ).
Upon opening, this initially shows results below the various code cells. Working through from the beginning using run (Run Cell), as each cell is calculated the results disappear. They are no longer shown. Thus preventing play, adaption, explore, learning.
To remove the possibility this behaviour is something to do with the downloaded notebooks, I created a new notebook with basic cell contents with simple commands like:
a=10
print(a)
or something as simple as
2*3
Upon run, same behaviour. No answer is returned for display below the code cell.
I note the integer number in brackets on far left does increase by 1 with each use of Run (run cell).
A full "stop kernal" and re-run all cells from the beginning, simply enforces behaviour to all cells in the downloaded notebook. That is, all results in the downloaded notebook all disappear.
Noting this behaviour is consistent to a downloaded notebook and a new created notebook, I suspect it is local settings, or conflict or set up issue.
As part of problem solving:
• I have ensured downloaded notebooks are identified as "trusted", and then re-opened and begun again. This makes no difference.
• This behaviour is with a full fresh download of Anaconda in the weeks before, around 20 May 2021. (Done in view of Navigator application would not complete an update as it requested. Full reinstall to update.)
• Is this a browser issue? Using Safari or Firefox as browser makes no difference to this behaviour.
• Search of key words, and key fault line in terminal, on Google search, or stack overflow or Superuser were not successful in finding a relatable solution.
Looking in terminal opened for each Jupyter session, I get the following identified error consistently, hence I think this is helpful to resolve the source of this issue, though beyond my limited coding knowledge to interpret and resolve the issue.
Traceback (most recent call last):
File "/anaconda3/lib/python3.7/site-packages/tornado/websocket.py", line 546, in run_callback
result = callback(*args, **kwargs)
File "/anaconda3/lib/python3.7/site-packages/notebook/services/kernels/handlers.py", line 274, in open
self.create_stream()
File "/anaconda3/lib/python3.7/site-packages/notebook/services/kernels/handlers.py", line 127, in create_stream
meth = getattr(km, 'connect' + channel)
AttributeError: 'MappingKernelManager' object has no attribute 'connect_control'
I am wondering if the issue relates to permissions or an incompatable component, or possibly arising in view of security upgrades in Jupyter (those pages read to seek answer to this). It seems the standard output of a cell upon running can not be returned to the notebook in the browser to be displayed.
I have posted this issue first on the ContinuumIO/anaconda - issues git hub page: here however I do not think this site is very active.

Solution was to download the recent newer release: Anaconda3-2021.05-MacOSX-x86_64.pkg once again.
Install initially failed. Then seemed to work, as in files were copied, then advised install had failed.
I noted an older master Anaconda file on the HD (highest level on HD) had not been updated since 2018. Hence, clearly this was not being updated by the recent installation process.
Deleted that Anaconda folder.
Then the install of the latest release did work.
It was not immediately easy to find where the new Anaconda files were installed.
The new installation was in the OSX User account folder, in a folder called "opt".
Now 1+1 shows the answer in a Jupyter file. Joy.

Related

My cell output in VSCode when running a Jupyter Notebook are all gray and I can't fix it

I was coding in VSC using Jupyter and I dropped my phone on my keyboard and all of my cells became gray. I'm not sure how to fix it.
I don't know if my file size is too big, or If there are too many plotly graphics in my notebook, but I can't find a way to fix it.
I've tried re-installing the regular/stable version of VSC, installing VSC-Insiders, clearing my cache (I believe I did this correctly via stack posts).
Here's a screenshot of what I am seeing:
I've attempted to force quit the application (insider and base VSC) and it still occurrs.
Generally, the output box will be grayed out only when your jupyter cache is large.
According to this issue on github, the easiest to get out of this is to delete the Cache folder.
Windows %APPDATA%\Code - Insiders\Code Cache
macOS $HOME/Library/Application Support/Code - Insiders/Code Cache
Linux $HOME/.config/Code - Insiders/Code Cache
You can also try to clear output.

StyleGan3. The program hangs on Setting up PyTorch plugin “filtered_lrelu_plugin”

I use StyleGan3 from this repository GitHub - NVlabs/stylegan3: Official PyTorch implementation of StyleGAN3. I had everything working fine, but at some point, I interrupted the program without letting it finish. And now I’m facing the fact that the program hangs on Setting up PyTorch plugin "filtered_lrelu_plugin"... and nothing else happens. This happens both when trying to generate new images with gen_images.py and when trying to open the visualizer. In this case, visualizer opens but hangs with Loading and then the name of the network file. First I reinstalled torch and all related packages, then I replaced all the stylegan3 files with the ones downloaded from the repository. This didn’t help. So I completely deleted the virtual environment and re-created it by downloading and installing all the required modules. But the behavior has not changed.
Windows 10

Process finished with exit code -805306369 (0xCFFFFFFF) [duplicate]

I'm running a python script and it used to work (it even does on my other laptop right now) but not on my current computer - I just get the error code:
Process finished with exit code -1073741515 (0xC0000135)
I don't get any other results - not even from "print" commands at the beginning of the file.
I haven't found anything specific to that.
I re-installed python (2.7.9), pygame (1.9.1) and even pycharm (tried 4.5 first, now with 5.0 - same result)
Does anyone know what that error code means? I couldn't find anything about it.
reinstall python – you don't have python33.dll in c:\WINDOWS\system32\
Maybe you have different python versions – look at folders in root of c:
If yes, then point to your version of python.exe in pyCharm > Settings > Project Interpreter
This may be due to another program locking that memory location.
Before you try more drastic measures, know that restarting the computer fixed the problem for me.
The error seems to be related to issues in native code (e.g. C/C++) and might be related to issues in loading some dll file. To know which file, the Windows "Event Viewer" is your friend.
The "Event Viewer" -> "Windows Logs" -> "Application" feed usually shows one or more rows for each crashed application and one of them should list the problematic filename.
Personally I observed similar issue with matplotlib on Python 3.9 (installed using Anaconda on Windows 10). I could see this kind of error when the code was executed using PyCharm. The same code just crashed with no visible errors when starting from Anaconda console.
The Event viewer then showed issue with freetype.dll. In this case, the problem was fixed by downgrading the packege from 2.11.0 to 2.10.4:
conda install freetype=2.10.4
Depending on the exact issue, I could imagine that removing pycache folder might help (like mentioned in other answers). Also, sometimes it might make sense to look at the PATH environment variable to actually understand why certain dll file is loaded from such a location.
I got this error in PyCharm after upgrading pyarrow to the most recent version -- 0.16 --- using pip, running the same code I had ran before this update which used pandas read_parquet specifying the engine="pyarrow" triggering use of this library. After uninstalling and installing the previous version with
pip install pyarrow=="0.15"
the problem resolved.
I encountered the same error when running .py in PyCharm on Windows. Inspired by https://thenewboston.com/forum/topic.php?id=10088, I uninstalled and reinstalled Python. When reinstalling, I checked the ADD PYTHON TO THE PATH Option. After recreating the virtual environment in PyCharm, the error was gone.
Update: On another Windows PC (64-bit), I encountered the same error where reinstalling Python was not enough. I tried two things.
Uninstalling 32-bit Python and installing 64-bit Python. Namely downloading python-3.6.4-amd64.exe instead of python-3.6.4.exe
Recreating the Pycharm project from github.
Between the two actions, the error was gone.
taskkill /F /IM python.exe
Try this if it just happened out of the bloom and it worked normally before that error occurred.
I solved it by disabling "PyQt compatible" checkbox in the Settings under Build, Execution, Deployment --> Python Debugger.
After that, it should debug properly.
Here is caused it and solution:
The computer had two physical processors. The code uses Numba for parallel computations. Upon disabling and re-enabling hyperthreading this issue started. To solve it clear pycache folder and run the program.
I encountered this error in my code as well, in my case the problem was sharing pickle which produced in Unix machine one a Windows one.
**I faced the same situation and the malfunction stems from trying to run both terminal processor and graphical user interfaces. When I clicked the button program stopped running **
Solution: I disabled terminal inputs and work with graphics.
For example:
if you do this
entry1=Entry(root,width=10).pack()
variable= str(input("Whats your name?"))
You will see the error.
if you delete either entry1 or variable, you will not see the problem.
If you're trying create a .svm use dlib probably the problem is in .xml, some image that you use is cause the problem. Try to create a new .xml putting out a image(any image) or remove that your .xml and test, try this even you find out the image problem.
For exemple, the image "treinamento3.jpg" was the problem. I removed this command line:
< image file='delirium\treinamento3.jpg'>
< box top='213' left='86' width='46' height='49'/ >
< box top='531' left='47' width='125' height='123'/ >
< /image >
from my .xml for solve my problem.

Process finished with exit code -1073741515 (0xC0000135)

I'm running a python script and it used to work (it even does on my other laptop right now) but not on my current computer - I just get the error code:
Process finished with exit code -1073741515 (0xC0000135)
I don't get any other results - not even from "print" commands at the beginning of the file.
I haven't found anything specific to that.
I re-installed python (2.7.9), pygame (1.9.1) and even pycharm (tried 4.5 first, now with 5.0 - same result)
Does anyone know what that error code means? I couldn't find anything about it.
reinstall python – you don't have python33.dll in c:\WINDOWS\system32\
Maybe you have different python versions – look at folders in root of c:
If yes, then point to your version of python.exe in pyCharm > Settings > Project Interpreter
This may be due to another program locking that memory location.
Before you try more drastic measures, know that restarting the computer fixed the problem for me.
The error seems to be related to issues in native code (e.g. C/C++) and might be related to issues in loading some dll file. To know which file, the Windows "Event Viewer" is your friend.
The "Event Viewer" -> "Windows Logs" -> "Application" feed usually shows one or more rows for each crashed application and one of them should list the problematic filename.
Personally I observed similar issue with matplotlib on Python 3.9 (installed using Anaconda on Windows 10). I could see this kind of error when the code was executed using PyCharm. The same code just crashed with no visible errors when starting from Anaconda console.
The Event viewer then showed issue with freetype.dll. In this case, the problem was fixed by downgrading the packege from 2.11.0 to 2.10.4:
conda install freetype=2.10.4
Depending on the exact issue, I could imagine that removing pycache folder might help (like mentioned in other answers). Also, sometimes it might make sense to look at the PATH environment variable to actually understand why certain dll file is loaded from such a location.
I got this error in PyCharm after upgrading pyarrow to the most recent version -- 0.16 --- using pip, running the same code I had ran before this update which used pandas read_parquet specifying the engine="pyarrow" triggering use of this library. After uninstalling and installing the previous version with
pip install pyarrow=="0.15"
the problem resolved.
I encountered the same error when running .py in PyCharm on Windows. Inspired by https://thenewboston.com/forum/topic.php?id=10088, I uninstalled and reinstalled Python. When reinstalling, I checked the ADD PYTHON TO THE PATH Option. After recreating the virtual environment in PyCharm, the error was gone.
Update: On another Windows PC (64-bit), I encountered the same error where reinstalling Python was not enough. I tried two things.
Uninstalling 32-bit Python and installing 64-bit Python. Namely downloading python-3.6.4-amd64.exe instead of python-3.6.4.exe
Recreating the Pycharm project from github.
Between the two actions, the error was gone.
taskkill /F /IM python.exe
Try this if it just happened out of the bloom and it worked normally before that error occurred.
I solved it by disabling "PyQt compatible" checkbox in the Settings under Build, Execution, Deployment --> Python Debugger.
After that, it should debug properly.
Here is caused it and solution:
The computer had two physical processors. The code uses Numba for parallel computations. Upon disabling and re-enabling hyperthreading this issue started. To solve it clear pycache folder and run the program.
I encountered this error in my code as well, in my case the problem was sharing pickle which produced in Unix machine one a Windows one.
**I faced the same situation and the malfunction stems from trying to run both terminal processor and graphical user interfaces. When I clicked the button program stopped running **
Solution: I disabled terminal inputs and work with graphics.
For example:
if you do this
entry1=Entry(root,width=10).pack()
variable= str(input("Whats your name?"))
You will see the error.
if you delete either entry1 or variable, you will not see the problem.
If you're trying create a .svm use dlib probably the problem is in .xml, some image that you use is cause the problem. Try to create a new .xml putting out a image(any image) or remove that your .xml and test, try this even you find out the image problem.
For exemple, the image "treinamento3.jpg" was the problem. I removed this command line:
< image file='delirium\treinamento3.jpg'>
< box top='213' left='86' width='46' height='49'/ >
< box top='531' left='47' width='125' height='123'/ >
< /image >
from my .xml for solve my problem.

History saving thread error when trying to open Pandas

I just installed IPython on a remote desktop at work. I had to create a shortcut on my desktop to connect to IPython because the remote desktop does not have internet access. I am able to successfully open the IPython notebook. However, when I try to import pandas
import pandas as pd
I get this error that I have never seen before
The history saving thread hit an unexpected error (OperationalError('database or disk is full',)).History will not be written to the database.
Does this error relate to how it was installed on the remote desktop?
I suffered from this problem for a long time. My dirty fix was to simply restart the kernel and go about my work. However, I did find a way which eliminated it for good. This question seems to have mixed answers for different users. I'll try to list all based on answers elsewhere (all links at the end).
So the issue seems to be because of a certain nbsignatures.db file. And we need to simply remove it to solve the issue. You may find the file here in any one of the locations:
~/.local/share/jupyter/nbsignatures.db (I found mine here)
~/.ipython/profile_default/security/nbsignatures.db
~/Library/Jupyter/nbsignatures.db
All links:
https://github.com/ipython/ipython/issues/9293
IPython Notebook error: Error loading notebook

Categories

Resources