1

I am trying to install the zipline module using "pip install zipline" but I get this exception:

IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/editor.pyc'`  - any help would be greatly appreciated

Failed building wheel for numexpr
      Running setup.py clean for numexpr
    Failed to build numexpr
    Installing collected packages: python-editor, Mako, sqlalchemy, alembic, sortedcontainers, intervaltree, python-dateutil, numpy, numexpr, toolz, bottleneck, scipy, pytz, pandas, empyrical, requests, requests-file, requests-ftp, pandas-datareader, decorator, networkx, patsy, statsmodels, click, Logbook, multipledispatch, bcolz, Cython, contextlib2, cyordereddict, cachetools, zipline
    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 342, in run
        prefix=options.prefix_path,
      File "/usr/local/lib/python2.7/dist-packages/pip/req/req_set.py", line 784, in install
        **kwargs
      File "/usr/local/lib/python2.7/dist-packages/pip/req/req_install.py", line 851, 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 1064, in move_wheel_files
        isolated=self.isolated,
      File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 345, in move_wheel_files
        clobber(source, lib_dir, True)
      File "/usr/local/lib/python2.7/dist-packages/pip/wheel.py", line 323, in clobber
        shutil.copyfile(srcfile, destfile)
      File "/usr/lib/python2.7/shutil.py", line 83, in copyfile
        with open(dst, 'wb') as fdst:
    IOError: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/editor.pyc'
halfer
  • 19,824
  • 17
  • 99
  • 186

2 Answers2

1

AS you are not root. You can use sudo to obtain superuser permissions:

sudo pip install zipline

Or else

For GNU/Linux :

On Debian-derived Linux distributions, you can acquire all the necessary binary dependencies from apt by running:

$ sudo apt-get install libatlas-base-dev python-dev gfortran pkg-config libfreetype6-dev

On recent RHEL-derived derived Linux distributions (e.g. Fedora), the following should be sufficient to acquire the necessary additional dependencies:

$ sudo dnf install atlas-devel gcc-c++ gcc-gfortran libgfortran python-devel redhat-rep-config

On Arch Linux, you can acquire the additional dependencies via pacman:

$ pacman -S lapack gcc gcc-fortran pkg-config

There are also AUR packages available for installing Python 3.4 (Arch’s default python is now 3.5, but Zipline only currently supports 3.4), and ta-lib, an optional Zipline dependency. Python 2 is also installable via:

$ pacman -S python2
Shivkumar kondi
  • 6,458
  • 9
  • 31
  • 58
0

Avoid using sudo to install packages with pip. Use the --user option instead or, even better, use virtual environments.

See this SO answer. I think this question is a duplicate of that one.

Peque
  • 13,638
  • 11
  • 69
  • 105