Skip to content

Commit fc0c008

Browse files
authored
Merge pull request #4004 from ales-erjavec/fixes/conda-installer-sitecustomize
[FIX] Conda Installer: Restore compatibility with latest anaconda python
2 parents cc57ae4 + 65942cd commit fc0c008

File tree

3 files changed

+31
-0
lines changed

3 files changed

+31
-0
lines changed

scripts/windows/build-conda-installer.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,4 +373,5 @@ cp "${CACHEDIR:?}/miniconda/Miniconda3-${MINICONDA_VERSION}-Windows-${CONDAPLATT
373373

374374
mkdir -p "${BASEDIR:?}/icons"
375375
cp scripts/windows/{Orange.ico,OrangeOWS.ico} "${BASEDIR:?}/icons"
376+
cp "$(dirname "$0")"/sitecustomize.py "${BASEDIR:?}"/conda-pkgs
376377
make-installer

scripts/windows/condainstall.bat

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,6 @@ if not exist "%ACTIVATE_BAT%" (
5959
echo @echo off > "%ACTIVATE_BAT%"
6060
echo call "%CONDA_BASE_PREFIX%\Scripts\activate.bat" "%PREFIX%" >> "%ACTIVATE_BAT%"
6161
)
62+
63+
rem # install custom sitecustomize module
64+
copy sitecustomize.py "%PREFIX%\Lib\

scripts/windows/sitecustomize.py

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#
2+
# sitecustomize added by orange3 installer.
3+
#
4+
# (Ana)conda python distribution expects it is 'activated', it does not really
5+
# support unactivated invocations (although a similar facility to this was
6+
# included in anaconda python 3.6 and earlier).
7+
8+
import sys
9+
import os
10+
11+
12+
def normalize(path):
13+
return os.path.normcase(os.path.normpath(path))
14+
15+
16+
extra_paths = [
17+
r"Library\bin",
18+
]
19+
20+
paths = os.environ.get("PATH", "").split(os.path.pathsep)
21+
paths = [normalize(path) for path in paths]
22+
23+
for path in extra_paths:
24+
path = os.path.join(sys.prefix, path)
25+
26+
if os.path.isdir(path) and normalize(path) not in paths:
27+
os.environ["PATH"] = os.pathsep.join((path, os.environ.get("PATH", "")))

0 commit comments

Comments
 (0)