@@ -546,5 +546,24 @@ if [[ "$target_platform" == linux-* ]]; then
546546 rm ${PREFIX} /include/uuid.h
547547fi
548548
549- # See ${RECIPE_DIR}/sitecustomize.py
550- cp " ${RECIPE_DIR} /sitecustomize.py" " ${PREFIX} /lib/python${VERABI_NO_DBG} /sitecustomize.py"
549+ # Workaround for https://github.com/conda/conda/issues/14053
550+ # Older conda versions install noarch: python packages in wrong places.
551+ # For example python3.1 because older conda assumed python minor version
552+ # will have only one digit. noarhc pkgs for freethreading builds are supposed
553+ # to be installed into <prefix>/lib/python3.13t/site-packages, but conda
554+ # installs them to <prefix>/lib/python3.13/site-packages.
555+ # The workaround is to add all these wrong paths to sys.path using
556+ # a pth file so that cpython and other tools like pip know about these
557+ # locations to check when importing packages and uninstalling packages.
558+ # When installing packages, pip will use the correct location
559+ # <prefix>/lib/python3.13t/site-packages.
560+ # Note that these directories are not added to sys.path if they do not exist.
561+ SP_DIR=" ${PREFIX} /lib/python${PY_VER}${THREAD} /site-packages"
562+ if [[ ${PY_FREETHREADING} == yes ]]; then
563+ echo " ${PREFIX} /lib/python${PY_VER} /site-packages" >> $SP_DIR /conda-site.pth
564+ fi
565+ # Workaround for https://github.com/conda/conda/issues/10969
566+ echo " ${PREFIX} /lib/python3.1/site-packages" >> $SP_DIR /conda-site.pth
567+ # A python version independent directory that ABI3 and noarch packages can use.
568+ # This is unused at the moment, but keeping it here for experimentation.
569+ echo " ${PREFIX} /lib/python/site-packages" >> $SP_DIR /conda-site.pth
0 commit comments