Trying to install gRPC python module on Splunk - python-2.7

I am trying to run an external python script "PyClient.py" on Splunk, and it requires the external gRPC module. I installed the gRPC module locally following the quickstart python guide from http://www.grpc.io/docs/quickstart/python.html . The logs generated in the splunkd file are as follows:
06-16-2017 18:20:49.728 +0530 WARN IntrospectionGenerator:resource_usage - RU - Failure executing PDH query, skipping getting iostats data this collection cycle. Status code is -2147481643
06-16-2017 18:20:56.501 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" Traceback (most recent call last):
06-16-2017 18:20:56.501 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" File "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py", line 2, in <module>
06-16-2017 18:20:56.501 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" import grpc
06-16-2017 18:20:56.501 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" File "C:\Program Files\Splunk\etc\apps\Test\bin\grpc\__init__.py", line 37, in <module>
06-16-2017 18:20:56.501 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" from grpc._cython import cygrpc as _cygrpc
06-16-2017 18:20:56.501 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
06-16-2017 18:21:06.502 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" Traceback (most recent call last):
06-16-2017 18:21:06.502 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" File "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py", line 2, in <module>
06-16-2017 18:21:06.502 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" import grpc
06-16-2017 18:21:06.502 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" File "C:\Program Files\Splunk\etc\apps\Test\bin\grpc\__init__.py", line 37, in <module>
06-16-2017 18:21:06.502 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" from grpc._cython import cygrpc as _cygrpc
06-16-2017 18:21:06.502 +0530 ERROR ExecProcessor - message from "python "C:\Program Files\Splunk\etc\apps\Test\bin\pyClient.py"" ImportError: DLL load failed: A dynamic link library (DLL) initialization routine failed.
Does anyone have any suggestions on how to clear this error? Or how to install the external gRPC module on Splunk?
Thanks in advance.

This looks like a 32/64 bit Windows incompatibility.
When installing gRPC, make sure you are explicitly using the Splunk distribution of of Python to pip install grpcio.
C:\Program Files\Splunk\<Python2.7 binary> -m pip install --upgrade pip
C:\Program Files\Splunk\<Python2.7 binary> -m pip install grpcio

I already found the solution. I had to write a wrapper script for my python script which which unset or delete (del) "LD_LIBRARY_PATH" and "PYTHONPATH". For Linux based systems, I also had to unset or delete (del) the "PATH" environment variable.
After following the above steps, Splunk used my local version of Python and the installed modules as well. And it worked. Hope this helps anyone who is trying to use external modules in Splunk but cannot seem to figure out why it does not work. :)

Related

tox tests on python 2.7 -> ImportError: cannot import name ThreadingTCPServer

