Recent Changes · Search:

Dispense


Navigation Tips - Dritte


PmWiki

pmwiki.org

edit SideBar

Python3

< Latex symbols (pdf) | Index | Computer.AsLifeLine >


20.04 (sudo in the following is because I installed these system-wide, not necessary)

  • sudo pip3 install sidecar
    • sudo pip3 install pygments (exists with sphynx but sidecar needs >=2.4.1)
    • jupyter labextension install @jupyter-widgets/jupyterlab-manager
    • jupyter labextension install @jupyter-widgets/jupyterlab-sidecar
    • sudo jupyter labextension install jupyter-matplotlib
    • @@sudo pip3 install ipympl@
  • installed musr2py cloning https://gitlab.com/bonfus/musr2py, running sudo python3 setup.py install (o sudo pip3 install)
  • sudo apt install nexus-tools these hdf4 based tools allow nxbrowse of ISIS files
  • sudo pip install nexusformat also updated scipy to the latest [1.5.4] useless ISIS data is nexus 4
  • sudo pip install h5py also updated numpy to the latest [1.19.4] useless
  • sudo apt-get install python3-sphinx only for developers
  • sudo apt install nodejs npm
  • jupyter nbextension enable --py widgetsnbextension
  • found interference with root that sets JUPYTER_PATH and JUPYTER_CONFIG_DIR to a root related directory (unset JUPYTER_PATH, try to relocate the export JUPYTER_PATH=..root... to a root startup file)
  • done systemwide pip3 intall numpy, scipy, matplotlib, iminuit, jupyter, ipywidgets, pandas, dill
  • sudo apt install python3-pip
  • sudo apt-get install python3-tk

Back


see also more up-to-date http://www.fis.unipr.it/~derenzi/dispense/pmwiki.php?n=Hpc.GithubMujpy (&merge!)

The main aim is to play with mujpy under python3. Already installed virtualenv according to PB instructions. Downloaded get-pip-py

  sudo python3 get-pip.py
virtualenv -p /usr/bin/python3 py3_kernel --no-site-packages # to avoid seeing 2.7 libraries\\

This way I can keep minimal packages and at last

  pip freeze > requirements.txt
(see virtualenv). Inserted in .bashrc kernel3 as alias for source ~/py3_kernel/bin/activate

This command must be given to work under python3. To finish

  deactivate

Next install python3-dev system wide (from sudo synaptic) and then the basic libraries

  kernel3
ipython kernel install --name py3 --user ## install kernel for ipython and jupyter
python -m pip install numpy
python -m pip install scipy
python -m pip install matplotlib
python -m pip install iminuit
deactivate

At this stage python fisica1 scripts work under kernel3 In order not to have permission denied

  sudo chown -R roberto.derenzi:roberto.derenzi /usr/local/bin/virtualenv

Now install
kernel3
python -m pip install cython # BEFORE installing probfit
python setup.py install
download latest probfit, unzip, cd to the dir and install it

  python setup.py install
tested on various graphics?. Rememnber to deactivate

Installed also

  kernel 3
python -m pip install ipywidgets
jupyter nbextension enable --py widgetsnbextension

The first cell of mu_test3_musr2py.ipynb notebook works also without kernel3 command (the notebook uses the python3 kernel) but widgets work only if I invoke jupyter notebook under kernel3 At present they complain about javascript but the widgets are there.


Installed ipywidgets 7.0 (to see Text(continuous_update=False) ). Got Error in Widget. Others have solved by a fresh virtualenv. Tried a fresh virtualenv by

  pip freeze -l> /tmp/requirements.txt
virtualenv -p /usr/bin/python3 py3_kernel_new --no-site-packages
saved source command as kern3new and with that pip install -r /tmp/requirements.txt
problems with Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-w3choyj9/probfit/

solved by manually deleting probfit from requirements (now in p3_kernel_new/Downloads, together with all required downloads) and then running

  python setup.py install

from the directory where probfit-master? was unzipped. Still got warnings, but no error:

  /home/roberto.derenzi/py3_kernel_new/lib/python3.4/site-packages/numpy/core/include/numpy/npy_1_7_deprecated_api.h:15:2: warning: #warning "Using deprecated NumPy API, disable it by " "#defining NPY_NO_DEPRECATED_API NPY_1_7_API_VERSION" [-Wcpp]
 #warning "Using deprecated NumPy API, disable it by " 

WAS working already! Remember to always restart the kernel to reload the modules.


Install qt consolle

 sudo apt-get install python3-pyqt5
kern3new pip install qtconsole

Back


< Latex symbols (pdf) | Index | Computer.AsLifeLine >

Edit - History - Print - PDF - Recent Changes - Search
Page last modified on November 12, 2022, at 02:09 PM