How to install package from github - github

I would like to use psd-tools package from github.
Given I am not a programer, I found the installation process difficult to follow.
Can someone advice in simple terms how to install and use the psd-tool package.
Apparently, this is all done via the terminal in OSX.
If I understand correctly the package requires python, pip, pillow and packbits to run correctly.
Python is pre installed in OSX. Pip and packbits need to be installed. This where I start to get lost with the installation procedure.
Once the psd-tools package is installed, I am not sure how to call the package to test a psd file.
github psd-tools package

Download Python package for working with Adobe Photoshop PSD files
Installation
pip install psd-tools
Pillow should be installed if you want work with PSD image and layer data: export images to PNG, process them. PIL library should also work.
pip install Pillow
Note
In order to extract images from 32bit PSD files PIL/Pillow must be built with LITTLECMS or LITTLECMS2 support.
psd-tools also has a rudimentary support for Pymaging. Pymaging installation instructions are available in pymaging docs. If you want to use Pymaging instead of Pillow you'll also need packbits library:
pip install packbits
Usage of PSD-Tools and How to use it Read this.
Hope it Helps!

Related

How to install pre-built Pillow wheel with libraqm DLLs on Windows?

I tried using the pre-built wheels for Pillow and corresponding libraqm DLL from here:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow
But the following returns False:
from PIL import features
features.check('raqm')
Am I missing anything?
Context: I need libraqm with Pillow to work with complex fonts on images, as shown here.
For anyone who wants RAQM with PIL on Windows, just do pip install Pillow.
Then place the libraqm DLLs in some directory, and then append that directory to environment/shell variable PYTHONPATH. That's it.
Or you could place those DLLs along with your python.exe as commented by #cgohlke.
Just in-case someone wants to know, I'm currently on Python 3.7 (Windows 10) with Pillow 7.2.0 and libraqm-0.7.0.dll

Installing SciPy without Anaconda on Windows: how to fix "no lapack/blas" error?

Is there an option to install SciPy on Windows without installing Anaconda as well? I could not do it via pip and everywhere it says to use Anaconda.
More details:
I want the SciPy package without any additional programs like Python(x, y) or Canopy.
The error with pip is: numpy.distutils.system_info.NotFoundError: no lapack/blas resources found. From research I found that I need to use additional packages but it sounds strange to me. I couldn't install LAPACK or BLAS.
There are unofficial builds: http://www.lfd.uci.edu/~gohlke/pythonlibs. Here's a link to scipy: http://www.lfd.uci.edu/~gohlke/pythonlibs#scipy
You can proceed with installing numpy or scipy using pip, after you install lapack and blas, which are system libraries. It shouldn't be very hard, but depends on you OS.
For RedHat/CentOS/Fedora this could be done with:
yum install lapack lapack-devel blas blas-devel
The packages can be found e.g. in CentOS base repository.
However, the scikit-learn website says as follows:
We don’t recommend installing scipy or numpy using pip on linux, as this will involve a lengthy build-process with many dependencies. Without careful configuration, building numpy yourself can lead to an installation that is much slower than it should be. If you are using Linux, consider using your package manager to install scikit-learn. It is usually the easiest way, but might not provide the newest version. If you haven’t already installed numpy and scipy and can’t install them via your operation system, it is recommended to use a third party distribution.
Package managers are usually yum or apt-get and again on RedHat/CentOS/Fedora you can skip using pip and install this way:
yum install scipy
Third party distributions mentioned above are things like anaconda or Python(x,y).

pip install from github doesn't install everything

I want to install a python package from github. It seems that pip install https://github.com/codelucas/newspaper/archive/python-2-head.zip is the way to go. However, this only installs the python files you can find here without the other folders. The package breaks because of this.
If I run pip install newspaper (which refers to the same code) the other repos are correctly installed.
I could not get if the problem is coming from pip or the package I'm trying to save (I'm kind of new to python packaging :)
The reason I don't want to use pip install newspaper is that I'm working on a fork of that code that I want to pull from github to my server directly. I have the same problem with my fork.
You can install the latest snapshot from the github repository with the following command
pip install git+https://github.com/codelucas/newspaper.git
You can find further information in the corresponding section in pip's documentation.

Installing Python Imaging Library on my iPhone's Python interpreter

I've been learning python for some time now. Recently I needed to install in my Mac the Image module for Python, and after a while I achieve this running a mpkg installer specially for my OS, so far everything was ok and I could run my script.
Now I'm in the needing of running my script in my jailbroken iPhone, which already has a python interpreter, and I need to install this Image module again but this time on my phone.
Is there another way to do it? How can I do it manually?
I found out how
I downloaded the PIL 1.1.7 source from http://www.pythonware.com/products/pil/ and untared the Imaging-1.1.7.tar.gz file, then I made the following commands:
cd Imaging-1.1.7/
python setup.py install
You can also follow the instructions on the README file in Imaging-1.1.7/ for building the package on your own.
that's it

How to install PIL in system library using homebrew?

In a new SnowLeopard install, I'd like to use homebrew to install PIL. However the recipe installs PIL under cellar instead of in /Library/Python/2.6/site-packages. Is there a way to change the install directory?
Instead of installing pip and another PIL, you can just make a symlink
brew install pil
ln -s /usr/local/Cellar/pil/1.1.7/lib/python2.7/site-packages/PIL /Library/Python/2.7/site-packages/PIL
Tested on Lion, on Snow Leopard, you may need to change paths to use /python2.6 /Python/2.6.
It seems that Pillow replaced PIL in homebrew. The new command is:
brew install Homebrew/python/pillow
Since there seems to be no "accepted" way of installing homebrew eggs into the system site-packages, here is what I ended up doing:
% brew install pil
% easy_install pip
% pip install pil
The homebrew install grabs and installs all of PIL's dependencies (especially jpeg). The later easy_install then uses them when compiling PIL for the system site-packages. Freetype support doesn't show up in the "easy-installed" version, but that's fine for my purposes.
As my initial goal was to provide a simple way for a web designer to build a django development environment, having an unused homebrew PIL installed is not really a problem.
Hope this helps someone. Still hoping there's a better answer out there.
As #BarnabasSzabolcs mentioned, newer versions named pillow.
an alternative to brew install Homebrew/python/pillow is pip install pillow. You may need to add sudo, depends on your python environment permissions.
p.s.
that answer could be fit better as a comment, 14 credits to go...