Commit 87fa6a43 by Samuel Debionne Committed by Wenzel Jakob

Detect whether we are running in a Conda environment and adjust get_include() (#1877)

parent 046267c6
...@@ -10,9 +10,17 @@ def get_include(user=False): ...@@ -10,9 +10,17 @@ def get_include(user=False):
virtualenv = hasattr(sys, 'real_prefix') or \ virtualenv = hasattr(sys, 'real_prefix') or \
sys.prefix != getattr(sys, "base_prefix", sys.prefix) sys.prefix != getattr(sys, "base_prefix", sys.prefix)
# Are we running in a conda environment?
conda = os.path.exists(os.path.join(sys.prefix, 'conda-meta'))
if virtualenv: if virtualenv:
return os.path.join(sys.prefix, 'include', 'site', return os.path.join(sys.prefix, 'include', 'site',
'python' + sys.version[:3]) 'python' + sys.version[:3])
elif conda:
if os.name == 'nt':
return os.path.join(sys.prefix, 'Library', 'include')
else:
return os.path.join(sys.prefix, 'include')
else: else:
dist = Distribution({'name': 'pybind11'}) dist = Distribution({'name': 'pybind11'})
dist.parse_config_files() dist.parse_config_files()
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment