Six issue when installing package on OS X 10.11 El Capitan #54

Open
NickStefan opened this Issue May 23, 2016 · 3 comments

Projects

None yet

2 participants

@NickStefan
NickStefan commented May 23, 2016 edited

I. when I try and pip install I get this error:

➜  ~ pip install haxor-news
Collecting haxor-news
Collecting prompt-toolkit==0.52 (from haxor-news)
  Using cached prompt_toolkit-0.52-py2-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): colorama>=0.3.3 in /Library/Python/2.7/site-packages (from haxor-news)
Requirement already satisfied (use --upgrade to upgrade): requests>=2.4.3 in /Library/Python/2.7/site-packages (from haxor-news)
Requirement already satisfied (use --upgrade to upgrade): pygments>=2.0.2 in /Library/Python/2.7/site-packages (from haxor-news)
Collecting six>=1.9.0 (from haxor-news)
  Using cached six-1.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): click>=5.1 in /Library/Python/2.7/site-packages (from haxor-news)
Collecting wcwidth (from prompt-toolkit==0.52->haxor-news)
  Using cached wcwidth-0.1.6-py2.py3-none-any.whl
Installing collected packages: six, wcwidth, prompt-toolkit, haxor-news
  Found existing installation: six 1.4.1
    DEPRECATION: Uninstalling a distutils installed project (six) 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 six-1.4.1:
Exception:
Traceback (most recent call last):
  File "/Library/Python/2.7/site-packages/pip/basecommand.py", line 215, in main
    status = self.run(options, args)
  File "/Library/Python/2.7/site-packages/pip/commands/install.py", line 317, in run
    prefix=options.prefix_path,
  File "/Library/Python/2.7/site-packages/pip/req/req_set.py", line 736, in install
    requirement.uninstall(auto_confirm=True)
  File "/Library/Python/2.7/site-packages/pip/req/req_install.py", line 742, in uninstall
    paths_to_remove.remove(auto_confirm)
  File "/Library/Python/2.7/site-packages/pip/req/req_uninstall.py", line 115, in remove
    renames(path, new_path)
  File "/Library/Python/2.7/site-packages/pip/utils/__init__.py", line 267, in renames
    shutil.move(old, new)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 302, in move
    copy2(src, real_dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 131, in copy2
    copystat(src, dst)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/shutil.py", line 103, in copystat
    os.chflags(dst, st.st_flags)
OSError: [Errno 1] Operation not permitted: '/var/folders/n9/_fh0q6555sb_djs4_l70t1y80000gn/T/pip-A9Ynf3-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'
➜  ~

II. this points to a solution, but does not work: http://stackoverflow.com/questions/31900008/oserror-errno-1-operation-not-permitted-when-installing-scrapy-in-osx-10-11

pip install --ignore-installed six

III. so then I tried to build from a docker container I found here, but it outputs:

https://hub.docker.com/search/?isAutomated=0&isOfficial=0&page=1&pullCount=0&q=haxornews&starCount=0

docker run sthysel/docker-haxornews
Version: 0.3.1
Syntax: hn <command> [params] [options]
Traceback (most recent call last):
  File "/usr/local/bin/haxor-news", line 9, in <module>
    load_entry_point('haxor-news==0.3.1', 'console_scripts', 'haxor-news')()
  File "/usr/local/lib/python3.5/site-packages/haxor_news/main.py", line 26, in cli
    haxor.run_cli()
  File "/usr/local/lib/python3.5/site-packages/haxor_news/haxor.py", line 205, in run_cli
    document = self.cli.run()
  File "/usr/local/lib/python3.5/site-packages/prompt_toolkit/interface.py", line 321, in run
    with self.input.raw_mode():
  File "/usr/local/lib/python3.5/site-packages/prompt_toolkit/input.py", line 65, in raw_mode
    return raw_mode(self.stdin.fileno())
  File "/usr/local/lib/python3.5/site-packages/prompt_toolkit/terminal/vt100_input.py", line 344, in __init__
    self.attrs_before = termios.tcgetattr(fileno)
termios.error: (25, 'Inappropriate ioctl for device')

The dockerfile is exactly what I'd expect:


FROM python:3.5
MAINTAINER https://github.com/sthysel/docker-haxornews

RUN pip install haxor-news

CMD ["haxor-news"]
@donnemartin
Owner

Hi Nick, does this help? I can add this to the README.

Mac OS X (10.11 El Capitan) users

There is a known issue with Apple and its included python package dependencies (more info at pypa/pip#3165).

 $ sudo pip install haxor-news --upgrade --ignore-installed six
@donnemartin donnemartin added the notice label May 24, 2016
@NickStefan
NickStefan commented May 24, 2016 edited

that worked! @donnemartin

@donnemartin
Owner

Thanks for confirming! Added a note to README and INSTALLATION with 44d071c.

@donnemartin donnemartin changed the title from Trouble installing (python errors) to Six issue when installing package May 30, 2016
@donnemartin donnemartin changed the title from Six issue when installing package to Six issue when installing package on OS X 10.11 El Capitan May 30, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment