Install PANDAS on Mac, big issue - macos

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.

Related

Pythonanywhere install modules permission denied error

How do you install upstox? pip install upstox is not installing the module on a bash console.
11:54 ~ $ pip install upstox
Collecting upstox
Using cached upstox-1.5.5-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/dist-packages (from upstox)
Requirement already satisfied (use --upgrade to upgrade): future in /usr/local/lib/python2.7/dist-packages (from upstox)
Collecting websocket-client (from upstox)
Using cached websocket_client-0.46.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): argparse in /usr/lib/python2.7 (from future->upstox)
Requirement already satisfied (use --upgrade to upgrade): importlib in /usr/local/lib/python2.7/dist-packages (from future->upstox)
Requirement already satisfied (use --upgrade to upgrade): six in /usr/local/lib/python2.7/dist-packages (from websocket-client->upstox)
Installing collected packages: websocket-client, upstox
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 742, in install
**kwargs
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 831, in install
self.move_wheel_files(self.source_dir, root=root, prefix=prefix)
File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 1032, in move_wheel_files
isolated=self.isolated,
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 346, in move_wheel_files
clobber(source, lib_dir, True)
File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 317, in clobber
ensure_dir(destdir)
File "/usr/local/lib/python2.7/dist-packages/pip/utils/__init__.py", line 83, in ensure_dir
os.makedirs(path)
File "/usr/lib/python2.7/os.py", line 157, in makedirs
mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/websocket_client-0.46.0.dist-info'
11:54 ~ $
This help page on the PythonAnywhere site has instructions on a couple of extra things you need to do when using pip to install stuff there. Essentially, you either need to use the --user flag or use a virtualenv.
just use --user flag example:
pip3 install --user django-js-reverse

Use the `pip install tornado` on Mac get error:Permission denied: '/Library/Python/2.7/site-packages/singledispatch.py

Use the pip install tornado on Mac get error:
aircraftdeMacBook-Pro:~ ldl$ pip install tornado
Collecting tornado
Downloading tornado-4.5.1.tar.gz (483kB)
100% |████████████████████████████████| 491kB 565kB/s
Collecting singledispatch (from tornado)
Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting certifi (from tornado)
Downloading certifi-2017.4.17-py2.py3-none-any.whl (375kB)
100% |████████████████████████████████| 378kB 565kB/s
Collecting backports_abc>=0.4 (from tornado)
Downloading backports_abc-0.5-py2.py3-none-any.whl
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch->tornado)
Installing collected packages: singledispatch, certifi, backports-abc, tornado
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 323, in clobber
shutil.copyfile(srcfile, destfile)
File "/System/Library/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: '/Library/Python/2.7/site-packages/singledispatch.py'
After struggle, I use sudo pip install tornado solved it.
Collecting tornado
Downloading tornado-4.5.1.tar.gz (483kB)
100% |████████████████████████████████| 491kB 557kB/s
Collecting singledispatch (from tornado)
Downloading singledispatch-3.4.0.3-py2.py3-none-any.whl
Collecting certifi (from tornado)
Downloading certifi-2017.4.17-py2.py3-none-any.whl (375kB)
100% |████████████████████████████████| 378kB 641kB/s
Collecting backports_abc>=0.4 (from tornado)
Downloading backports_abc-0.5-py2.py3-none-any.whl
Requirement already satisfied: six in /System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python (from singledispatch->tornado)
Installing collected packages: singledispatch, certifi, backports-abc, tornado
Running setup.py install for tornado ... done
Successfully installed backports-abc-0.5 certifi-2017.4.17 singledispatch-3.4.0.3 tornado-4.5.1
In general, when instructions say:
To install package123 run pip install package123
99% of the time, it's assuming that the package is being installed in a Python virtual environment (via virtualenv or venv). With that being said, you should install Tornado in a virtual environment and avoid sudo pip install tornado. Nothing bad will happen if you do use sudo other than pollution of your system packages with 3rd party modules.
Try pip install tornado.
If any permission errors are coming in terminal then try sudo pip install tornado.

"python setup.py egg_info" failed with error code 1 when installing autosub

I tried to install Autosub but it shown error, and I cannot find a solution that work for me.
I already installed ffmpeg that required by Autosub and added path for it.
I also upgraded my setuptools.
C:\WINDOWS\system32>pip install autosub
Collecting autosub
Using cached autosub-0.3.11.tar.gz
Collecting google-api-python-client>=1.4.2 (from autosub)
Using cached google_api_python_client-1.6.2-py2.py3-none-any.whl
Requirement already satisfied: requests>=2.3.0 in c:\program files\python36\lib\site-packages (from autosub)
Collecting pysrt>=1.0.1 (from autosub)
Using cached pysrt-1.1.1.tar.gz
Collecting progressbar>=2.3 (from autosub)
Using cached progressbar-2.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\setup.py", line 5, in <module>
import progressbar
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\progressbar\__init__.py", line 59, in <module>
from progressbar.widgets import *
File "C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\progressbar\widgets.py", line 121, in <module>
class FileTransferSpeed(Widget):
File "c:\program files\python36\lib\abc.py", line 133, in __new__
cls = super().__new__(mcls, name, bases, namespace)
ValueError: 'format' in __slots__ conflicts with class variable
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\CHEKWE~1\AppData\Local\Temp\pip-build-4wnmhm6k\progressbar\
I found another answer that said enter easy_install -U setuptools but shown error too. (cmd is run as admin)
C:\WINDOWS\system32>easy_install -U setuptools
Searching for setuptools
Reading https://pypi.python.org/simple/setuptools/
Best match: setuptools 35.0.1
Processing setuptools-35.0.1-py3.6.egg
setuptools 35.0.1 is already the active version in easy-install.pth
Installing easy_install-script.py script to c:\program files\python36\Scripts
Installing easy_install.exe script to c:\program files\python36\Scripts
error: [WinError 5] Access is denied: 'c:\\program files\\python36\\Scripts\\easy_install.exe'
Any help would be appreciated.
-Error install pip
"python setup.py egg_info"
Solution
Install Python 2.7 uninstall 3.x
https://github.com/agermanidis/autosub/issues/31
If you run into this problem while running an Alpine Docker container, which was the case for me. Try adding the following line to your Dockerfile to install required dependencies.
RUN apk update && apk add postgresql-dev gcc python3-dev musl-dev

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

aws cli won't update on OS X

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.

Resources