Having trouble installing Python bindings of jq on ubuntu linux - python

I have been trying to install the Python bindings of jq on ubuntu using pip.
However, when I run the following command, it fails.
sudo pip install jq
This is the error message it get.
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-EmO25q/jq/setup.py';exec(compile(getattr(tokenize, 'open', open)
(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-RBT2h7-record/install-record.txt --single-version-externally-m
anaged --compile" failed with error code 1 in /tmp/pip-build-EmO25q/jq/

This gets compiled, you need to install the build dependencies.
apt-get install autoconf automake build-essential libtool python-dev
See the Pypi page for more info ... https://pypi.python.org/pypi/jq/0.1.6

Related

Ubuntu16 cannot install pyheif

I'm trying to install pyheif to use heic files on Linux server.
pyheif: https://pypi.org/project/pyheif/
Linux library command:
sudo apt-get install python3 python3-dev build-essential libssl-dev libffi-dev libxml2-dev libxslt1-dev zlib1g-dev python3-pip
sudo apt-get install libpcap-dev libpq-dev
apt install libffi6 libheif-dev libde265-dev <-- I cannot find libffi. only libffi6 is available.
Now then I try to install pyheif
pip3 install pyheif
TRACEBACK:
...long lines ...
build/temp.linux-x86_64-3.6/_libheif_cffi.c: In function ‘_cffi_d_heif_context_read_from_memory_without_copy’:
build/temp.linux-x86_64-3.6/_libheif_cffi.c:2375:1: warning: control reaches end of non-void function [-Wreturn-type]
}
^
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-pfesa6xd/pyheif/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-me_rlsh8-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-pfesa6xd/pyheif/
How can I install pyheif?
How can I solve that tracebacks.
https://github.com/carsales/pyheif/issues/44
We can install from wheel anyway. The problem why wheel was not used was matching the tags (manylinux), in particular pip was missing the cp36-cp36m-manylinux2014_x86_64 (had only cp36-cp36m-manylinux2010_x86_64). This was due to an older version of pip (19.2), rather than 19.3.
pip install -U pip
pip install pyheif

spacy is not getting installed

When I install spacy with pip it download a bunch of files but at the end this error comes and spacy is not getting installed although setuptools is installed.
Command "/usr/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-jugolqe4/murmurhash/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-record-fwk4l5m8/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-install-jugolqe4/murmurhash/
A lot of parts of spaCy are written in Cython for improved performance. Thus, in order to use spaCy library you need a C compiler to compile Cython code.
You could try running the following commands in your terminal and then retry installing spacy.
sudo apt-get update
sudo apt-get upgrade
sudo apt-get install build-essential
gcc -v
make -v

"pip install jq" generates errors on Mac and Windows

Duplicate of this issue, but the first answer there is wrong (jq is supported on Windows) and the second refers to brew so I'm guessing is for Mac.
Windows
I am trying to install jq for python from the Windows command line, but get the following errors, possibly due to a missing temp\pip-build-rtnhmg\jq\onig-install-5.9.6 file:
error: [Error 2] The system cannot find the file specified
... and ...
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\
Does anyone know what's gone wrong here? Searches on StackOverflow and Google aren't giving me much to go on, and I'm not great with Windows and still new to python/pip.
Here is the full text, minus username:
Microsoft Windows [Version 10.0.14393]
(c) 2016 Microsoft Corporation. All rights reserved.
C:\WINDOWS\system32>pip install jq
Collecting jq
Using cached jq-0.1.6.tar.gz
Building wheels for collected packages: jq
Running setup.py bdist_wheel for jq ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d c:\users\<USERNAME>\appdata\local\temp\tmpuvrf_upip-wheel- --python-tag cp27:
running bdist_wheel
running build
running build_ext
Executing: ./configure CFLAGS=-fPIC --prefix=c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\onig-install-5.9.6
error: [Error 2] The system cannot find the file specified
----------------------------------------
Failed building wheel for jq
Running setup.py clean for jq
Failed to build jq
Installing collected packages: jq
Running setup.py install for jq ... error
Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
Executing: ./configure CFLAGS=-fPIC --prefix=c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\onig-install-5.9.6
error: [Error 2] The system cannot find the file specified
----------------------------------------
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\
Trying to install pyjq instead generates the same errors.
I'm not married to jq: I just need to format json data in python, and jq does a great job on the command line. If there are other python packages I should try instead, please feel free to recommend them. As mentioned above though, pyjq is failing install with the same errors.
Further details / steps taken:
I am on Windows 10 and have installed python 2.7.13, setuptools and pip using the steps from here ... no issues noted.
Using pip, I have successfully installed other python packages such as request and jira ... no issues noted.
Using chocolatey I have successfully installed jq for the command line, following these steps ... no issues noted.
I have tried using regular permissions, running cmd as administrator, starting a new cmd session, restarting the PC - but get the same errors.
Trying to install pyjq (pip install pyjq) generates the same errors.
Tried pip install jq on a Mac and got similar errors:
Command "/usr/local/opt/python/bin/python2.7 -u -c "import setuptools, tokenize;__file__='/private/var/folders/v5/4x0py0ns2td1h69vgllx7dpr0000gn/T/pip-build-DyMoT4/jq/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /var/folders/v5/4x0py0ns2td1h69vgllx7dpr0000gn/T/pip-i6UKvt-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/v5/4x0py0ns2td1h69vgllx7dpr0000gn/T/pip-build-DyMoT4/jq/
for the Mac, followed the steps suggested from here and successfully installed setuptools as suggested, but pip install jq still fails with the same error.
Installing via pip
As per jq installation steps for pip's project:
Installation requires any programs required to build jq. This includes:
Autoreconf
The normal C compiler toolchain, such as gcc and make.
libtool
Python headers.
macOS
On macOS, you need XCode to be installed, and the following packages:
brew install autoconf automake libtool
brew install jq
Linux
You need the following packages to be installed:
yum install autoconf automake libtool python

Pillow instillation field with python3.2 django1.8

I'm working with a django project and now I want to add an image field, django asked me to install Pillow with the command "pip install Pillow",
thie problem is when I run this command, and this one also "sudo install Pillow" I get the message:
gcc: error: build/temp.linux-x86_64-3.2/libImaging/BoxBlur.o: No such file or directory
error: command 'gcc' failed with exit status 1
----------------------------------------
Command "/usr/bin/python3.2 -c "import setuptools, tokenize;__file__='/tmp/pip-build-otvko5/Pillow/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5430vf-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-otvko5/Pillow
I have tried all the ways that I found on the internet as well as the other ways to install Pillow such as easy_install, but each time I get a new problem.
Try to run the below commands in your linux
sudo apt-get update
sudo apt-get install python-dev
sudo apt-get install libevent-dev
Try this:
sudo apt-get install python-pil

Python3 can't install bcrypt

When i try to install bcrypt, with python3 -m pip install bcrypt,
i get this :
`Command /usr/bin/python3 -c "import setuptools, tokenize;file='/tmp/pip-build-vhc0qtab/bcrypt/setup.py';exec(compile(getattr(tokenize, 'open', open)(file).read().replace('\r\n', '\n'), file, 'exec'))" install --record /tmp/pip-v9cb4je7-record/install-record.txt --single-version-externally-managed --compile --user failed with error code 1 in /tmp/pip-build-vhc0qtab/bcrypt
Storing debug log for failure in /home/vkristof/.pip/pip.log
The debug log:
http://pastebin.com/UEa3WEG3
one of the error messages states, that libffi is missing. on a debian-like system you could try $ sudo apt-get install libffi6 libffi-dev.

Categories

Resources