Running tox on my python project I receive the following error:
ERROR: invocation failed (exit code 1), logfile: /home/project/.tox/py27/log/py27-2.log
============================================================================================================= log start ==============================================================================================================
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Processing ./.tox/.tmp/package/1/hpecp-0.7.12.zip
Installing build dependencies: started
Installing build dependencies: finished with status 'error'
ERROR: Command errored out with exit status 1:
command: /home/project/.tox/py27/bin/python /home/project/.tox/py27/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-UBlzBQ/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel
cwd: None
Complete output (22 lines):
Traceback (most recent call last):
File "/home/theia/.pyenv/versions/2.7.18/lib/python2.7/runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
File "/home/theia/.pyenv/versions/2.7.18/lib/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/home/project/.tox/py27/lib/python2.7/site-packages/pip/__main__.py", line 26, in <module>
sys.exit(_main())
File "/home/project/.tox/py27/lib/python2.7/site-packages/pip/_internal/cli/main.py", line 73, in main
command = create_command(cmd_name, isolated=("--isolated" in cmd_args))
File "/home/project/.tox/py27/lib/python2.7/site-packages/pip/_internal/commands/__init__.py", line 104, in create_command
module = importlib.import_module(module_path)
File "/home/theia/.pyenv/versions/2.7.18/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
File "/home/project/.tox/py27/lib/python2.7/site-packages/pip/_internal/commands/install.py", line 17, in <module>
from pip._internal.cli.req_command import RequirementCommand, with_cleanup
File "/home/project/.tox/py27/lib/python2.7/site-packages/pip/_internal/cli/req_command.py", line 13, in <module>
from pip._internal.cli.base_command import Command
File "/home/project/.tox/py27/lib/python2.7/site-packages/pip/_internal/cli/base_command.py", line 6, in <module>
import logging.config
File "/home/theia/.pyenv/versions/2.7.18/lib/python2.7/logging/config.py", line 46, in <module>
from SocketServer import ThreadingTCPServer, StreamRequestHandler
ImportError: cannot import name ThreadingTCPServer
---------------------------------------
ERROR: Command errored out with exit status 1: /home/project/.tox/py27/bin/python /home/project/.tox/py27/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-UBlzBQ/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- 'setuptools>=40.8.0' wheel Check the logs for full command output.
My tox.ini
[tox]
envlist = py27, py35, py36, py37, py38, py39
skip_missing_interpreters = True
[gh-actions]
python =
2.7: py27
3.5: py35
3.6: py36
3.7: py37
3.8: py38
[testenv]
commands = nosetests {posargs}
deps =
future
jinja2
mock
nose
requests
setenv = TOX_BUILD_DIR = {toxinidir}
[pytest]
addopts = -s
All of the other python versions work ok.
The problem for me was that I had future in the test deps:
[testenv]
commands = nosetests {posargs}
deps =
future
jinja2
mock
nose
requests
setenv = TOX_BUILD_DIR = {toxinidir}
Removing this fixed the problem for me.

Python : Strange multiprocessing function crash in console

I maintain an experimental tool that still python 2.7 that use a bunch of libraries, such as Gdal, shapely, astropy, OpenCV2, scipy, etc. Everything was fine until the system as changed, so virtual environment has been redone and then I have a problem with multiprocessing function.
The most simplified code to reproduce the behaviour:
import multiprocessing
if __name__ == '__main__':
cpus = multiprocessing.cpu_count()
cpus = cpus - 1
pool = multiprocessing.Pool(processes=cpus)
Result #1 with:
Python : VirEnv 2.7 build
Console : Pycharm PyDev console
Traceback (most recent call last): File "", line 1, in
Traceback (most recent call last): File "", line 1,
in File "C:\Python27\Lib\multiprocessing\forking.py", line
380, in main
prepare(preparation_data) File "C:\Python27\Lib\multiprocessing\forking.py", line 504, in prepare
File "C:\Python27\Lib\multiprocessing\forking.py", line 380, in main
file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named input
prepare(preparation_data) File "C:\Python27\Lib\multiprocessing\forking.py", line 504, in prepare
file, path_name, etc = imp.find_module(main_name, dirs) ImportError: No module named input
Why it is looking into "C:\Python27\Lib\multiprocessing\" instead of the VirEnv 2.7 build?
Result #2 with:
Python : VirEnv 2.7 from Anaconda
Console : Pycharm PyDev console
Traceback (most recent call last): File "", line 1, in
File
"C:\Users\_____\AppData\Local\conda\conda\envs\Python_27\lib\multiprocessing\spawn.py",
line 105, in spawn_main
exitcode = _main(fd) File "C:\Users\_____\AppData\Local\conda\conda\envs\Python_27\lib\multiprocessing\spawn.py",
line 114, in _main
prepare(preparation_data) File "C:\Users\_____\AppData\Local\conda\conda\envs\Python_27\lib\multiprocessing\spawn.py",
line 225, in prepare
_fixup_main_from_path(data['init_main_from_path']) File "C:\Users\_____\AppData\Local\conda\conda\envs\Python_27\lib\multiprocessing\spawn.py",
line 277, in _fixup_main_from_path
run_name="mp_main") File "C:\Users\_____\AppData\Local\conda\conda\envs\Python_27\lib\runpy.py",
line 261, in run_path
code, fname = _get_code_from_file(run_name, path_name) File "C:\Users\_____\AppData\Local\conda\conda\envs\Python_27\lib\runpy.py",
line 231, in _get_code_from_file
with open(fname, "rb") as f: OSError: [Errno 22] Invalid argument: 'B:\WorkingSpace\_____\API\'
Result #3 with:
Python : VirEnv 2.7 build
Console : Pycharm terminal
Passed without error
Result #4 with:
Python : VirEnv 2.7 from Anaconda
Console : Pycharm terminal
Passed without error
Result #5 with:
Python : VirEnv 2.7 from Anaconda
Console : Anaconda terminal
Passed without error
So, Pycharm PyDev console seems where only the crash occurs? Why? How to get rid of this?
In addition :
After the console initialization, I have:
B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7\Scripts\python.exe "C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\pydev\pydevconsole.py" --mode=client --port=_____
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['B:\\WorkingSpace\\_____\\API', 'B:/WorkingSpace/_____/API'])
PyDev console: starting.
Python 2.7.16 (v2.7.16:413a49145e, Mar 4 2019, 01:37:19) [MSC v.1500 64 bit (AMD64)] on win32
When I pass the simplified code to reproduce the behaviour, the error "ImportError: No module named " occur in the forking.py which is in the path "C:\Python27\Lib\multiprocessing\".
Sys.path are:
'C:\Program Files\JetBrains\PyCharm Community Edition
2019.2\helpers\pydev',
'C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\third_party\thriftpy',
'C:\Program Files\JetBrains\PyCharm Community Edition 2019.2\helpers\pydev',
'C:\Windows\SYSTEM32\python27.zip',
'B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7\DLLs',
'B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7\lib',
'B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7\lib\plat-win',
'B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7\lib\lib-tk',
'B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7\Scripts',
'C:\Python27\Lib',
'C:\Python27\DLLs',
'C:\Python27\Lib\lib-tk',
'B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7',
'B:\WorkingSpace\_____\API\virEnv_Desktop_V2.7\lib\site-packages',
'B:\WorkingSpace\_____\API',
'B:/WorkingSpace/_____/API'
What happening?

How to fix conda "ResolvePackageNotFound" when building a conda recipe

I downloaded a conda package from github to bring a few modifications and would like to build this local package in a conda environment and test my changes. The problem is that the building of the recipe fails because conda has a conda.exceptions.ResolvePackageNotFound error stating that it does not detect 2 packages, snakemake and fuzzywuzzy.
Here is the meta.yaml file:
package:
name: snakepipes
version: 1.2.1
source:
path: ../
build:
number: 0
noarch: python
requirements:
build:
- python >=3
run:
- python >=3
- pandas
- graphviz
- pyyaml >=5.1
- wget
- snakemake >=5.2.3
- fuzzywuzzy
test:
commands:
- DNA-mapping --help
about:
home: 'https://snakepipes.readthedocs.org'
license: GPL3
summary: NGS processing pipelines from the MPI-IE
license_file: LICENSE.txt
I tried to change the noarch into" generic", to add "pip" in the requirements: build category...
My command line is quite standard: conda build conda-recipe/.
The error message I get is always the same:
No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.11
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Attempting to finalize metadata for snakepipes
INFO:conda_build.metadata:Attempting to finalize metadata for snakepipes
Collecting package metadata: ...working... done
Solving environment: ...working... done
BUILD START: ['snakepipes-1.2.1-py_0.tar.bz2']
Collecting package metadata: ...working... done
Solving environment: ...working... done
Collecting package metadata: ...working... done
Solving environment: ...working... failed
Leaving build/test directories:
Work:
/home/remi/anaconda3/conda-bld/work
Test:
/home/remi/anaconda3/conda-bld/test_tmp
Leaving build/test environments:
Test:
source activate /home/remi/anaconda3/conda-bld/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_plac
Build:
source activate /home/remi/anaconda3/conda-bld/_build_env
Traceback (most recent call last):
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/environ.py", line 753, in get_install_actions
actions = install_actions(prefix, index, specs, force=True)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/plan.py", line 473, in install_actions
txn = solver.solve_for_transaction(prune=prune, ignore_pinned=not pinned)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 107, in solve_for_transaction
force_remove, force_reinstall)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 145, in solve_for_diff
force_remove)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 242, in solve_final_state
ssc = self._run_sat(ssc)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/core/solve.py", line 475, in _run_sat
conflicting_specs = ssc.r.get_conflicting_specs(tuple(final_environment_specs))
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 852, in get_conflicting_specs
reduced_index = self.get_reduced_index(specs)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/common/io.py", line 88, in decorated
return f(*args, **kwds)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 356, in get_reduced_index
specs, features = self.verify_specs(specs)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda/resolve.py", line 244, in verify_specs
raise ResolvePackageNotFound(bad_deps)
conda.exceptions.ResolvePackageNotFound:
- fuzzywuzzy
- snakemake[version='>=5.2.3']
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/remi/anaconda3/bin/conda-build", line 11, in <module>
sys.exit(main())
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 456, in main
execute(sys.argv[1:])
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/cli/main_build.py", line 447, in execute
verify=args.verify, variants=args.variants)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/api.py", line 208, in build
notest=notest, need_source_download=need_source_download, variants=variants)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 2314, in build_tree
notest=notest,
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1397, in build
create_build_envs(m, notest)
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1281, in create_build_envs
raise e
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/build.py", line 1271, in create_build_envs
channel_urls=tuple(m.config.channel_urls))
File "/home/remi/anaconda3/lib/python3.7/site-packages/conda_build/environ.py", line 755, in get_install_actions
raise DependencyNeedsBuildingError(exc, subdir=subdir)
conda_build.exceptions.DependencyNeedsBuildingError: Unsatisfiable dependencies for platform linux-64: {"snakemake[version='>=5.2.3']", 'fuzzywuzzy'}
Do you know how to fix this ?
The problem is that you need to add conda channels that have the appropriate packages. You can search at https://anaconda.org for channels that have the packages you need.
In this case, it seems like bioconda has the snakemake package and conda-forge has fuzzywuzzy so you should be able to do
conda build -c conda-forge -c bioconda conda-recipe/

Apache WSGI permission error using django logging on production server

Here is some software information
Django 1.8.1
Apache2
Fedora 21
error_log output
mod_wsgi (pid=8272): Target WSGI script '/var/www/anime/anime/wsgi.py' cannot be loaded as Python module.
mod_wsgi (pid=8272): Exception occurred processing WSGI script '/var/www/anime/anime/wsgi.py'.
Traceback (most recent call last):
File "/usr/lib64/python3.4/logging/config.py", line 557, in configure
handler = self.configure_handler(handlers[name])
File "/usr/lib64/python3.4/logging/config.py", line 725, in configure_handler
result = factory(**kwargs)
File "/usr/lib64/python3.4/logging/__init__.py", line 999, in __init__
StreamHandler.__init__(self, self._open())
File "/usr/lib64/python3.4/logging/__init__.py", line 1023, in _open
return open(self.baseFilename, self.mode, encoding=self.encoding)
PermissionError: [Errno 13] Permission denied: '/var/www/anime/log/info.log'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/var/www/anime/anime/wsgi.py", line 16, in <module>
application = get_wsgi_application()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/core/wsgi.py", line 14, in get_wsgi_application
django.setup()
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/__init__.py", line 17, in setup
configure_logging(settings.LOGGING_CONFIG, settings.LOGGING)
File "/opt/virtualenvs/django_project/lib64/python3.4/site-packages/django/utils/log.py", line 86, in configure_logging
logging_config_func(logging_settings)
File "/usr/lib64/python3.4/logging/config.py", line 789, in dictConfig
dictConfigClass(config).configure()
File "/usr/lib64/python3.4/logging/config.py", line 565, in configure
'%r: %s' % (name, e))
ValueError: Unable to configure handler 'file': [Errno 13] Permission denied: '/var/www/anime/log/info.log'
Here is the permission mask on the file
drwxrwxrwx. 2 apache apache 21 May 28 15:22 .
drwxr-xr-x. 6 apache apache 90 May 28 14:53 ..
-rwxrwxrwx. 1 apache apache 0 May 28 15:22 info.log
I have already searched SOF on all the possible solutions and none of them works. Therefore I suspect that it has something to do with SELinux setting? If it is, can someone tell me which flag do i need to set to true?
After reading up on SELinux, I have figured out the solution for this permission error. And I hope that it will help the others who have encountered similar situation when deploying on production server under RHEL linux.
Basically running the command ls -Z shows the following
drwxr-xr-x. apache apache unconfined_u:object_r:httpd_sys_content_t:s0 log
the folder is labelled with httpd_sys_content_t which does not allow httpd to have write access the the folder. Therefore we need to change this label to httpd_sys_rw_content_t
Firstly, we need to add an entry to the fcontext to inform SELinux what is the default label for files, that will be created, in this folder.
sudo semanage fcontext -a -t httpd_sys_rw_content_t "/path/to/directory(/.*)?"
This will add an entry to the fcontext file (/etc/selinux/targeted/contexts/files/file_contexts.local)
Next we need to update all the labels of the files in the folder using restorecon.
sudo restorecon -R -v /path/to/directory
And now the permission error related to the django logging will be gone from the httpd error_log =)

error processing python2.7-minimal

The latest apt-get upgrade failed with:
Setting up python2.7-minimal (2.7.3-0ubuntu3.4) ...
Traceback (most recent call last):
File "/usr/local/lib/python2.7/site.py", line 563, in <module>
main()
File "/usr/local/lib/python2.7/site.py", line 545, in main
known_paths = addusersitepackages(known_paths)
File "/usr/local/lib/python2.7/site.py", line 278, in addusersitepackages
user_site = getusersitepackages()
File "/usr/local/lib/python2.7/site.py", line 253, in getusersitepackages
user_base = getuserbase() # this will also set USER_BASE
File "/usr/local/lib/python2.7/site.py", line 243, in getuserbase
USER_BASE = get_config_var('userbase')
File "/usr/local/lib/python2.7/sysconfig.py", line 520, in get_config_var
return get_config_vars().get(name)
File "/usr/local/lib/python2.7/sysconfig.py", line 419, in get_config_vars
_init_posix(_CONFIG_VARS)
File "/usr/local/lib/python2.7/sysconfig.py", line 298, in _init_posix
raise IOError(msg)
IOError: invalid Python installation: unable to open /usr/local/include/python2.7 /pyconfig.h (No such file or directory)
dpkg: error processing python2.7-minimal (--configure):
subprocess installed post-installation script returned error exit status 1
Processing triggers for libc-bin ...
ldconfig deferred processing now taking place
Errors were encountered while processing:
python2.7-minimal
A reinstall of python2.7-minimal fails as /usr/local/include/python2.7/pyconfig.h is not found. I have alternative installs:
root#ely:~# sudo update-alternatives --config python
There are 2 choices for the alternative python (providing /usr/bin/python).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/python2.7 60 auto mode*
1 /usr/bin/python2.7 60 manual mode
2 /usr/bin/python3 40 manual mode
root#ely:~# whereis python
python: /usr/bin/python3.2mu /usr/bin/python2.7 /usr/bin/python2.7-config /usr/bin
/python /usr/bin/python3.2 /usr/bin/python2.7-dbg-config /usr/bin/python2.7-dbg
/etc/python2.7 /etc/python /etc/python3.2 /usr/lib/python2.7 /usr/lib/python3.2 /usr/bin
/X11/python3.2mu /usr/bin/X11/python2.7 /usr/bin/X11/python2.7-config /usr/bi/X11/python
/usr/bin/X11/python3.2 /usr/bin/X11/python2.7-dbg-config /usr/bin/X11/python2.7-dbg
/usr/local/bin/python3.2m /usr/local/bin/python2.7 /usr/local/bin/python3.2m-config
/usr/local/bin/python2.7-config /usr/local/bin/python3.2 /usr/local/bin/python3.2-config
/usr/local/lib/python2.7 /usr/local/lib/python3.2 /usr/include/python3.2mu /usr/include
/python2.7 /usr/include/python2.7_d /usr/include/python3.2 /usr/include/python3.2_d
/usr/share/python /usr/share/man/man1/python.1.gz
But pyconfig.h is only found in /usr/include/python*.*/ (as it should be?)
What is going on? How to fix (installs of other packages are affected)? Thanks.
reinstall python on ubuntu IOError: invalid Python installation: unable to open /usr/local/include/python2.7 , and then look /pyconfig.h not found , you need install this file and add it when it request you to add it