python init fails #7

Closed
sinewalker opened this Issue Feb 8, 2017 · 1 comment

Comments

Projects
None yet
1 participant
@sinewalker
Owner

sinewalker commented Feb 8, 2017

The python init attempts to install some python modules using pip, but into the global context.

  • do I actually want to do things this way? If so which is better, pip or the OS's package system?
  • Perhaps I don't want to init anything beyond virtualenv (and maybe virtualenv wrapper used by eshell-prompt-extras)?
@sinewalker

This comment has been minimized.

Show comment
Hide comment
@sinewalker

sinewalker Feb 17, 2017

Owner

updated the issue title: it fails in OS X also!

Sourcing 50_python.sh
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
Collecting setuptools
  Using cached setuptools-34.2.0-py2.py3-none-any.whl
Requirement already up-to-date: wheel in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: virtualenv in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: six>=1.6.0 in /usr/local/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: packaging>=16.8 in /usr/local/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/local/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: pyparsing in /usr/local/lib/python2.7/site-packages (from packaging>=16.8->setuptools)
Installing collected packages: setuptools
  Found existing installation: setuptools 34.1.1
    Uninstalling setuptools-34.1.1:
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py'
Collecting Mercurial
  Downloading mercurial-4.1.tar.gz (5.1MB)
    100% |████████████████████████████████| 5.1MB 240kB/s
Requirement already up-to-date: hg-git in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: dulwich>=0.9.7 in /usr/local/lib/python2.7/site-packages (from hg-git)
Building wheels for collected packages: Mercurial
  Running setup.py bdist_wheel for Mercurial ... done
  Stored in directory: /Users/mjl/Library/Caches/pip/wheels/c6/f7/d8/6a898cb6d46366a9eb51d0220b573cfc7d1ddc98d2cb2830ce
Successfully built Mercurial
Installing collected packages: Mercurial
  Found existing installation: mercurial 4.0.2
    DEPRECATION: Uninstalling a distutils installed project (Mercurial) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling mercurial-4.0.2:
      Successfully uninstalled mercurial-4.0.2
  Rolling back uninstall of mercurial
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/hgext/__init__.py'
Requirement already up-to-date: isort in /usr/local/lib/python2.7/site-packages
Collecting ipython
  Downloading ipython-5.2.2-py2-none-any.whl (749kB)
    100% |████████████████████████████████| 757kB 1.2MB/s
Requirement already up-to-date: traitlets>=4.2 in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: decorator in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: simplegeneric>0.8 in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: pygments in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: appnope; sys_platform == "darwin" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: pexpect; sys_platform != "win32" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: pickleshare in /usr/local/lib/python2.7/site-packages (from ipython)
Collecting prompt-toolkit<2.0.0,>=1.0.4 (from ipython)
  Downloading prompt_toolkit-1.0.13-py2-none-any.whl (247kB)
    100% |████████████████████████████████| 256kB 3.2MB/s
Collecting setuptools>=18.5 (from ipython)
  Using cached setuptools-34.2.0-py2.py3-none-any.whl
Requirement already up-to-date: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: ipython-genutils in /usr/local/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
Requirement already up-to-date: six in /usr/local/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
Requirement already up-to-date: enum34; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
Requirement already up-to-date: ptyprocess>=0.5 in /usr/local/lib/python2.7/site-packages (from pexpect; sys_platform != "win32"->ipython)
Requirement already up-to-date: wcwidth in /usr/local/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython)
Requirement already up-to-date: packaging>=16.8 in /usr/local/lib/python2.7/site-packages (from setuptools>=18.5->ipython)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/local/lib/python2.7/site-packages (from setuptools>=18.5->ipython)
Requirement already up-to-date: scandir; python_version < "3.5" in /usr/local/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython)
Requirement already up-to-date: pyparsing in /usr/local/lib/python2.7/site-packages (from packaging>=16.8->setuptools>=18.5->ipython)
Installing collected packages: prompt-toolkit, setuptools, ipython
  Found existing installation: prompt-toolkit 1.0.10
    Uninstalling prompt-toolkit-1.0.10:
      Successfully uninstalled prompt-toolkit-1.0.10
  Found existing installation: setuptools 34.1.1
    Uninstalling setuptools-34.1.1:
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py'
Owner

sinewalker commented Feb 17, 2017

updated the issue title: it fails in OS X also!

Sourcing 50_python.sh
Requirement already up-to-date: pip in /usr/local/lib/python2.7/site-packages
Collecting setuptools
  Using cached setuptools-34.2.0-py2.py3-none-any.whl
Requirement already up-to-date: wheel in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: virtualenv in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: six>=1.6.0 in /usr/local/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: packaging>=16.8 in /usr/local/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/local/lib/python2.7/site-packages (from setuptools)
Requirement already up-to-date: pyparsing in /usr/local/lib/python2.7/site-packages (from packaging>=16.8->setuptools)
Installing collected packages: setuptools
  Found existing installation: setuptools 34.1.1
    Uninstalling setuptools-34.1.1:
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py'
Collecting Mercurial
  Downloading mercurial-4.1.tar.gz (5.1MB)
    100% |████████████████████████████████| 5.1MB 240kB/s
