Thanks to visit codestin.com
Credit goes to github.com

Skip to content

test: experiment re-creating a WinPython 2016-04 Full from a WinPythonZero #387

Closed
@stonebig

Description

@stonebig

steps:

# for Winpython3.4.4.4-64bit, takes 6 minutes to download
import os
import sys
import io
try:
    import urllib.request as urllib2  # Python 3
except:
    import urllib2  # Python 2

# for Winpython3.4.44-64bit
r_url = u"https://github.com/winpython/winpython/releases/download/1.6.20160828/packages.srcreq_cp34_amd64.zip"

r_binary = os.path.basename(r_url)
r_installer = os.environ["WINPYDIR"]+"\\..\\tools\\packages.zip"
# Download
g = urllib2.urlopen(r_url) 
with io.open(r_installer, 'wb') as f:
    f.write(g.read())
g.close
g = None
  • create a python script to unzip it
import hashlib
import zipfile as zf
r_installer = os.environ["WINPYDIR"]+"\\..\\tools\\packages.zip"
r_packages = os.environ["WINPYDIR"]+"\\..\\tools\\packages"

hashes=("7f9786125d79054113f9c795219d529f", "0b0713ebbe267941093e5cba58ba8127c2428331")

def give_hash(of_file, with_this):
    with io.open(r_installer, 'rb') as f:
        return with_this(f.read()).hexdigest()  
print (" "*12+"MD5"+" "*(32-12-3)+" "+" "*15+"SHA-1"+" "*(40-15-5)+"\n"+"-"*32+" "+"-"*40)
print ("%s %s %s" % (give_hash(r_installer, hashlib.md5) , give_hash(r_installer, hashlib.sha1),r_installer))

assert give_hash(r_installer, hashlib.md5) == hashes[0]
assert give_hash(r_installer, hashlib.sha1) == hashes[1]

# takes 2 minutes
with zf.ZipFile(r_installer) as myzip:
    myzip.extractall(path=r_packages)

  • create a python script model to install a package list.
#now install your wishes:
#last legacy ".exe" case  for PyQt5.5 on 64 bit: (need "7z.exe"  in "\tools")
#   wppm -i "%WINPYDIR%\\..\\tools\\packages\\packages.srcreq_cp34_amd64\\PyQt5-5.5.1-gpl-Py3.4-Qt5.5.1-x64.exe"
# pip install spyder --no-index --find-links="%WINPYDIR%\\..\\tools\\packages.srcreq_cp34_amd64" --trusted-host=None
#or pip
pip install -r Qt5_requirements.txt --no-index --find-links="%WINPYDIR%\\..\\tools\\packages\\packages.srcreq_cp34_amd64" --trusted-host=None

if exist  "%WINPYDIR%\Lib\site-packages\IPython" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py widgetsnbextension
if exist  "%WINPYDIR%\Lib\site-packages\IPython" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix widgetsnbextension

echo =================
echo configure ipython-parallel
echo =================
@echo on
if exist  "%WINPYDIR%\Lib\site-packages\IPython"  "%WINPYDIR%\Scripts\jupyter-notebook.exe" --generate-config

rem starting Jupyter 5+, use ipcluster
if exist "%WINPYDIR%\Scripts\ipcluster.exe" "%WINPYDIR%\Scripts\ipcluster.exe" nbextension enable

rem    if not exist "ipcluster.exe" echo c.NotebookApp.server_extensions.append('ipyparallel.nbextension')>>"%winpydir%\..\settings\.jupyter\jupyter_notebook_config.py"


@echo off
echo =================
echo finish install of jupyterlab
echo =================
if exist  "%WINPYDIR%\Lib\site-packages\jupyterlab" "%WINPYDIR%\Scripts\jupyter.exe" serverextension enable --py  --sys-prefix jupyterlab

echo =================
echo finish install of bqplot
echo =================
rem before bqplot 0.6 if exist  "%WINPYDIR%\Lib\site-packages\bqplot" "%WINPYDIR%\python.exe" -m bqplot.install --user --force
if exist  "%WINPYDIR%\Lib\site-packages\bqplot" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix bqplot


echo =================
echo finish install of ipyleaflet
echo =================
if exist  "%WINPYDIR%\Lib\site-packages\ipyleaflet" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix  ipyleaflet

echo =================
echo finish install of pythreejs
echo =================
if exist  "%WINPYDIR%\Lib\site-packages\pythreejs" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py  --sys-prefix  pythreejs

echo =================
echo finish install of altair
echo =================
if exist  "%WINPYDIR%\Lib\site-packages\vega" "%WINPYDIR%\Scripts\jupyter.exe" nbextension install --py --sys-prefix vega
if exist  "%WINPYDIR%\Lib\site-packages\vega" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix vega 


echo =================
echo finish install of rise
echo =================
if exist  "%WINPYDIR%\Lib\site-packages\rise" "%WINPYDIR%\Scripts\jupyter.exe" nbextension install --py --sys-prefix rise 
if exist  "%WINPYDIR%\Lib\site-packages\rise" "%WINPYDIR%\Scripts\jupyter.exe" nbextension enable --py --sys-prefix rise 


echo =================
echo finish install seaborn iris example
echo =================
if exist  "%WINPYDIR%\Lib\site-packages\seaborn" "%WINPYDIR%\python.exe" -c "import seaborn as sns;sns.set();sns.load_dataset('iris')"

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions