0

I need to distribute a python 2.7 windows installation with the openpyxl module in a corporate environment with no admin or live access to the repository. There are a number of openpyxl prerequisites.

Installing miniconda normally involves the user downloading the correct installation for their operating system with the installation managing correct module installation. I'd prefer not to hard-code versions because they will become outdated some time after they are downloaded but I can't see any way around it.

I am looking to include the following batch file in a zip file (say like self-extracting archive). Is there a smarter way to assemble the software and distribute it?

@echo off
rem Manual Download and Installing Anaconda Python Packages
rem could change to use http://www.coreftp.com
rem eg for miniconda2 with Python 2.7 at 14/06/2018
rem Download MiniConda
rem https://repo.continuum.io/miniconda/Miniconda2-latest-Windows-x86_64.exe
rem Download coda packages from Anaconda repositories
rem https://repo.continuum.io/pkgs/main/win-64/et_xmlfile-1.0.1-py27h1de5d23_0.tar.bz2
rem https://repo.continuum.io/pkgs/main/win-64/jdcal-1.3-py27h8c72977_0.tar.bz2
rem https://repo.continuum.io/pkgs/main/win-64/openpyxl-2.4.10-py27_0.tar.bz2
rem
set CondaInstallDir=%UserProfile%\AppData\Local\Continuum\miniconda2
echo Installing MiniConda with extra packages to %CondaInstallDir%
echo ^<Ctrl^>C to cancel OR
pause
echo Installing MiniConda to %CondaInstallDir%
echo Please wait ...
cd  %UserProfile%
%~dp0Miniconda2-latest-Windows-x86_64 /AddToPath=0 /S /D=%CondaInstallDir%
cd %CondaInstallDir%\Scripts
%HomeDrive%conda install --offline %~dp0jdcal-1.4-py27_0.tar.bz2
%HomeDrive%conda install --offline %~dp0et_xmlfile-1.0.1-py27h1de5d23_0.tar.bz2
%HomeDrive%conda install --offline %~dp0openpyxl-2.4.10-py27_0.tar.bz2
echo done.
pause
flywire
  • 1,155
  • 1
  • 14
  • 38
  • Workflow I've been using: place all files in a temp directory, zip temp directory and distribute, extract temp directory, run install.bat which confirms install then deletes temp directory after install. – flywire Apr 03 '19 at 09:32

1 Answers1

0

Faced with the same problem, I took a slightly different approach.

In my case, I was only targeting a single application, and all of its dependencies.

I put all of my "extras" in a folder called extras\noarch, and then ran an index on them. This created a local repository that I could install from.

conda index extras

This repository was then distributed with the installer and my installation script reads:

conda install -y --offline --override-channels --channel ./extras rstudio

NOTE: I came here looking for a better solution.

Jefferey Cave
  • 2,507
  • 1
  • 27
  • 46