29

I'd like to deploy Python to non-programmers in my organization such that the install process consists entirely of syncing a directory from Perforce and maybe running one batch file that sets up environment variables.

Is it possible to package up Miniconda in such a way it can be "installed" just by copying down a directory? What does its installer do?

The reason for this is that I'd like to automate certain tasks for our artists by providing them with Python scripts they can run from the commandline. But I need to get the interpreter onto their machines without having to run any kind of installer or uninstaller, or any process that can fail in a non-idempotent way. A batch file that sets up env vars is fine, because it is idempotent. An installer that can fail partway through and put the workstation into a state requiring intervention to fix is not.

In particular, adding a library to everyone's install should consist of my using conda on my desk, checking the ensuing directory into P4, and then letting artists pick it up automatically with their next p4 sync.

I looked at WinPython, but at 1.4GB it is too large. Portable Python is defunct.

We are exclusively a Windows shop, so do not need Linux- or Mac-portable solutions.

Julian
  • 154
  • 1
  • 11
Crashworks
  • 40,496
  • 12
  • 101
  • 170

3 Answers3

23

You can use the silent install mode to create a fully portable Miniconda install (250MB for v.4.3.21 windows x64).

Miniconda3-latest-Windows-x86_64.exe /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1

(Solution found in this issue)

Community
  • 1
  • 1
