Why There Is No Python Compressed Archive or Binaries ?

Mats Wichmann mats at wichmann.us
Tue Jan 18 11:22:26 EST 2022


On 1/17/22 23:31, Kirill Ratkin wrote:
> Hi Grant
> 
> Hmmm...  definitly you are right in particular solution.
> 
> But Ok, let me show example.
> 
> 
> I often use Go in parallel with Python and sometimes I switch between
> Windows/Linux also. On both systems I just download Go toolset as
> tarball/zip file and unpack in place where I like.
> 
> The point here is Go toolset officially distributed as tarball/zip for
> all supported operating system. This is not PortableGo or WinGo or some
> anther third party Go distribution. This is one of supported way do get
> Go toolset.
> 
> On Windows I put toolset on separate drive 'D:\Go' and on linux -
> $HOME/.local/go
> 
> And I set up several environment variables (doing 'setx' on Windows and
> edit .profile on linux): GOPATH, GOROOT, GOCACHE, ... and modify my PATH.
> 
> Now I can build any Go project. I don't care about which Go compiler was
> set on OS (Linux or Windows) before. I just unpack tarball/zip in place
> where I have permissions and use it.


The part of this that is Set up Environment Variables and PATH can be
handled by Python's virtualenvs.  You create one starting from a
possibly local Python layout, or from a system one, and the virtualenv
handles all the "fiddling" so while that env is active, just "python"
and "pip" work for that environment.

A nice way to manage this is through a project called pyenv.  There is
now a Windows port of this so it can work there as well (I've never used
it on WIndows, personally).

So while there may not currently be a zip/tar archive you can unpack and
go, I can get started quite easily on a new version.  Let's say I
decidded I needed to test something on Python 3.7 but my main Python is
already 3.10:

pyenv install -l | grep "3\.7"
... list of available versions that contain 3.7

pyenv install 3.7.12   # sets up 3.7.12 in pyenv's local versions tree
pyenv virtualenv 3.7.12 venv-3712  # create virtualenv using 3.7.12 as base
pyenv activate venv-3712

and now I'm running inside a virtualenv using 3.7.12, which I can now
provision for the work I want to do...



More information about the Python-list mailing list