IOError: decoder jpeg not available when using Pillow

后端 未结 1 744
攒了一身酷
攒了一身酷 2021-02-09 16:22

Before someone says \"sudo apt-get install libjpeg-dev\" or something along those lines, I do not have sudo access. I am on a slice of a server that does NOT allow

1条回答
  •  梦毁少年i
    2021-02-09 17:07

    Instead of just downloading the libraries you need, try creating an entire Python environment in locally in your home folder:

    $ wget http://www.python.org/ftp/python/[desired version of Python].tgz
    $ tar xzf Python[version].tgz
    $ cd python-[version]
    $ ./configure
    $ make altinstall prefix=~ exec-prefix=~
    

    Update your PATH variable so that your local Python is executed first:

    $ PATH = /home/user/[pathtopython]:$PATH
    

    Obtain pip, from which other packages can be installed:

    $ curl https://bootstrap.pypa.io/get-pip.py > get-pip.py
    $ ./get-pip.py
    $ pip install pillow
    

    URLs may vary. You might still have to modify setup.py - I haven't used this technique with C-like libraries so I'm not sure.

    0 讨论(0)
提交回复
热议问题