Re: [jupyter] Installation update issues. "PermissionError: [Errno 1] Operation not permitted"

1,592 views
Skip to first unread message

Matthias Bussonnier

unread,
Mar 10, 2016, 11:53:44 AM3/10/16
to jup...@googlegroups.com
Hu David,

> On Mar 8, 2016, at 16:44, David Frantz <webster...@mac.com> wrote:
>
> During a regular update of my Python installation I got some update failures on my Mac OS installation. This is a recent MBP however I am running a beta OS. However having seen something similar on my Windows machine at work I have to think that this isn't machine specific. I'm not sure if I'm missing something or there is an issue with the process of upgrading stuff.
>
> I usually run a script to update the entire installation. In any event the output of that script is below. As you can see jupiter is having issues.


It's hard to debug if you dont 'say what is in your script.
But the permission errors look like the previous installation was done by another user, or as root,
which explain that you can't overwrite some files.

--
M

David Frantz

unread,
Mar 10, 2016, 6:39:41 PM3/10/16
to Project Jupyter
I've been working on this and now realize that I don't even need to run my update script.   A simple pip3 update does the same thing.   For example:

Davids-MacBook-Pro-2:Downloads Wizard$ pip3 install notebook --upgrade

Requirement already up-to-date: notebook in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages

Requirement already up-to-date: jinja2 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Requirement already up-to-date: terminado>=0.3.3 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Requirement already up-to-date: ipython-genutils in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Requirement already up-to-date: ipykernel in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Collecting jupyter-core (from notebook)

  Using cached jupyter_core-4.1.0-py2.py3-none-any.whl

Requirement already up-to-date: tornado>=4 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Requirement already up-to-date: traitlets in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Collecting jupyter-client (from notebook)

  Downloading jupyter_client-4.2.2-py2.py3-none-any.whl (76kB)

    100% |████████████████████████████████| 81kB 1.0MB/s 

Requirement already up-to-date: nbconvert in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Requirement already up-to-date: nbformat in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from notebook)

Requirement already up-to-date: MarkupSafe in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from jinja2->notebook)

Requirement already up-to-date: ptyprocess in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from terminado>=0.3.3->notebook)

Requirement already up-to-date: ipython>=4.0.0 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from ipykernel->notebook)

Requirement already up-to-date: decorator in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from traitlets->notebook)

Requirement already up-to-date: pyzmq>=13 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from jupyter-client->notebook)

Requirement already up-to-date: pygments in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from nbconvert->notebook)

Requirement already up-to-date: mistune!=0.6 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from nbconvert->notebook)

Requirement already up-to-date: jsonschema!=2.5.0,>=2.0 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from nbformat->notebook)

Requirement already up-to-date: appnope in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from ipython>=4.0.0->ipykernel->notebook)

Requirement already up-to-date: pickleshare in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from ipython>=4.0.0->ipykernel->notebook)

Requirement already up-to-date: gnureadline in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from ipython>=4.0.0->ipykernel->notebook)

Requirement already up-to-date: pexpect in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from ipython>=4.0.0->ipykernel->notebook)

Requirement already up-to-date: simplegeneric>0.8 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from ipython>=4.0.0->ipykernel->notebook)

Requirement already up-to-date: setuptools>=18.5 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from ipython>=4.0.0->ipykernel->notebook)

Requirement already up-to-date: path.py>=6.2 in /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages (from pickleshare->ipython>=4.0.0->ipykernel->notebook)

Installing collected packages: jupyter-core, jupyter-client

  Found existing installation: jupyter-core 4.0.6

    Uninstalling jupyter-core-4.0.6:

      Successfully uninstalled jupyter-core-4.0.6

  Rolling back uninstall of jupyter-core

Exception:

Traceback (most recent call last):

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/basecommand.py", line 209, in main

    status = self.run(options, args)

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/commands/install.py", line 317, in run

    prefix=options.prefix_path,

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/req/req_set.py", line 732, in install

    **kwargs

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/req/req_install.py", line 835, in install

    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/req/req_install.py", line 1030, in move_wheel_files

    isolated=self.isolated,

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/wheel.py", line 344, in move_wheel_files

    clobber(source, lib_dir, True)

  File "/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pip/wheel.py", line 328, in clobber

    os.utime(destfile, (st.st_atime, st.st_mtime))

PermissionError: [Errno 1] Operation not permitted


*************************************************************************************
In any event I'm looking into a it a bit today,   I've been very much under the weather so to speak so I may not get that far.

It is interesting though that the fault seems to be associated with os.utime()    At this moment I've done nothing on my Mac that would imply a file system or permissions error issue.    Even so I'm doing the basic Mac OS checks for things like that.   In this case I have no other users on the machine, the Windows machine at work is a different story though.

In any event fixing permissions didn't fix this problem.    I will work away at this until I can identify the problem if that is within my capabilities, I'm just surprised that I have found nothing about this on the net so far.

David Frantz

unread,
Mar 10, 2016, 7:14:16 PM3/10/16
to Project Jupyter
Interesting a Google search today landed me a solution in a few minutes that I couldn't find at all the other day searching GitHub.   That solution is described here: https://github.com/jupyter/jupyter_client/pull/61

Frankly I'm not that happy with the solution, at least not for a shared machine.    It did however get my update to complete correctly so that has me happy.    


On Thursday, March 10, 2016 at 11:53:44 AM UTC-5, Matthias Bussonnier wrote:

MinRK

unread,
Mar 11, 2016, 3:06:30 AM3/11/16
to jup...@googlegroups.com
This probably means that you don't have permission on one or more of the files. With Python packages, this is most often caused by having done one `sudo pip install` in the past, which would make some files owned by root that you can't modify without using sudo again. It is a bit frustrating that it does not tell you *what* files it's trying to update when it fails, but you can check where most of the files it is writing go with:

    ls -la /Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages
    ls -la /Library/Frameworks/Python.framework/Versions/3.5/bin

My suspicion is that you will see a mixture of root- and you-owned files in there. Specifically check for files related to `jupyter_client`, which are the ones that are failing to uninstall.

-MinRK

--
You received this message because you are subscribed to the Google Groups "Project Jupyter" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jupyter+u...@googlegroups.com.
To post to this group, send email to jup...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jupyter/f14546c2-df00-4a89-b56a-51cd99080554%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages