ThisNameNotUsed
Posts: 4
Joined: Tue Feb 02, 2016 8:36 pm

subprocess32?

Wed Apr 13, 2016 7:14 pm

I am a Computer Science student but new to a lot this stuff. I am trying to get it as right as possible.

On python's subprocess doc (https://docs.python.org/2/library/subprocess.html) they mention subprocess32 being the best of the best for linux but I can't "sudo apt-get install python-subprocess32" and when I use "pip install subprocess32" I get this output:

Code: Select all

Downloading/unpacking subprocess32
  Downloading subprocess32-3.2.7.tar.gz (54kB): 54kB downloaded
  Running setup.py (path:/tmp/pip-build-R0XG2J/subprocess32/setup.py) egg_info for package subprocess32
    
    warning: no files found matching '*.h'
    no previously-included directories found matching 'build'
    no previously-included directories found matching 'dist'
    no previously-included directories found matching '.hg*'
Installing collected packages: subprocess32
  Running setup.py install for subprocess32
    building '_posixsubprocess' extension
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _posixsubprocess.c -o build/temp.linux-armv6l-2.7/_posixsubprocess.o
    _posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory
     #include "Python.h"
                        ^
    compilation terminated.
    error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1
    Complete output from command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-R0XG2J/subprocess32/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-AUFd90-record/install-record.txt --single-version-externally-managed --compile:
    running install

running build

running build_py

creating build

creating build/lib.linux-armv6l-2.7

copying subprocess32.py -> build/lib.linux-armv6l-2.7

running build_ext

building '_posixsubprocess' extension

creating build/temp.linux-armv6l-2.7

arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/python2.7 -c _posixsubprocess.c -o build/temp.linux-armv6l-2.7/_posixsubprocess.o

_posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory

 #include "Python.h"

                    ^

compilation terminated.

error: command 'arm-linux-gnueabihf-gcc' failed with exit status 1

----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-R0XG2J/subprocess32/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-AUFd90-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-R0XG2J/subprocess32
Storing debug log for failure in /home/pi/.pip/pip.log
Am I missing something?

DirkS
Posts: 10371
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK

Re: subprocess32?

Wed Apr 13, 2016 9:22 pm

Code: Select all

_posixsubprocess.c:3:20: fatal error: Python.h: No such file or directory
You need to install python-dev (or python3-dev for Python 3)

Code: Select all

sudo apt-get update
sudo apt-get install python-dev
sudo aptget install python3-dev
BTW: pip also needs admin permssions:

Code: Select all

sudo pip install subprocess32
.

ThisNameNotUsed
Posts: 4
Joined: Tue Feb 02, 2016 8:36 pm

Re: subprocess32?

Sat Apr 16, 2016 8:20 pm

Thank you very much.

Return to “Python”