Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gaoqiong
pybind11
Commits
87fa6a43
Commit
87fa6a43
authored
Aug 19, 2019
by
Samuel Debionne
Committed by
Wenzel Jakob
Aug 19, 2019
Browse files
Detect whether we are running in a Conda environment and adjust get_include() (#1877)
parent
046267c6
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
pybind11/__init__.py
pybind11/__init__.py
+8
-0
No files found.
pybind11/__init__.py
View file @
87fa6a43
...
@@ -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
()
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment