aws cli won't update on OS X - macos

There is a new version of the aws cli, but when i do pip install --upgrade awscli i get this:
Installing collected packages: pyasn1, rsa, futures, jmespath, six, python-dateutil, docutils, botocore, s3transfer, colorama, awscli
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 209, in main
status = self.run(options, args)
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: '/tmp/pip-i7HlOi-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/six-1.4.1-py2.7.egg-info'

There should be two ways to fix this
Better way
It would be beneficial for you to install brew you can follow this link and then install python through brew. Then the way to avoid this is to use a virtual environment for python such as this and then make a virtual environment to work on your AWS account. Also, since you've installed everything through brew, you should never run into permission issues on your account.
Highly Unrecommended Way
You could run your command as super user with:
sudo pip install --upgrade awscli, this should give pip permission to uninstall the required file, but it's also possible that it won't work. Using the brew version of python is definitely preferable.
Hope that helps.

Related

Install PANDAS on Mac, big issue

I lot of people had asked this question, but I can't find an answer that can help me overcome my problems installing PANDAS on my Mac.
I've tried several procedures previously suggested, but they don't work. This is the error I'm getting.
Pablos-MacBook-Pro:pastudilloe$ sudo pip install pandas
The directory '/Users/pastudilloe/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.
The directory '/Users/pastudilloe/Library/Caches/pip' or its parent directory is not owned by the current user and caching wheels has been disabled. check the permissions and owner of that directory. If executing pip with sudo, you may want sudo's -H flag.
Collecting pandas
Downloading https://files.pythonhosted.org/packages/58/9a/f571a032f5f2bf5b8a5d63ce079428c5423299853ed2d8d96626f441801d/pandas-0.23.3-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (14.6MB)
100% |████████████████████████████████| 14.6MB 83kB/s
Collecting numpy>=1.9.0 (from pandas)
Downloading https://files.pythonhosted.org/packages/3c/bf/e36756c562f7386be78c6942f0a8a647ee4eb374cdf219bece7054832b14/numpy-1.15.0-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl (24.5MB)
100% |████████████████████████████████| 24.5MB 49kB/s
Collecting python-dateutil>=2.5.0 (from pandas)
Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
100% |████████████████████████████████| 215kB 640kB/s
Requirement already satisfied: pytz>=2011k in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from pandas)
Requirement already satisfied: six>=1.5 in /Users/pastudilloe/Library/Python/2.7/lib/python/site-packages (from python-dateutil>=2.5.0->pandas)
Installing collected packages: numpy, python-dateutil, pandas
Found existing installation: numpy 1.8.0rc1
DEPRECATION: Uninstalling a distutils installed project (numpy) 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 numpy-1.8.0rc1:
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 778, in install
requirement.uninstall(auto_confirm=True)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_install.py", line 754, in uninstall
paths_to_remove.remove(auto_confirm)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/Library/Python/2.7/site-packages/pip-9.0.1-py2.7.egg/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: '/tmp/pip-62NbGp-uninstall/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy-1.8.0rc1-py2.7.egg-info'
You are using pip version 9.0.1, however version 18.0 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
uninstall numpy and then try again:
pip uninstall numpy
pip install pandas
In the ipython jupyter code,
Add below lines
!pip install pandas
!pip install numpy
It will be installed during runtime if it is not installed.

How can I resolve this issue regarding upgradation of pip on ubuntu 16.04?

Here is what happened.I even tried to remove pip, but it shows the same problem.My python version is 2.7.12
saikat#saikat:~$ pip install --upgrade pip
Collecting pip
Using cached pip-9.0.1-py2.py3-none-any.whl
Installing collected packages: pip
Found existing installation: pip 8.1.2
Uninstalling pip-8.1.2:
Exception:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip/commands/install.py", line 317, in run
prefix=options.prefix_path,
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 736, in install
requirement.uninstall(auto_confirm=True)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 742, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_uninstall.py", line 115, in remove
renames(path, new_path)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 267, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 303, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/bin/pip'
You are using pip version 8.1.2, however version 9.0.1 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
try this.
wget https://pypi.python.org/packages/e7/a8/7556133689add8d1a54c0b14aeff0acb03c64707ce100ecd53934da1aa13/pip-8.1.2.tar.gz
tar -xzvf pip-8.1.2.tar.gz
cd pip-8.1.2
sudo python setup.py install
It should help

ImportError: Entry point ('console_scripts', 'pip') not found on Mac

I got the message
You are using pip version 8.0.2, however version 8.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
When I try to install a package through pip.
I followed the instruction and upgrade pip with pip install --upgrade pip. Now I'm getting an error with pip, even with pip --version to check the version of pip.
Traceback (most recent call last):
File "/usr/local/bin/pip", line 9, in <module>
load_entry_point('pip==8.0.2', 'console_scripts', 'pip')()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 357, in load_entry_point
return get_distribution(dist).load_entry_point(group, name)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2393, in load_entry_point
raise ImportError("Entry point %r not found" % ((group,name),))
ImportError: Entry point ('console_scripts', 'pip') not found
I've searched online and found some similar issues like, this, this and this. but none of the solutions worked for me.
I think it might be I have multiple version of pip on my Mac, how can I clean it up and get the latest version installed, please?
Thank you.
Manually removed all pip repositories in /usr/local/bin/. (not sure if it's necessary.)
Then reinstall pip following the instructions here.
To install pip, securely download get-pip.py.
Then run the following:
python get-pip.py
FYI, easy-install pip doesn't work.

Assertion error from 'pip list' in virtualenv.

Pip list is throwing an Assertion error and I'm not sure how to resolve. This has just happened after building 2 packages (PyUblas-2013.1 and boost_1_54_0) from source. I am using virtualenv.
Error below;
(virtenv)[user#xyz ~]$ pip list
beautifulsoup4 (4.2.1)
biopython (1.61)
distribute (0.6.35)
methylpy (0.1.0)
MySQL-python (1.2.4)
numpy (1.7.1)
pip (1.4)
py (1.4.15)
pytest (2.3.5)
PyUblas (2013.1)
Exception:
Traceback (most recent call last):
File "/home/user/virtenv/lib/python2.7/site-packages/pip/basecommand.py", line 134, in main
status = self.run(options, args)
File "/home/user/virtenv/lib/python2.7/site-packages/pip/commands/list.py", line 80, in run
self.run_listing(options)
File "/home/user/virtenv/lib/python2.7/site-packages/pip/commands/list.py", line 127, in run_listing
self.output_package_listing(installed_packages)
File "/home/user/virtenv/lib/python2.7/site-packages/pip/commands/list.py", line 136, in output_package_listing
if dist_is_editable(dist):
File "/home/user/virtenv/lib/python2.7/site-packages/pip/util.py", line 347, in dist_is_editable
req = FrozenRequirement.from_dist(dist, [])
File "/home/user/virtenv/lib/python2.7/site-packages/pip/__init__.py", line 194, in from_dist
assert len(specs) == 1 and specs[0][0] == '=='
AssertionError
Can anyone help me troubleshoot???
Thanks,
I think it is because the distribute package is out of date. Certainly the following fixed it for me:
pip install --upgrade distribute
Your pip may be outdated. Even in Ubuntu 14.04 LTS, the pip version it installed using apt-get install python-pip was 1.5.4. Try updating pip manually, and possibly the new packages again as well.
pip --version # 1.5.4
curl -O https://bootstrap.pypa.io/get-pip.py
sudo python get-pip.py
pip --version # 6.0.8
https://pip.pypa.io/en/latest/installing.html
I know it's old but since I had the same problem and the fix didn't helped. Guess does not harm adding my solution.
Just updated pip, from inside of my virtualenv.
pip install --upgrade pip

spyder, distribute & scipy error

I am running python 2.7 under ubuntu 12.04. I'm trying to install spyder using pip but get the error message:
error: invalid command 'egg_info'
Command python setup.py egg_info failed with error code 1
I looked at other posts, which recommended I install distribute. But I get the same error message when installing distribute using pip
When I try to upgrade scipy or install spyder with pip I get the following message:
Command python setup.py egg_info failed with error code 1
Exception information:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 223, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 980, in prepare_files
req_to_install.run_egg_info()
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 216, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/lib/python2.7/dist-packages/pip/__init__.py", line 255, in call_subprocess
% (command_desc, proc.returncode))
InstallationError: Command python setup.py egg_info failed with error code 1
I'm new to python, pip and ubuntu, which makes this more difficult. Thanks in advance.
You can install spyder by simply typing following command in terminal
sudo apt-get install spyder
The another way is :
Open "Ubuntu Software Center" search for spyder and click on "Install."
(Spyder dev here) Maybe your problem is because Ubuntu 12.04 has an outdated version of pip. You can update it using sudo easy_install pip, and then try again.
You can also try to use easy_install instead of pip to install Spyder. Just run the command sudo easy_install spyder to see if that works.
Notes:
If these solutions don't work for you but you still want to try the latest Spyder (and other scientific packages like scipy or pandas), you'll have a much better time by installing a Python scientific distribution like Anaconda.
Don't try to install scipy with pip. That's not so easy as installing Spyder.

Resources