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

Support installing tools into a private cache directory #236

Closed
esutton opened this issue Nov 15, 2017 · 4 comments
Closed

Support installing tools into a private cache directory #236

esutton opened this issue Nov 15, 2017 · 4 comments
Labels
feature-request Request for new features or functionality

Comments

@esutton
Copy link

esutton commented Nov 15, 2017

Environment data

VS Code version: 1.18.0 (1.18.0)
Python Extension version: 0.8.0
Python Version: Python 2.7.10
OS and version: macOS Sierra 10.12.6

Steps to reproduce:

  1. Install ms-python.python
  2. Open a Python source file
  3. Error Linter pylint is not installed
  4. Press "Install pylint"
  5. Install fails trying to mkdir
   Permission denied: '/Library/Python/2.7/site-packages/enum'

Tips or suggestions appreciated. ( I am not a Python expert )

Logs

Output from Console window (Help->Developer Tools menu)

/usr/bin/python -m pip install pylint
edwards-mbp:source edward3$ /usr/bin/python -m pip install pylint
Collecting pylint
  Using cached pylint-1.7.4-py2.py3-none-any.whl
Collecting astroid>=1.5.1 (from pylint)
  Using cached astroid-1.5.3-py2.py3-none-any.whl
Collecting singledispatch; python_version < "3.4" (from pylint)
  Using cached singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting mccabe (from pylint)
  Using cached mccabe-0.6.1-py2.py3-none-any.whl
Collecting backports.functools-lru-cache; python_version == "2.7" (from pylint)
  Using cached backports.functools_lru_cache-1.4-py2.py3-none-any.whl
Requirement already satisfied: six in /Library/Python/2.7/site-packages/six-1.10.0-py2.7.egg (from pylint)
Collecting isort>=4.2.5 (from pylint)
  Using cached isort-4.2.15-py2.py3-none-any.whl
Collecting configparser; python_version == "2.7" (from pylint)
  Using cached configparser-3.5.0.tar.gz
Collecting enum34>=1.1.3; python_version < "3.4" (from astroid>=1.5.1->pylint)
  Using cached enum34-1.1.6-py2-none-any.whl
Collecting lazy-object-proxy (from astroid>=1.5.1->pylint)
  Using cached lazy-object-proxy-1.3.1.tar.gz
Collecting wrapt (from astroid>=1.5.1->pylint)
  Using cached wrapt-1.10.11.tar.gz
Installing collected packages: enum34, singledispatch, lazy-object-proxy, backports.functools-lru-cache, wrapt, astroid, mccabe, isort, configparser, pylint
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/commands/install.py", line 342, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_set.py", line 784, in install
    **kwargs
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 851, in install
    self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 1064, in move_wheel_files
    isolated=self.isolated,
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 345, in move_wheel_files
    clobber(source, lib_dir, True)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/wheel.py", line 316, in clobber
    ensure_dir(destdir)
  File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/utils/__init__.py", line 83, in ensure_dir
    os.makedirs(path)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/Library/Python/2.7/site-packages/enum'
edwards-mbp:source edward3$
@brettcannon brettcannon added awaiting 1-decision area-debugging bug Issue identified by VS Code Team member as probable bug labels Nov 15, 2017
@brettcannon
Copy link
Member

This is happening because you're using the system Python which means you need to install Pylint with sudo or into a virtual environment. I will need to discuss this with @DonJayamanne , but my suspicion is our recommendation will be to create a virtual environment and install into that (versus installing into a private cache directory).

@brettcannon brettcannon added feature-request Request for new features or functionality and removed bug Issue identified by VS Code Team member as probable bug labels Nov 15, 2017
@brettcannon brettcannon changed the title [ macOS ] Install pylint error Permission denied: '/Library/Python/2.7/site-packages/enum' Support installing tools into a private cache directory Nov 15, 2017
@esutton
Copy link
Author

esutton commented Nov 16, 2017

@brettcannon Thanks. A virtual environment sounds less risky.

Whether macOs or Red Hat Enterprise Linux I am afraid to mess with the system Python because of potentially bad and unknown consequences.

I would prefer to install everything with homebrew.

Is not there a utility that can switch environments, for example, between system Python, Python 2.7, and Python 3.0?

@brettcannon
Copy link
Member

@esutton Yep, you're after pyenv.

@DonJayamanne
Copy link

Closing in favor of #386

DonJayamanne added a commit that referenced this issue Feb 22, 2018
@lock lock bot locked as resolved and limited conversation to collaborators Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
feature-request Request for new features or functionality
Projects
None yet
Development

No branches or pull requests

3 participants