pip install Pillow on Alpine for Ipad freezes - python-imaging-library

I am trying to install the Pillow pip package on Alpine for ipad via ISH. This is for light debugging purposes of a django project.
Since ISH already contains the apk package, some dependencies are installed doing the following:
apk update
apk upgrade
apk add python3
apk add py3-pip bash curl python3-dev gcc zlib-dev libffi-dev postgresql-dev musl-dev jpeg-dev
pip3 install virtualenv
and once the virtualenv activated:
pip3 install Pillow
The command freezes while building the wheel for the package and cannot install it. Is it a size limitation (42.5 MB for this package) or is there any missing dependencies I did not see?

Related

I couldn't upgrade my raspberry pi python version from 3.7 to 3.9

Please help me.
i have try out alot of way to get install, upgrade my python3.7 to python3.9 yet it keep shows up error.
sudo apt-get install python3
(Python3 is already the newest version [3.7.3-1])
sudo apt-get upgrade python3
(Python3 is already the newest version [3.7.3-1])
sudo add-apt-repository ppa:deadsnakes/ppa
(file "/user/bin/add-apt-repository", line 95, in )
(sp = SoftwareProperties(options=options)
(....)
(Error: could not find a distribution template for Raspbian/buster)
sudo apt-get install build-essential python-dev libsqlite3-dev libreadline6-dev libgdbm-dev zlib1g-dev libbz2-dev sqlite3 zip
(after install 2 newly package)
sudo apt-get install python3 python3-dev
(still back to python3.7)
anyone know how to make it to python3.9?
you have to type this in terminal:
sudo apt install python3.9
but you never can upgrade your Linux python to a newer version. It is internal.
but you can install python3.9 and use virtualenv to use your code in python3.9

How to solve libpq.so.5 Import error when running postgresql on alpine in docker

Hi I am trying to run postgresql in alpine in docker with SQLAlchemy and flask but anytime I run my app I get this error ImportError: Error loading shared library libpq.so.5: No such file or directory (needed by /usr/local/lib/python3.8/site-packages/psycopg2/_psycopg.cpython-38-x86_64-linux-gnu.so)
I have combed stack overflow for a solution but everyone one them seems to tell me to install
psycopg2 which I have done already
FROM python:3.8.1-alpine3.10 AS build
# ENV PYTHONUNBUFFERED 1
WORKDIR /usr/src/app/restful
COPY requirements.txt /usr/src/app/restful
RUN python -m pip install --upgrade pip
RUN apk update && apk upgrade
RUN apk add libffi-dev
#installing dependencies
# dependencies for libpq postgresql-libs postgresql-dev *remove if not
RUN apk add --no-cache --virtual .build-deps gcc libc-dev py-cryptography libpq postgresql-libs postgresql-dev python3-dev musl-dev make openssl-dev gcc
RUN apk update && apk add --no-cache ca-certificates \
&& update-ca-certificates 2>/dev/null || true
RUN apk add build-base python-dev py-pip jpeg-dev zlib-dev
ENV LIBRARY_PATH=/lib:/usr/lib
WORKDIR /usr/src/app/restful
COPY requirements.txt /usr/src/app/restful
COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf
RUN python -m pip install --upgrade pip
RUN pip install -r requirements.txt
RUN pip install gevent
FROM python:3.8.1-alpine3.10
COPY --from=build /usr/local/lib/python3.8/site-packages/ /usr/local/lib/python3.8/site-packages/
RUN mkdir -p /usr/src/app/restful
RUN set -ex && apk --no-cache add sudo
RUN apk --no-cache --update add libffi libressl
RUN apk update && apk add --no-cache supervisor
RUN pip install psycopg2-binary
You seem to be using staged builds in your Dockerfile, and your apk add postgresql-libs is in the first stage. That second FROM stage is building off of a plain python:3.8.1-alpine3.10, not on all the stuff you had done above it, and you're only copying /usr/local/lib/python3.8/site-packages/ over to the second stage. You'll either need to find the full paths of all those dependencies (which could be prohibitively tedious), or just install the dependencies on the second stage as well. Therefore, you need to either build your second stage with FROM build (to include all the other apk deps), or you need to add RUN apk add postgresql-libs gcc libc-dev in the second stage.
So depending on what you're going for, you probably need this:
<...>
RUN pip install -r requirements.txt
RUN pip install gevent
FROM build
RUN mkdir -p /usr/src/app/restful
<...>
or this:
<...>
RUN set -ex && apk --no-cache add sudo
RUN apk --no-cache --update add libffi libressl postgresql-libs gcc libc-dev
RUN apk update && apk add --no-cache supervisor
<...>
This was fixed for me by changing my psycopg2 import to psycopg2-binary.
RUN apt-get update && apt-get install libpq5 -y after calling your build did the trick for me.

how can I upgrade virtualenv?

I installed virtualenv with bootstrapper. here in github
When I run virtualenv --version it shows 1.11.4. But I want to upgrade it to version 1.11.6. I use Linux Mint 17
sudo pip install virtualenv --upgrade

Why doesn't setuptools 1.3.1 appear when I pip freeze?

I am running virtualenvwrapper and friends on Ubuntu 12.04 (virtualenvwrapper 1.7.1.2, virtualenv 1.7.1.2, pip 1.0, Distribute 0.6.24, Python 2.7). To be able to pip install matplotlib I need a newer version of Distribute/setuptools, so I do the following:
$ mkvirtualenv new_venv
$ pip install matplotlib # fails
$ easy_install -U distribute
# installs Distribute 0.7.3 in the venv,
# which then installs setuptools 1.3.1
$ pip install matplotlib # works
However, when I run pip freeze I get:
argparse==1.2.1
distribute==0.7.3 # here's Distribute
matplotlib==1.3.1
nose==1.3.0
numpy==1.8.0
pyparsing==2.0.1
python-dateutil==2.2
six==1.4.1
tornado==3.1.1
wsgiref==0.1.2
Where is setuptools? I've tried just pip install setuptools and it also fails to show up there.
pip won't list packages that pip itself depends on unless you tell it to. You may include such packages by doing:
pip freeze --all
freeze lists packages in a requirements-format - for use in requirements files etc - while list is just that, a list.
See Pip freeze vs. pip list for more details.
On Ubuntu setuptools is installed by the systems package manager. So it is not listed when you pip freeze. While creating a virtualenv, you will get these messages
mkvirtualenv test
New python executable in test/bin/python
Installing setuptools, pip...done.
If you do a pip freeze immediately after this, you will get something like this
argparse==1.2.1
wsgiref==0.1.2
Here setuptools and pip wont be listed.
If you want everything you can do a pip list which gives something like this.
argparse (1.2.1)
pip (1.5.6)
setuptools (3.6)
wsgiref (0.1.2)

Unable to install pyenchant-1.6.5 for python 2.7 on Mac OSX Lion

I am not able to install pyenchant for python 2.7 on my Max OSX Lion. I get an error using the dmg installer. I get an error stating that /opt/local/Library/Frameworks Python 2.7 is required.
My python 2.7 is installed in /Library/Frameworks
That installer you are using is expecting there to be a macports version of python installed ( the /opt location ).
Just try installing it via easy_install or pip
easy_install pyenchant
Or
pip install pyenchant
I was able to install pyenchant on Mac OS X Maverick using non-Homebrew Python by using this procedure. It is likely to work for Mac OS X Mountain Lion as well.
The pyenchant Python library has four prerequisites: gettext, glib, libiconv, and enchant.
Install the first two using Homebrew: brew install gettext and brew install glib
Install the second two using the source code, or using the source from the pyenchant-bdist-osx-source tarball (https://github.com/downloads/rfk/pyenchant/pyenchant-bdist-osx-sources-1.6.5.tar.gz):
tar xzf libiconv-1.3.1.tar.gz
cd libiconv-1.31.1
./configure
make
make install
cd ..
and
tar xzf enchant-1.6.0.tar.gz
cd enchant-1.6.0
./configure
make
make install
cd ..
Now you've got all the prerequisites, so you can install pyenchant directly using setuptools. Download the source tarball (http://pypi.python.org/packages/source/p/pyenchant/pyenchant-1.6.5.tar.gz) and extract it. Now use setup.py to build and install pyenchant:
tar xzf pyenchant-1.6.5.tar.gz
cd pyenchant-1.6.5
python setup.py build
python setup.py install
cd ..
And you should be all finished!