Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Crash Report - Mu incompatible with old version of jupyter-client #1516

Closed
LionSoft91 opened this issue Apr 28, 2021 · 8 comments
Closed

Crash Report - Mu incompatible with old version of jupyter-client #1516

LionSoft91 opened this issue Apr 28, 2021 · 8 comments

Comments

@LionSoft91
Copy link

LionSoft91 commented Apr 28, 2021

Hello,

When i try to use REPL on MU (On Raspberry Pi OS), it causes this crash.

mu.log
Version: 1.1.0.beta.4
Locale: en_US
Platform: Linux 5.10.17-v7l+ #1403 SMP Mon Feb 22 11:33:35 GMT 2021 armv7l
mu.log

Traceback (most recent call last):
  File "/home/pi/.local/lib/python3.7/site-packages/mu/modes/python3.py", line 109, in start_kernel
    self.repl_kernel_manager.start_kernel()
  File "/home/pi/.local/lib/python3.7/site-packages/mu/modes/python3.py", line 42, in start_kernel
    kernel_cmd, kw = self.pre_start_kernel(**kw)
AttributeError: 'MuKernelManager' object has no attribute 'pre_start_kernel'

@carlosperate
Copy link
Member

Thanks for the report @LionSoft91, this might be related to #1444.

Could you run this command (with the same pip command you've used to install Mu) in the terminal and copy/paste the result here?

pip3 list

@LionSoft91
Copy link
Author

This is what I got by using the command :

Package                  Version    
------------------------ -----------
adafruit-board-toolkit   1.0.1      
appdirs                  1.4.3      
asn1crypto               0.24.0     
astroid                  2.1.0      
asttokens                1.1.13     
automationhat            0.2.0      
beautifulsoup4           4.7.1      
black                    21.4b1     
blinker                  1.4        
blinkt                   0.1.2      
buttonshim               0.0.2      
cachetools               4.2.2      
Cap1xxx                  0.1.3      
certifi                  2018.8.24  
chardet                  3.0.4      
click                    7.1.2      
colorama                 0.3.7      
colorzero                1.1        
cookies                  2.2.1      
cryptography             2.6.1      
cupshelpers              1.0        
cycler                   0.10.0     
decorator                4.3.0      
distlib                  0.3.1      
docutils                 0.14       
drumhat                  0.1.0      
entrypoints              0.3        
envirophat               1.0.0      
et-xmlfile               1.1.0      
ExplorerHAT              0.4.2      
EZGmail                  2021.2.4   
EZSheets                 2020.10.10 
filelock                 3.0.12     
flake8                   3.9.1      
Flask                    1.0.2      
fourletterphat           0.1.0      
google-api-core          1.26.3     
google-api-python-client 2.2.0      
google-auth              1.30.0     
google-auth-httplib2     0.1.0      
google-auth-oauthlib     0.4.4      
googleapis-common-protos 1.53.0     
gpiozero                 1.5.1      
guizero                  0.6.0      
html5lib                 1.0.1      
httplib2                 0.19.1     
idna                     2.6        
IMAPClient               2.1.0      
importlib-metadata       4.0.1      
ipykernel                4.9.0      
ipython                  5.8.0      
ipython-genutils         0.2.0      
isort                    4.3.4      
itsdangerous             0.24       
jdcal                    1.4.1      
jedi                     0.13.2     
Jinja2                   2.10       
jupyter-client           5.2.3      
jupyter-core             4.4.0      
keyring                  17.1.1     
keyrings.alt             3.1.1      
kiwisolver               1.0.1      
lazy-object-proxy        1.3.1      
logilab-common           1.4.2      
lxml                     4.3.2      
MarkupSafe               1.1.0      
matplotlib               3.0.2      
mccabe                   0.6.1      
microdotphat             0.2.1      
mote                     0.0.4      
motephat                 0.0.3      
MouseInfo                0.1.3      
mu-editor                1.1.0b4    
mypy                     0.670      
mypy-extensions          0.4.3      
nudatus                  0.0.4      
numpy                    1.16.2     
oauth2client             4.1.3      
oauthlib                 2.1.0      
olefile                  0.46       
openpyxl                 2.6.1      
packaging                20.9       
pantilthat               0.0.7      
parso                    0.3.1      
pathspec                 0.8.1      
pexpect                  4.6.0      
pgzero                   1.2        
phatbeat                 0.1.1      
pianohat                 0.1.0      
picamera                 1.13       
pickleshare              0.7.5      
picraft                  1.0        
piglow                   1.2.5      
pigpio                   1.78       
Pillow                   6.0.0      
pip                      18.1       
prompt-toolkit           1.0.15     
protobuf                 3.15.8     
psutil                   5.5.1      
pyasn1                   0.4.8      
pyasn1-modules           0.2.8      
PyAutoGUI                0.9.52     
pycairo                  1.16.2     
pycodestyle              2.7.0      
pycrypto                 2.6.1      
pycups                   1.9.73     
pyflakes                 2.3.1      
pygame                   1.9.4.post1
PyGetWindow              0.0.9      
Pygments                 2.3.1      
PyGObject                3.30.4     
pyinotify                0.9.6      
PyJWT                    1.7.1      
pylint                   2.2.2      
PyMsgBox                 1.0.9      
pyOpenSSL                19.0.0     
pyparsing                2.4.7      
PyPDF2                   1.26.0     
pyperclip                1.8.2      
PyRect                   0.1.4      
PyScreeze                0.1.27     
pyserial                 3.5        
pysmbc                   1.0.15.6   
python-apt               1.8.4.3    
python-dateutil          2.7.3      
python-docx              0.8.10     
python3-xlib             0.15       
PyTweening               1.0.3      
pytz                     2021.1     
pyxdg                    0.25       
pyzmail36                1.0.4      
pyzmq                    17.1.2     
qtconsole                4.7.7      
QtPy                     1.9.0      
rainbowhat               0.1.0      
regex                    2021.4.4   
reportlab                3.5.13     
requests                 2.21.0     
requests-oauthlib        1.0.0      
responses                0.9.0      
roman                    2.0.0      
RPi.GPIO                 0.7.0      
rsa                      4.7.2      
RTIMULib                 7.2.1      
scrollphat               0.0.7      
scrollphathd             1.2.1      
SecretStorage            2.3.1      
selenium                 3.141.0    
semver                   2.13.0     
Send2Trash               1.5.0      
sense-emu                1.1        
sense-hat                2.2.0      
setuptools               40.8.0     
shortcut                 0.0.2      
simplegeneric            0.8.1      
simplejson               3.16.0     
six                      1.15.0     
skywriter                0.0.7      
sn3218                   1.2.7      
soupsieve                1.8        
spidev                   3.4        
ssh-import-id            5.7        
thonny                   3.3.6      
toml                     0.10.2     
tornado                  5.1.1      
touchphat                0.0.1      
traitlets                4.3.2      
twilio                   6.57.0     
twython                  3.7.0      
typed-ast                1.4.3      
typing-extensions        3.7.4.3    
uflash                   1.2.4      
unicornhathd             0.0.4      
uritemplate              3.0.1      
urllib3                  1.24.1     
virtualenv               20.4.4     
wcwidth                  0.1.7      
webencodings             0.5.1      
Werkzeug                 0.14.1     
wheel                    0.32.3     
wrapt                    1.10.11    
zipp                     3.4.1  

@carlosperate
Copy link
Member

carlosperate commented Apr 28, 2021

Thanks @LionSoft91, that was really useful!

Ultimately it looks like in PR #1240 we started using a jupyter_client method (KernelManager.pre_start_kernel()) introduced in v6.1.0, which we are not enforcing in our install_requires.

I'll raise a PR to fix this.


Edit: PR #1517 raise

@LionSoft91
Copy link
Author

Thanks @carlosperate for your feedback.

Do you know an alternative solution to use REPL because I started to learn python following a book called "AUTOMATE THE BORING STUFF WITH PYTHON, 2ND EDITION Practical Programming for Total Beginners" by "AL SWEIGART" and it uses REPL on MU.

@carlosperate
Copy link
Member

The easiest way to fix this would be to update the jupyter_client package to a newer version. However, since the reason you have an old version is because some other application in your computer is using it, there is a risk that updating it could cause issues in that other application.

You can install Mu in a virtual environment, this isolates the Mu installation, so that its dependencies are not combined with the system packages.
The main inconvenience from using a virtual environment is that it has to be "installed" somewhere (a folder where all the dependencies are stored), and then every time you want to use Mu you'll have to "activate" it.

These are the steps:

  1. In a terminal, navigate to a directory where you want to install the virtual environment
  2. Run this to create the virtual environment in a folder named mu-venv: virtualenv --python=python3 mu-venv
  3. Run this to activate it: source mu-venv/bin/activate
  4. Run this to install Mu in the virtual environment: pip install mu-editor==1.1.0b4
  5. Run Mu from the virtual environment: mu-editor

Every time you want to run Mu you'd have to do steps 1, 3, and 5 (2 and 4 are only required to install it).

Alternatively I like to use the pipx tool: https://pipxproject.github.io/pipx/
If you install it you can then use pipx to automatically install Python applications in their own isolated virtual environment, and they can be run without manually activating the environment:

  • Install pipx
    • Update pip: python3 -m pip install --upgrade pip
    • Run: python3 -m pip install --user pipx
    • Run: python3 -m pipx ensurepath
  • After installation you might need to close all your terminals and open a new one (or maybe even reboot, the last command should print out information)
  • Now that is pipx is installed and configured you can use it to install Mu: pipx install mu-editor==1.1.0b4
  • And you can run mu: mu-editor

@carlosperate carlosperate changed the title Crash Report Crash Report - Mu incompatible with old version of jupyter-client Apr 28, 2021
@carlosperate
Copy link
Member

Hi @LionSoft91, I was wondering if you managed to resolve this issue?

@LionSoft91
Copy link
Author

Hi @LionSoft91, I was wondering if you managed to resolve this issue?

Hello,
Yes, it resolved with the update.
Thank you.

@carlosperate
Copy link
Member

That's great, thanks for the update!
In that case I'll close this issue, thanks for all the testing and please don't hesitate to open another issue if you find any other problems 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants