These are chat archives for ipython/ipython

18th
Apr 2016
epifanio
@epifanio
Apr 18 2016 12:16

I guess this is a problem with my local installation:

----> 8 from IPython.html import widgets
      9 from IPython.html.widgets.interaction import _widget_from_abbrev
     10 from IPython.utils.traitlets import link

ImportError: bad magic number in 'IPython.html': b'\x03\xf3\r\n’

Have you any clue what I’m missing? ()i’m using master for all the dependencies.

Min RK
@minrk
Apr 18 2016 12:24
Bad magic number is usually loading a bytecompiled file from the wrong version of Python.
Not sure how to do that on purpose, though.
IPython.html's been deprecated since 4.0
epifanio
@epifanio
Apr 18 2016 12:25
thanks @minrk i thinking to do some clean up, removing all the old 4.* installation and related dependencies. Then reinstall. This should fix.
good to know it comes from 4.*
Min RK
@minrk
Apr 18 2016 12:30
Oh, I may know: IPython.html was a package (directory) in 3.x, it's a module (.py file) in 4.x. If you have leftover files after an upgrade, it could get confused.
epifanio
@epifanio
Apr 18 2016 12:44
I think I found the problem, lot’s of stuff went into ~.local/ and it is in conflict with system python and conda ..
epifanio @epifanio goes in a late spring-cleaning mood
epifanio
@epifanio
Apr 18 2016 14:02
@minrk I think I removed all the old files related to python and jupiter, leaving my system “clean"
but I still have the same log
Min RK
@minrk
Apr 18 2016 14:03
Do you have PYTHONPATH set?
epifanio
@epifanio
Apr 18 2016 14:03
no it is empty
Min RK
@minrk
Apr 18 2016 14:03
How are you installing?
And where is IPython.html?
And why are you importing IPython.html?
epifanio
@epifanio
Apr 18 2016 14:04
cd in the ipython directory (master clone from git) then: pip install -U .
I tried with: from IPython.html import widgets
which return:
ImportErrorTraceback (most recent call last)
<ipython-input-2-d48178787f08> in <module>()
----> 1 from IPython.html import widgets

ImportError: bad magic number in 'IPython.html': b'\x03\xf3\r\n’
Min RK
@minrk
Apr 18 2016 14:05
What about just import IPython.html; print(IPython.html)
or just IPython.__file__
Min RK
@minrk
Apr 18 2016 14:07
Ah, so you aren't doing a full install, you are doing a dev-install (pip install -e .)
epifanio
@epifanio
Apr 18 2016 14:08
i tried both, yes .. with and without -e
maybe my clone is old .. and it is keeping old files
i’ll try removing my ipython src code and do a fresh clone
Min RK
@minrk
Apr 18 2016 14:09
Try: git clean -xfd in ~/dev/ipython, to remove all files not tracked by git (backup if you have any files in there that you want to keep)
epifanio
@epifanio
Apr 18 2016 14:12
oh seems that this worked and put me a step ahead .. the following log is becouse my “spring-cleaning” i guess: https://gist.github.com/447e693878b90635467b77cada91c918
the git clean command seemed to work!
thanks!
epifanio
@epifanio
Apr 18 2016 14:36
almost there, I installed jupyter and now the notebook but i got: (npm error) https://gist.github.com/84b9a170ed6d60611f2aab835631c1e0
I’ran the command with the sudo prefix, but it still fail, i’ll use sudo npm dedupe to see if it fix the error
epifanio
@epifanio
Apr 18 2016 14:43
nope
didn’t worked, neither logging as root … http://paste.debian.net/439170/
seems a problem with phosphor-dragdrop
Steven Silvester
@blink1073
Apr 18 2016 15:02
@epifanio, do you have access to change the permissions of node? https://docs.npmjs.com/getting-started/fixing-npm-permissions
epifanio
@epifanio
Apr 18 2016 15:03
thanks @blink1073 following the instructions
epifanio
@epifanio
Apr 18 2016 15:12
@blink1073 no luck, I admit it is a bit confusing .. running any command via sudo should not have permission issues
I tried to follow the instruction using both my standard user and logged in as root
logged in as root, I still had to use sudo to have it installed
Steven Silvester
@blink1073
Apr 18 2016 15:17
I’m looking for a workaround...
epifanio
@epifanio
Apr 18 2016 15:21
the package got installed, I don’t know if related but now trying to run the hub, when I point the browser to the login page i got: https://gist.github.com/272ccdf98d990c63aba8945e03e592f9
seems more an issue with the hub installation “TemplateNotFound”
Steven Silvester
@blink1073
Apr 18 2016 15:22
That looks like a separate issue.
epifanio
@epifanio
Apr 18 2016 15:22
yes
Steven Silvester
@blink1073
Apr 18 2016 15:23
But it could be that something didn’t get installed because of the previous issue, looking
S. Chris Colbert
@sccolbert
Apr 18 2016 15:24
@epifanio what version of node and npm are you running?
Steven Silvester
@blink1073
Apr 18 2016 15:25
no, based on looking at setupbase.py, the error will be confined to JupyterLab
epifanio
@epifanio
Apr 18 2016 15:27
@sccolbert npm 3.7.5 with node: v4.4.3
S. Chris Colbert
@sccolbert
Apr 18 2016 15:28
@epifanio thanks. That should be fine.
Steven Silvester
@blink1073
Apr 18 2016 15:30
@epifanio, can you remove the raise on this line and try again? https://github.com/jupyter/notebook/blob/master/setupbase.py#L368
epifanio
@epifanio
Apr 18 2016 15:37

@blink1073 i commented that #raise it installs without error if i run:

cd notebook
pip3 install -U .

while ends with this error: https://gist.github.com/2e2735e7b6d0e4d45918a7e3e6c0fe07
if i use sudo pip3 install -U . (which is needed if I want the package to go globally into /usr/local)

should I move to #jupyterhub, for the login error (404) ?
Steven Silvester
@blink1073
Apr 18 2016 15:40
no, let’s get a clean install first
I’m looking for what else needs to be changed
epifanio
@epifanio
Apr 18 2016 15:40
ok
Steven Silvester
@blink1073
Apr 18 2016 15:42
in your case, you can comment out this line temporarily: https://github.com/jupyter/notebook/blob/master/setupbase.py#L134
epifanio
@epifanio
Apr 18 2016 15:43
just testing, the singleuser installation works fine (jupyter notebook instead of jupyterhub)
incuding the jupyerlab (which is amazing btw)
@blink1073 commenting: https://github.com/jupyter/notebook/blob/master/setupbase.py#L134 will remove the jupyterlab, correct? is this to fix the installation issue?
Steven Silvester
@blink1073
Apr 18 2016 15:47
right, that was a temporary fix, the real fix is here: jupyter/notebook#1367
epifanio
@epifanio
Apr 18 2016 15:47
i’ll try to comment it and re-run the installation using sudo
Steven Silvester
@blink1073
Apr 18 2016 15:47
we are in the process of consilidating the phosphor repos to avoid the need to use dedupe, so this is temporary
epifanio
@epifanio
Apr 18 2016 15:47
to see if it fails
i see, thanks!
@blink1073 I confirm that commenting line setupbase.py#134 fix the sudo installation
Steven Silvester
@blink1073
Apr 18 2016 15:50
good
epifanio
@epifanio
Apr 18 2016 16:07
@blink1073 the hub now works, I had to install it using sudo python setup.py install, previously I used sudo pip install -U .
the standard jupyterhub interface works fine for all the user, while the jupyterlab interface works for my main use, I guess because of the “local installation” we did before (without using sudo)
@all thanks a lot for the help!
epifanio @epifanio has a meeting with his advisor .. and is dupposed to show a bounch of notebooks ;)
epifanio
@epifanio
Apr 18 2016 16:09
still in time .. 3pm
Steven Silvester
@blink1073
Apr 18 2016 16:54
great, I’m glad we got it patched up for you