Requirement already up-to-date: hg-git in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: dulwich>=0.9.7 in /usr/local/lib/python2.7/site-packages (from hg-git)
Building wheels for collected packages: Mercurial
  Running setup.py bdist_wheel for Mercurial ... done
  Stored in directory: /Users/mjl/Library/Caches/pip/wheels/c6/f7/d8/6a898cb6d46366a9eb51d0220b573cfc7d1ddc98d2cb2830ce
Successfully built Mercurial
Installing collected packages: Mercurial
  Found existing installation: mercurial 4.0.2
    DEPRECATION: Uninstalling a distutils installed project (Mercurial) has been deprecated and will be removed in a future version. This is due to the fact that uninstalling a distutils project will only partially uninstall the project.
    Uninstalling mercurial-4.0.2:
      Successfully uninstalled mercurial-4.0.2
  Rolling back uninstall of mercurial
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/usr/local/lib/python2.7/site-packages/pip/wheel.py", line 323, in clobber
    shutil.copyfile(srcfile, destfile)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 83, in copyfile
    with open(dst, 'wb') as fdst:
IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/hgext/__init__.py'
Requirement already up-to-date: isort in /usr/local/lib/python2.7/site-packages
Collecting ipython
  Downloading ipython-5.2.2-py2-none-any.whl (749kB)
    100% |████████████████████████████████| 757kB 1.2MB/s
Requirement already up-to-date: traitlets>=4.2 in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: decorator in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: simplegeneric>0.8 in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: backports.shutil-get-terminal-size; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: pygments in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: appnope; sys_platform == "darwin" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: pexpect; sys_platform != "win32" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: pickleshare in /usr/local/lib/python2.7/site-packages (from ipython)
Collecting prompt-toolkit<2.0.0,>=1.0.4 (from ipython)
  Downloading prompt_toolkit-1.0.13-py2-none-any.whl (247kB)
    100% |████████████████████████████████| 256kB 3.2MB/s
Collecting setuptools>=18.5 (from ipython)
  Using cached setuptools-34.2.0-py2.py3-none-any.whl
Requirement already up-to-date: pathlib2; python_version == "2.7" or python_version == "3.3" in /usr/local/lib/python2.7/site-packages (from ipython)
Requirement already up-to-date: ipython-genutils in /usr/local/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
Requirement already up-to-date: six in /usr/local/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
Requirement already up-to-date: enum34; python_version == "2.7" in /usr/local/lib/python2.7/site-packages (from traitlets>=4.2->ipython)
Requirement already up-to-date: ptyprocess>=0.5 in /usr/local/lib/python2.7/site-packages (from pexpect; sys_platform != "win32"->ipython)
Requirement already up-to-date: wcwidth in /usr/local/lib/python2.7/site-packages (from prompt-toolkit<2.0.0,>=1.0.4->ipython)
Requirement already up-to-date: packaging>=16.8 in /usr/local/lib/python2.7/site-packages (from setuptools>=18.5->ipython)
Requirement already up-to-date: appdirs>=1.4.0 in /usr/local/lib/python2.7/site-packages (from setuptools>=18.5->ipython)
Requirement already up-to-date: scandir; python_version < "3.5" in /usr/local/lib/python2.7/site-packages (from pathlib2; python_version == "2.7" or python_version == "3.3"->ipython)
Requirement already up-to-date: pyparsing in /usr/local/lib/python2.7/site-packages (from packaging>=16.8->setuptools>=18.5->ipython)
Installing collected packages: prompt-toolkit, setuptools, ipython
  Found existing installation: prompt-toolkit 1.0.10
    Uninstalling prompt-toolkit-1.0.10:
      Successfully uninstalled prompt-toolkit-1.0.10
  Found existing installation: setuptools 34.1.1
    Uninstalling setuptools-34.1.1:
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/usr/local/lib/python2.7/site-packages/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_set.py", line 778, in install
    requirement.uninstall(auto_confirm=True)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_install.py", line 754, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/usr/local/lib/python2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/usr/local/lib/python2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/usr/local/Cellar/python/2.7.13/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 303, in move
    os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/site-packages/pkg_resources/__init__.py'

@sinewalker sinewalker self-assigned this Feb 17, 2017

@sinewalker sinewalker changed the title from python init fails in Linux to python init fails Feb 17, 2017

sinewalker added a commit that referenced this issue Feb 18, 2017

use 'sudo -H' when performing global installs with pip (gpip)
This solves issue #7

 * The permissions errors are because we're doing global install that should be
   done as root, so use sudo

 * using sudo produces this warning:

    The directory '/Users/mjl/Library/Caches/pip/http' or its parent directory
    is not owned by the current user and the cache has been disabled. Please
    check the permissions and owner of that directory. If executing pip with
    sudo, you may want sudo's -H flag.

  so add the -H flag.

@sinewalker sinewalker closed this Feb 18, 2017

@sinewalker sinewalker modified the milestone: 1.0-macOS Feb 22, 2017

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