FabienP
  • 3,018
  • 1
  • 20
  • 25
  • 1
    I think Crashworks was talking about Anaconda (Python Distribution) and not Miniconda. – Royi Nov 07 '17 at 21:07
  • 4
    @Royi, well, the question explicitly mentions Miniconda "`Is it possible to package up Miniconda [...]`" so I don't understand your comment. BTW Miniconda is the same as Anaconda, but with minimal packages included for the Python distribution (`[...] Miniconda, a mini version of Anaconda that includes only conda and its dependencies.`, from [conda docs](https://conda.io/docs/user-guide/install/index.html)) – FabienP Nov 07 '17 at 21:16
  • I installed Miniconda on my `P:` drive using `.\Miniconda2-latest-Windows-x86_64.exe /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /S /D=P:\tools\miniconda2`. However, `conda info` shows that some files / folders still point to my `C:` drive. How do I get Miniconda to be 100% self-contained and portable? – Jack Jan 24 '19 at 08:58
  • @Jack did you tried with `/NoRegistry=1`? This is not mentioned in the doc, should but allow to make it portable. – FabienP Jan 24 '19 at 15:17
  • I completely removed conda and all its leftovers in my user's home directory and reinstalled using `.\Miniconda2-latest-Windows-x86_64.exe /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=P:\tools\miniconda2 | Out-Null`. I assume the result is portable, however, `conda info` still includes three locations in my user's home folder: `package cache : P:\tools\miniconda2\pkgs C:\Users\q367465\AppData\Local\conda\conda\pkgs envs directories : P:\tools\miniconda2\envs C:\Users\q367465\AppData\Local\conda\conda\envs C:\Users\q367465\.conda\envs`. – Jack Jan 28 '19 at 09:40
  • Well, it looks ok to me, conda detects pkgs cache and envs dir from your previous install, and some place in user's home. These are just paths where conda will look for pkgs or environments, but as long as one exists it is ok, so with P:\tools\miniconda2 paths referenced first for both I think your install actually is fully portable. – FabienP Jan 28 '19 at 09:52
  • This works fine as a portable install. To access `conda` from `Windows Command Prompt`, I had to add these 3 paths to the user account PATH variable: `%USERPROFILE%\Desktop\portable\Python\miniconda3\Scripts`, `%USERPROFILE%\Desktop\portable\Python\miniconda3`, `%USERPROFILE%\Desktop\portable\Python\miniconda3\Library\bin`, and I deleted the `Anaconda3 (64-bit)` folder from the `Windows Start Menu` via `%AppData%\Microsoft\Windows\Start Menu\Programs` and `%ProgramData%\Microsoft\Windows\Start Menu\Programs` – thanks_in_advance Sep 09 '20 at 22:34
  • @Jack Thanks for example, but | Out-Null didn't work or me. – WebComer Apr 24 '21 at 16:51
  • I've tried it with Anaconda3-2020.11-Windows-x86_64.exe. There is a bug in the installer - if option /S wasn't provided, it starts gui installer and ignores /P switch( – WebComer Apr 24 '21 at 16:53
  • I just wanted to get install log, and it turned out immediately. – WebComer Apr 25 '21 at 09:05
  • @thanks_in_advance, did you manage to place folders like .jupiter, .condarc etc place in a portable location? – WebComer Apr 25 '21 at 09:07
  • @WebComer I installed Jupyter via `conda install jupyter notebook`. Jupyter works and is portable (if I move the `miniconda3` folder, Jupyter moves with it. There are multiple Jupyter subfolders at various locations under the `miniconda3` folder. I don't see any `.jupyter` folder, but that may be because I'm using Windows, no Linux). – thanks_in_advance Apr 27 '21 at 04:20
  • These instructions are Windows-specific, as Linux installer doesn't have these options. Does anyone know how to achieve portable installation on Linux? – Dmitry z Dec 08 '21 at 17:06
  • @Dmitry z please consider looking into the [macOS/Linux instructions](https://docs.conda.io/projects/conda/en/latest/user-guide/install/macos.html) from the conda doc. – FabienP Dec 08 '21 at 20:18
  • Also, note that now using the miniforge / mambaforge docker images could be viable options under Linux, depending on your usage. – FabienP Dec 08 '21 at 20:20
7

Since you mentioned WinPython as an option, but said you dismissed it for being 'too large':

WinPython now includes a 'Zero' version with each release that has nearly all of the bloat removed (equivalent to the relationship between Miniconda and Anaconda). I believe the folder containing the WinPython-64bit v3.6.3.0Zero release clocked in around 50-100MB.

subnivean
  • 1,132
  • 11
  • 19
  • How does it relate to Anaconda portable install? I would prefer any sound solution, if exists, but I believe the relationship should be clearly stated to be understood by everyone. – WebComer Jul 07 '21 at 23:19
  • @WebComer: Well, the question included the line "I looked at WinPython, but at 1.4GB it is too large". I'm telling them that that is no longer the case. – subnivean Oct 05 '21 at 19:01
6

Well this is an old question posted 4 years ago(as on November 2020) but the issue still persists. I recently came across it while I was also searching a solution for the exact same situation in which @Crashworks was then.

So here are my observations. I would be talking only on Windows platform perspective. Typically this quest for portable development solutions arise in situations where the developer needs to switch between systems frequently or has a need to be able to back up its entire dev setup from one machine on a portable drive and be able to run the same on another machine with minimum time wasted on setting up the dev environment. There may other compelling situations but this one mentioned above seems to be the major one.

My setup - 
    I have a folder called C:\DEB_pythons\anaconda3
    I installed Anaconda3 in 'Silent Mode' using the command string 
start /wait "" Anaconda3-2020.07-Windows-x86_64.exe /InstallationType=JustMe /AddToPath=0 /RegisterPython=0 /NoRegistry=1 /S /D=C:\DEB_pythons\anaconda3

The installation was smooth and as expected there was no entry in the path variable and system registry about Anaconda3 except one single insignificant registry entry like below

[key]
HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\LowRegistry\Audio\PolicyConfig\PropertyStore\44be3c1f_0
REG_SZ
[key name]
(Default)
[key value]
{2}.\\?\hdaudio#func_01&ven_14f1&dev_50f4&subsys_103c8080&rev_1001#{6994ad04-93ef-11d0-a3cc-00a0c9223196}\rearlineouttopo/00010001|\Device\HarddiskVolume3\DEB_pythons\anaconda3\python.exe%b{00000000-0000-0000-0000-000000000000}

Clearly this is not going to impact Anaconda's functionality much if it is absent on another machine where the same setup could be attempted to run.

So far so good. Now let us open Anaconda3 Navigator and check whether the sub-components are running fine or not. We have Spyder, Jupiter Lab, Jupyter, IPython Console, etc. All of them opened and ran just fine which is GOOD NEWS. It looks like we have achieved the desired portability. But the reality is far from it.

The basic requirement to satisfy portability is that all the program components, user data, location for storing the settings, configuration and other supporting files should be under a "user-defined" folder location.

Now this is broken in many ways under the present setup of Anaconda.

ONE

If we check Anaconda's internal setup using the command "conda info", we can see two sets of location has been referenced such as -

user config file : C:\Users\ddutta8\.condarc     /// it exists
populated config files : C:\Users\ddutta8\.condarc
base environment : C:\DEB_pythons\anaconda3  (writable)
package cache : C:\DEB_pythons\anaconda3\pkgs   /// it contains all the packages
                C:\Users\ddutta8\.conda\pkgs    /// this folder does not exist
                C:\Users\ddutta8\AppData\Local\conda\conda\pkgs   /// this folder does not exist
envs directories : C:\DEB_pythons\anaconda3\envs   /// it is empty
                   C:\Users\ddutta8\.conda\envs    /// this folder does not exist
                   C:\Users\ddutta8\AppData\Local\conda\conda\envs    /// this folder does not exist

"C:\Users\ddutta8" is basically the result of expansion %USERPROFILE% environment variable. The very reference of this path i.e. the current user's profile folder BEATS THE PORTABILITY FEATURE of this silent installation. To achieve TRUE portability all aspects of Anaconda3 should have either remained inside the root folder which is "C:\DEB_pythons\anaconda3" (in my case) OR the application should have asked the user to set a location for storing the settings, configuration and other supporting files.

The contents of "C:\Users\ddutta8.condarc" is simple yet important but it is outside installation folder and user cannot control it's placement.

ssl_verify: true
channels:
  - defaults

TWO

If we search for the presence of the string %USERPROFILE% in the entire Anaconda3 installation folder, there are 167 hits which means in 167 files the reference to %USERPROFILE% folder has been hard-coded instead of the referring to the data location to be supplied by the user. THIS cannot be changed under the present setup distributed by anaconda.com. As a result of this under the %USERPROFILE% folder you'll find the following folders-

.conda
.ipynb_checkpoints
.ipython
.jupyter
.matplotlib
.spyder-py3

They are referenced by all the applications opened under Anaconda3 - Spyder, Jypyter Lab etc etc. They contain the settings, configuration and user data which cannot be referenced even if they are copied folder by folder to a portable drive and then to a new machine.

THREE

Also the installer creats 6 launchers in the location

C:\Users\ddutta8\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Anaconda3 (64-bit)

These have to to used to launch the applications like Anaconda Navigator, Spyder IDE, Jupyter Notebook etc. They have to be recreated elsewhere as batch files to do away with the dependency on %USERPROFILE% folder.

TO make Anaconda3 truly portable, the vendor has to create a new installer which will either ask for a location from the user to store the user-data, settings and configuration OR the path should be supplied as a parameter in case of a silent type install OR the installer should store the user-data in a dedicated folder under the installation root folder[an approach successfully followed by VSCode] AND all applications under Anaconda3 must be reference to this user supplied location rather than the %USERPROFILE% location.

For interested only - here is the list of all those 167 hits I received --

Name    Location
    
curl.exe    C:\DEB_pythons\anaconda3\Library\bin\
curl.exe    C:\DEB_pythons\anaconda3\pkgs\curl-7.71.1-h2a8f88b_1\Library\bin\
pandoc-citeproc.exe C:\DEB_pythons\anaconda3\pkgs\pandoc-2.10-0\Scripts\
pandoc-citeproc.exe C:\DEB_pythons\anaconda3\pkgs\pandoc-2.10-0\Scripts\
pandoc-citeproc.exe C:\DEB_pythons\anaconda3\Scripts\
pandoc-citeproc.exe C:\DEB_pythons\anaconda3\Scripts\
pandoc.exe  C:\DEB_pythons\anaconda3\pkgs\pandoc-2.10-0\Scripts\
pandoc.exe  C:\DEB_pythons\anaconda3\pkgs\pandoc-2.10-0\Scripts\
pandoc.exe  C:\DEB_pythons\anaconda3\Scripts\
pandoc.exe  C:\DEB_pythons\anaconda3\Scripts\
qmake.exe   C:\DEB_pythons\anaconda3\Library\bin\
qmake.exe   C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\bin\
sqlite3.exe C:\DEB_pythons\anaconda3\Library\bin\
sqlite3.exe C:\DEB_pythons\anaconda3\pkgs\sqlite-3.32.3-h2a8f88b_0\Library\bin\
libcrypto-1_1-x64.dll   C:\DEB_pythons\anaconda3\Library\bin\
libcrypto-1_1-x64.dll   C:\DEB_pythons\anaconda3\pkgs\openssl-1.1.1g-he774522_0\Library\bin\
llvmlite.dll    C:\DEB_pythons\anaconda3\Lib\site-packages\llvmlite\binding\
llvmlite.dll    C:\DEB_pythons\anaconda3\pkgs\llvmlite-0.33.0-py38ha925a31_0\Lib\site-packages\llvmlite\binding\
opengl32sw.dll  C:\DEB_pythons\anaconda3\Library\bin\
opengl32sw.dll  C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\bin\
Qt5Core.dll C:\DEB_pythons\anaconda3\Library\bin\
Qt5Core.dll C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\bin\
Qt5WebEngineCore.dll    C:\DEB_pythons\anaconda3\Library\bin\
Qt5WebEngineCore.dll    C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\bin\
xlwings.bas C:\DEB_pythons\anaconda3\Lib\site-packages\xlwings\
xlwings.bas C:\DEB_pythons\anaconda3\pkgs\xlwings-0.19.5-py38_0\Lib\site-packages\xlwings\
compiler.js C:\DEB_pythons\anaconda3\Lib\site-packages\bokeh\server\static\js\
compiler.js C:\DEB_pythons\anaconda3\pkgs\bokeh-2.1.1-py38_0\Lib\site-packages\bokeh\server\static\js\
yarn.js C:\DEB_pythons\anaconda3\Lib\site-packages\jupyterlab\staging\
yarn.js C:\DEB_pythons\anaconda3\Lib\site-packages\jupyterlab\staging\
yarn.js C:\DEB_pythons\anaconda3\pkgs\jupyterlab-2.1.5-py_0\site-packages\jupyterlab\staging\
yarn.js C:\DEB_pythons\anaconda3\pkgs\jupyterlab-2.1.5-py_0\site-packages\jupyterlab\staging\
menu-windows.json   C:\DEB_pythons\anaconda3\pkgs\notebook-6.0.3-py38_0\info\recipe\
menu-windows.json   C:\DEB_pythons\anaconda3\pkgs\spyder-4.1.4-py38_0\info\recipe\
notebook.json   C:\DEB_pythons\anaconda3\Menu\
notebook.json   C:\DEB_pythons\anaconda3\pkgs\notebook-6.0.3-py38_0\Menu\
spyder_shortcut.json    C:\DEB_pythons\anaconda3\Menu\
spyder_shortcut.json    C:\DEB_pythons\anaconda3\pkgs\spyder-4.1.4-py38_0\Menu\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\Library\lib\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\Library\lib\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\Library\lib\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\Library\lib\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\lib\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\lib\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\lib\
Qt5Bootstrap.lib    C:\DEB_pythons\anaconda3\pkgs\qt-5.9.7-vc14h73c81de_0\Library\lib\
__init__.py C:\DEB_pythons\anaconda3\Lib\site-packages\anaconda_navigator\utils\
__init__.py C:\DEB_pythons\anaconda3\Lib\site-packages\pathlib2\
__init__.py C:\DEB_pythons\anaconda3\Lib\site-packages\pathlib2\
__init__.py C:\DEB_pythons\anaconda3\pkgs\anaconda-navigator-1.9.12-py38_0\Lib\site-packages\anaconda_navigator\utils\
__init__.py C:\DEB_pythons\anaconda3\pkgs\pathlib2-2.3.5-py38_0\Lib\site-packages\pathlib2\
__init__.py C:\DEB_pythons\anaconda3\pkgs\pathlib2-2.3.5-py38_0\Lib\site-packages\pathlib2\
automation.py   C:\DEB_pythons\anaconda3\Lib\site-packages\pygments\lexers\
automation.py   C:\DEB_pythons\anaconda3\pkgs\pygments-2.6.1-py_0\site-packages\pygments\lexers\
base.py C:\DEB_pythons\anaconda3\Lib\site-packages\spyder\config\
base.py C:\DEB_pythons\anaconda3\Lib\site-packages\navigator_updater\config\
base.py C:\DEB_pythons\anaconda3\Lib\site-packages\anaconda_navigator\config\
base.py C:\DEB_pythons\anaconda3\pkgs\anaconda-navigator-1.9.12-py38_0\Lib\site-packages\anaconda_navigator\config\
base.py C:\DEB_pythons\anaconda3\pkgs\navigator-updater-0.2.1-py38_0\Lib\site-packages\navigator_updater\config\
base.py C:\DEB_pythons\anaconda3\pkgs\spyder-4.1.4-py38_0\Lib\site-packages\spyder\config\
environ.py  C:\DEB_pythons\anaconda3\Lib\site-packages\conda_build\
environ.py  C:\DEB_pythons\anaconda3\pkgs\conda-build-3.18.11-py38_1\Lib\site-packages\conda_build\
knownfolders.py C:\DEB_pythons\anaconda3\Lib\site-packages\anaconda_navigator\external\
knownfolders.py C:\DEB_pythons\anaconda3\Lib\site-packages\menuinst\
knownfolders.py C:\DEB_pythons\anaconda3\pkgs\anaconda-navigator-1.9.12-py38_0\Lib\site-packages\anaconda_navigator\external\
knownfolders.py C:\DEB_pythons\anaconda3\pkgs\menuinst-1.4.16-py38he774522_1\Lib\site-packages\menuinst\
layer1.py   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\
layer1.py   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\
ntpath.py   C:\DEB_pythons\anaconda3\Lib\
ntpath.py   C:\DEB_pythons\anaconda3\Lib\
ntpath.py   C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\
ntpath.py   C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\
pathlib.py  C:\DEB_pythons\anaconda3\Lib\
pathlib.py  C:\DEB_pythons\anaconda3\Lib\
pathlib.py  C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\
pathlib.py  C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\
paths.py    C:\DEB_pythons\anaconda3\Lib\site-packages\astropy\config\
paths.py    C:\DEB_pythons\anaconda3\Lib\site-packages\astropy\config\
paths.py    C:\DEB_pythons\anaconda3\pkgs\astropy-4.0.1.post1-py38he774522_1\Lib\site-packages\astropy\config\
paths.py    C:\DEB_pythons\anaconda3\pkgs\astropy-4.0.1.post1-py38he774522_1\Lib\site-packages\astropy\config\
platform_.py    C:\DEB_pythons\anaconda3\Lib\site-packages\keyring\util\
platform_.py    C:\DEB_pythons\anaconda3\pkgs\keyring-21.2.1-py38_0\Lib\site-packages\keyring\util\
pytester.py C:\DEB_pythons\anaconda3\Lib\site-packages\_pytest\
pytester.py C:\DEB_pythons\anaconda3\pkgs\pytest-5.4.3-py38_0\Lib\site-packages\_pytest\
test_config.py  C:\DEB_pythons\anaconda3\Lib\distutils\tests\
test_config.py  C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\distutils\tests\
test_dist.py    C:\DEB_pythons\anaconda3\Lib\distutils\tests\
test_dist.py    C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\distutils\tests\
test_path.py    C:\DEB_pythons\anaconda3\Lib\site-packages\IPython\utils\tests\
test_path.py    C:\DEB_pythons\anaconda3\Lib\site-packages\IPython\utils\tests\
test_path.py    C:\DEB_pythons\anaconda3\pkgs\ipython-7.16.1-py38h5ca1d4c_0\Lib\site-packages\IPython\utils\tests\
test_path.py    C:\DEB_pythons\anaconda3\pkgs\ipython-7.16.1-py38h5ca1d4c_0\Lib\site-packages\IPython\utils\tests\
win32.py    C:\DEB_pythons\anaconda3\Lib\site-packages\menuinst\
win32.py    C:\DEB_pythons\anaconda3\pkgs\menuinst-1.4.16-py38he774522_1\Lib\site-packages\menuinst\
win32cred_demo.py   C:\DEB_pythons\anaconda3\Lib\site-packages\win32\Demos\
win32cred_demo.py   C:\DEB_pythons\anaconda3\Lib\site-packages\win32\Demos\
win32cred_demo.py   C:\DEB_pythons\anaconda3\Lib\site-packages\win32\Demos\
win32cred_demo.py   C:\DEB_pythons\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\win32\Demos\
win32cred_demo.py   C:\DEB_pythons\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\win32\Demos\
win32cred_demo.py   C:\DEB_pythons\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\win32\Demos\
__init__.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\pathlib2\__pycache__\
__init__.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\anaconda_navigator\utils\__pycache__\
__init__.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\anaconda-navigator-1.9.12-py38_0\Lib\site-packages\anaconda_navigator\utils\__pycache__\
__init__.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\pathlib2-2.3.5-py38_0\Lib\site-packages\pathlib2\__pycache__\
automation.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\pygments\lexers\__pycache__\
base.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\spyder\config\__pycache__\
base.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\anaconda_navigator\config\__pycache__\
base.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\navigator_updater\config\__pycache__\
base.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\anaconda-navigator-1.9.12-py38_0\Lib\site-packages\anaconda_navigator\config\__pycache__\
base.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\navigator-updater-0.2.1-py38_0\Lib\site-packages\navigator_updater\config\__pycache__\
base.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\spyder-4.1.4-py38_0\Lib\site-packages\spyder\config\__pycache__\
environ.cpython-38.pyc  C:\DEB_pythons\anaconda3\Lib\site-packages\conda_build\__pycache__\
environ.cpython-38.pyc  C:\DEB_pythons\anaconda3\pkgs\conda-build-3.18.11-py38_1\Lib\site-packages\conda_build\__pycache__\
knownfolders.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\menuinst\__pycache__\
knownfolders.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\anaconda_navigator\external\__pycache__\
knownfolders.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\anaconda-navigator-1.9.12-py38_0\Lib\site-packages\anaconda_navigator\external\__pycache__\
knownfolders.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\menuinst-1.4.16-py38he774522_1\Lib\site-packages\menuinst\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\__pycache__\
layer1.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\boto-2.49.0-py38_0\Lib\site-packages\boto\opsworks\__pycache__\
ntpath.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\__pycache__\
ntpath.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\__pycache__\
pathlib.cpython-38.pyc  C:\DEB_pythons\anaconda3\Lib\__pycache__\
pathlib.cpython-38.pyc  C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\__pycache__\
paths.cpython-38.pyc    C:\DEB_pythons\anaconda3\Lib\site-packages\astropy\config\__pycache__\
paths.cpython-38.pyc    C:\DEB_pythons\anaconda3\pkgs\astropy-4.0.1.post1-py38he774522_1\Lib\site-packages\astropy\config\__pycache__\
platform_.cpython-38.pyc    C:\DEB_pythons\anaconda3\Lib\site-packages\keyring\util\__pycache__\
platform_.cpython-38.pyc    C:\DEB_pythons\anaconda3\pkgs\keyring-21.2.1-py38_0\Lib\site-packages\keyring\util\__pycache__\
pytester.cpython-38.pyc C:\DEB_pythons\anaconda3\Lib\site-packages\_pytest\__pycache__\
pytester.cpython-38.pyc C:\DEB_pythons\anaconda3\pkgs\pytest-5.4.3-py38_0\Lib\site-packages\_pytest\__pycache__\
test_config.cpython-38.pyc  C:\DEB_pythons\anaconda3\Lib\distutils\tests\__pycache__\
test_config.cpython-38.pyc  C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\distutils\tests\__pycache__\
test_dist.cpython-38.pyc    C:\DEB_pythons\anaconda3\Lib\distutils\tests\__pycache__\
test_dist.cpython-38.pyc    C:\DEB_pythons\anaconda3\pkgs\python-3.8.3-he1778fa_2\Lib\distutils\tests\__pycache__\
test_path.cpython-38.pyc    C:\DEB_pythons\anaconda3\Lib\site-packages\IPython\utils\tests\__pycache__\
test_path.cpython-38.pyc    C:\DEB_pythons\anaconda3\Lib\site-packages\IPython\utils\tests\__pycache__\
test_path.cpython-38.pyc    C:\DEB_pythons\anaconda3\pkgs\ipython-7.16.1-py38h5ca1d4c_0\Lib\site-packages\IPython\utils\tests\__pycache__\
test_path.cpython-38.pyc    C:\DEB_pythons\anaconda3\pkgs\ipython-7.16.1-py38h5ca1d4c_0\Lib\site-packages\IPython\utils\tests\__pycache__\
win32.cpython-38.pyc    C:\DEB_pythons\anaconda3\Lib\site-packages\menuinst\__pycache__\
win32.cpython-38.pyc    C:\DEB_pythons\anaconda3\pkgs\menuinst-1.4.16-py38he774522_1\Lib\site-packages\menuinst\__pycache__\
win32cred_demo.cpython-38.pyc   C:\DEB_pythons\anaconda3\Lib\site-packages\win32\Demos\__pycache__\
win32cred_demo.cpython-38.pyc   C:\DEB_pythons\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\win32\Demos\__pycache__\
_corecffi.cp38-win_amd64.pyd    C:\DEB_pythons\anaconda3\Lib\site-packages\gevent\libuv\
_corecffi.cp38-win_amd64.pyd    C:\DEB_pythons\anaconda3\pkgs\gevent-20.6.2-py38he774522_0\Lib\site-packages\gevent\libuv\
shell.pyd   C:\DEB_pythons\anaconda3\Lib\site-packages\win32comext\shell\
shell.pyd   C:\DEB_pythons\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\win32comext\shell\
win32profile.pyd    C:\DEB_pythons\anaconda3\Lib\site-packages\win32\
win32profile.pyd    C:\DEB_pythons\anaconda3\pkgs\pywin32-227-py38he774522_1\Lib\site-packages\win32\
  • Thanks for good job investigating, @Debajyoti Dutta. As of the latest 2020 distrib, Anaconda3-2020.11-Windows-x86_64.exe available in 2021-04-25, %USERPROFILE% happen to occur just 3 times. But os.path.expanduser happen to occur in 363 files, so the problem by now is even deeper. – WebComer Apr 25 '21 at 09:01
  • 1
    It's really frustrating. Seems like every package pollute endlessly user profile, bloating it and making everything NOT portable. PLOTLY_DIR = os.environ.get( "PLOTLY_DIR", os.path.join(os.path.expanduser("~"), ".plotly") file = os.path.join(os.path.expanduser("~"), ".netrc") – WebComer Apr 25 '21 at 11:24
  • 1
    Any progress on this? Anaconda is the preferred distribution for any kind of data analytics and data science work on Windows. However, without a portable installation Anaconda just does not work in corporate IT environments that do not grant local system administrator privileges. I am facing this problem today, and Anaconda Python is getting redirected to Windows Command Consoles in a "sandbox Admin account" by Azure Active Directory Security. I have wasted hours this week looking for workarounds. Python Programs do not work!! Anaconda needs to provide a totally portable installer. – Rich Lysakowski PhD Nov 05 '21 at 21:34
  • Unfortunately, not only there is no solution to this but the things are even worse now. The new area of pain is upgrading the package and/or updating the individual packages/modules. – Debajyoti Dutta Dec 02 '21 at 19:20
  • 1
    @RichLysakowskiPhD Unfortunately, not only there is no solution to this but the things are even worse now. The new area of pain is upgrading the package and/or updating the individual packages/modules - particularly if you have done a silent install. It just breaks the whole set up. Code stops working. I don't know why Anaconda vendor is just not interested to make it portable. I have the same situation like you in terms of the corporate IT environment and I always personally prefer portable setups. WinPython too did no better. Hence I have now switched to the nuget method. Its portable. – Debajyoti Dutta Dec 02 '21 at 19:29
  • 1
    @RichLysakowskiPhD here is the link - https://docs.python.org/3/using/windows.html#the-nuget-org-packages Its from the official Python documentation. – Debajyoti Dutta Dec 02 '21 at 19:30