osdir.com


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

What's needed for jpegtran in Python 3?


On Fri, Sep 28, 2018 at 3:51 AM Chris Green <cl at isbd.net> wrote:
>
> Chris Angelico <rosuav at gmail.com> wrote:
> > On Fri, Sep 28, 2018 at 2:51 AM Chris Green <cl at isbd.net> wrote:
> > >
> > > I'm converting an existing Python2 program to Python3, it uses
> > > jpegtran and I can't find what to install to get this in Python3.
> > >
> > > Can anyone advise what I need to install in Python3?
> > >
> >
> > Do you mean this?
> >
> > https://pypi.org/project/jpegtran-cffi/
> >
> > I can't find anything called just "jpegtran" for either Py2 or Py3,
> > but that one claims to work on 3.3+ as well as 2.6 and 2.7.
> >
> I think that must be what I have already installed, it doesn't make
> the module available in Python 3, it just says this when I try and
> install it:-
>
>     root at t470:~# pip install jpegtran-cffi
>     Requirement already satisfied: jpegtran-cffi in /usr/local/lib/python2.7/dist-packages
>     Requirement already satisfied: cffi>=0.8 in /usr/lib/python2.7/dist-packages (from jpegtran-cffi)
>     root at t470:~#
>
> Python 3 isn't going to find that is it?

Ah! Correct. What you need to do is use pip from your Python 3
installation. The safest way is:

python3 -m pip install jpegtran-cffi

but you may be able to abbreviate it to just:

pip3 install jpegtran-cffi

ie just change "pip" to "pip3".

ChrisA