Improve detection of virtual env.
This commit is contained in:
1 parent
b96f7657e6
commit
257deabbbe
3 files changed
+7
-2
No files matched your search
@@ -128,6 +128,7 @@ date of first contribution):
|
||||
* [Charlie Powell](https://github.com/cp2004)
|
||||
* [Ollis Git](https://github.com/OllisGit)
|
||||
* [Sophist](https://github.com/Sophist-UK)
|
||||
* [Manuel McLure](https://github.com/ManuelMcLure)
|
||||
|
||||
OctoPrint started off as a fork of [Cura](https://github.com/daid/Cura) by
|
||||
[Daid Braam](https://github.com/daid). Parts of its communication layer and
|
||||
|
||||
@@ -544,7 +544,9 @@ class LocalPipCaller(PipCaller):
|
||||
import sys
|
||||
from distutils.sysconfig import get_python_lib
|
||||
|
||||
virtual_env = hasattr(sys, "real_prefix")
|
||||
virtual_env = hasattr(sys, "real_prefix") or (
|
||||
hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix
|
||||
)
|
||||
install_dir = get_python_lib()
|
||||
writable = os.access(install_dir, os.W_OK)
|
||||
|
||||
|
||||
@@ -29,7 +29,9 @@ def produce_output(stream):
|
||||
cmd.finalize_options()
|
||||
|
||||
install_dir = cmd.install_lib
|
||||
virtual_env = hasattr(sys, "real_prefix")
|
||||
virtual_env = hasattr(sys, "real_prefix") or (
|
||||
hasattr(sys, "base_prefix") and sys.base_prefix != sys.prefix
|
||||
)
|
||||
writable = os.access(install_dir, os.W_OK)
|
||||
|
||||
lines = [
|
||||
|
||||
Reference in new issue
Block a user