donnemartin / haxor-news

Browse Hacker News like a haxor: A Hacker News command line interface (CLI).
Other
3.99k stars 166 forks source link

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

Open NickStefan opened 8 years ago

NickStefan commented 8 years ago

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 commented 8 years ago

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 https://github.com/pypa/pip/issues/3165).

 $ sudo pip install haxor-news --upgrade --ignore-installed six
NickStefan commented 8 years ago

that worked! @donnemartin

donnemartin commented 8 years ago

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

TheDahomean commented 7 years ago

Just an fyi. It worked for me too

$ sudo pip install haxor-news --upgrade --ignore-installed six

thanks!

MiaoJiHui commented 7 years ago

That worked for me too! Thanks!! sudo pip install Scrapy --upgrade --ignore-installed six

micahp commented 7 years ago

This also worked for me, for the six package!

⇒ sudo pip install --ignore-installed six

bersoriano commented 7 years ago

Worked for me too!! sudo pip install -U flask-cors --ignore-installed six

randylicata commented 6 years ago

@donnemartin You're a savor

YDJSZY commented 6 years ago

It not work for me....

kingstonlee commented 6 years ago

@YDJSZY try using sudo.

HandyBrains commented 6 years ago

worked for me.. Thanks pip install boto3 --ignore-installed six