Python NotebookをWebアプリに変換する「mercury」のインストールについて解説しています。
「mljar-mercury(https://github.com/mljar/mercury)」は、PythonノートブックをインタラクティブなWebアプリケーションに変換し、他の人と共有することができます。mercuryはデュアルライセンスであり、OSS(オープンソース)ライセンスと、商用ライセンス(プロ)が存在する(https://mljar.com/pricing/)。
■Python
今回のPythonのバージョンは、「3.7.9」を使用しています。(Windows10)(pythonランチャーでの確認)
■mljar-mercuryをインストールする
mljar-mercuryをインストールを行いますが、今回はpipを経由してインストールを行うので、まずWindowsのコマンドプロンプトを起動します。
pip install mljar-mercury
起動後、上記のコマンドを入力し、Enterキーを押します。
なお、今回は、pythonランチャーを使用しており、Python Version 3.7.9にインストールを行うために、バージョンの切り替えを行います。
py -3.7 -m pip install mljar-mercury
切り替えるために、上記のコマンドを入力し、Enterキーを押します。
Defaulting to user installation because normal site-packages is not writeable Collecting mljar-mercury Downloading mljar-mercury-1.0.1.tar.gz (3.9 MB) |████████████████████████████████| 3.9 MB 1.3 MB/s Installing build dependencies ... done Getting requirements to build wheel ... done Preparing metadata (pyproject.toml) ... done Collecting sqlalchemy==1.4.27 Downloading SQLAlchemy-1.4.27-cp37-cp37m-win32.whl (1.5 MB) |████████████████████████████████| 1.5 MB 6.4 MB/s Collecting gevent==21.12.0 Downloading gevent-21.12.0-cp37-cp37m-win32.whl (1.4 MB) |████████████████████████████████| 1.4 MB 3.3 MB/s Collecting whitenoise==5.3.0 Downloading whitenoise-5.3.0-py2.py3-none-any.whl (19 kB) Collecting pyppeteer==1.0.2 Using cached pyppeteer-1.0.2-py3-none-any.whl (83 kB) Collecting croniter==1.3.5 Downloading croniter-1.3.5-py2.py3-none-any.whl (17 kB) Requirement already satisfied: pyyaml==6.0 in c:\users\user_\appdata\roaming\python\python37\site-packages (from mljar-mercury) (6.0) Collecting djangorestframework==3.12.4 Using cached djangorestframework-3.12.4-py3-none-any.whl (957 kB) Collecting ipykernel==6.6.0 Downloading ipykernel-6.6.0-py3-none-any.whl (126 kB) |████████████████████████████████| 126 kB 6.4 MB/s Collecting psutil==5.8.0 Downloading psutil-5.8.0-cp37-cp37m-win32.whl (240 kB) |████████████████████████████████| 240 kB 6.4 MB/s Collecting nbconvert>=6.5.0 Downloading nbconvert-6.5.0-py3-none-any.whl (561 kB) |████████████████████████████████| 561 kB 3.3 MB/s Collecting markdown==3.3.6 Downloading Markdown-3.3.6-py3-none-any.whl (97 kB) |████████████████████████████████| 97 kB 1.7 MB/s Collecting django==3.2.5 Downloading Django-3.2.5-py3-none-any.whl (7.9 MB) |████████████████████████████████| 7.9 MB 6.4 MB/s Collecting django-filter==21.1 Downloading django_filter-21.1-py3-none-any.whl (81 kB) |████████████████████████████████| 81 kB 2.6 MB/s Collecting django-drf-filepond==0.4.1 Downloading django_drf_filepond-0.4.1-py2.py3-none-any.whl (39 kB) Collecting django-cors-headers==3.10.1 Downloading django_cors_headers-3.10.1-py3-none-any.whl (12 kB) Collecting ipython==7.30.1 Downloading ipython-7.30.1-py3-none-any.whl (791 kB) |████████████████████████████████| 791 kB 3.3 MB/s Collecting python-dotenv==0.19.2 Using cached python_dotenv-0.19.2-py2.py3-none-any.whl (17 kB) Collecting celery==5.1.2 Downloading celery-5.1.2-py3-none-any.whl (401 kB) |████████████████████████████████| 401 kB 3.3 MB/s Collecting ipython-genutils Using cached ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB) Collecting kombu<6.0,>=5.1.0 Using cached kombu-5.2.4-py3-none-any.whl (189 kB) Requirement already satisfied: pytz>dev in c:\users\user_\appdata\roaming\python\python37\site-packages (from celery==5.1.2->mljar-mercury) (2021.3) Collecting vine<6.0,>=5.0.0 Using cached vine-5.0.0-py2.py3-none-any.whl (9.4 kB) Requirement already satisfied: setuptools in c:\users\user_\appdata\roaming\python\python37\site-packages (from celery==5.1.2->mljar-mercury) (58.3.0) Collecting click-didyoumean>=0.0.3 Using cached click_didyoumean-0.3.0-py3-none-any.whl (2.7 kB) Collecting billiard<4.0,>=3.6.4.0 Using cached billiard-3.6.4.0-py3-none-any.whl (89 kB) Collecting click-plugins>=1.1.1 Using cached click_plugins-1.1.1-py2.py3-none-any.whl (7.5 kB) Collecting click<8.0,>=7.0 Using cached click-7.1.2-py2.py3-none-any.whl (82 kB) Collecting click-repl>=0.1.6 Using cached click_repl-0.2.0-py3-none-any.whl (5.2 kB) Requirement already satisfied: python-dateutil in c:\users\user_\appdata\roaming\python\python37\site-packages (from croniter==1.3.5->mljar-mercury) (2.8.2) Collecting asgiref<4,>=3.3.2 Downloading asgiref-3.5.2-py3-none-any.whl (22 kB) Collecting sqlparse>=0.2.2 Using cached sqlparse-0.4.2-py3-none-any.whl (42 kB) Requirement already satisfied: six>=1.14.0 in c:\users\user_\appdata\roaming\python\python37\site-packages (from django-drf-filepond==0.4.1->mljar-mercury) (1.16.0) Collecting shortuuid>=0.5.0 Downloading shortuuid-1.0.9-py3-none-any.whl (9.4 kB) Collecting django-storages>=1.9.1 Downloading django_storages-1.12.3-py3-none-any.whl (44 kB) |████████████████████████████████| 44 kB 1.7 MB/s Requirement already satisfied: requests>=2.20.1 in c:\users\user_\appdata\roaming\python\python37\site-packages (from django-drf-filepond==0.4.1->mljar-mercury) (2.26.0) Collecting greenlet<2.0,>=1.1.0 Downloading greenlet-1.1.2-cp37-cp37m-win32.whl (98 kB) |████████████████████████████████| 98 kB 3.2 MB/s Requirement already satisfied: cffi>=1.12.2 in c:\users\user_\appdata\roaming\python\python37\site-packages (from gevent==21.12.0->mljar-mercury) (1.15.0) Collecting zope.interface Downloading zope.interface-5.4.0-cp37-cp37m-win32.whl (208 kB) |████████████████████████████████| 208 kB 547 kB/s Collecting zope.event Using cached zope.event-4.5.0-py2.py3-none-any.whl (6.8 kB) Collecting argcomplete>=1.12.3 Using cached argcomplete-2.0.0-py2.py3-none-any.whl (37 kB) Collecting matplotlib-inline<0.2.0,>=0.1.0 Using cached matplotlib_inline-0.1.3-py3-none-any.whl (8.2 kB) Collecting traitlets<6.0,>=5.1.0 Downloading traitlets-5.3.0-py3-none-any.whl (106 kB) |████████████████████████████████| 106 kB 3.2 MB/s Collecting tornado<7.0,>=4.2 Downloading tornado-6.1-cp37-cp37m-win32.whl (421 kB) |████████████████████████████████| 421 kB 3.3 MB/s Collecting debugpy<2.0,>=1.0.0 Downloading debugpy-1.6.0-cp37-cp37m-win32.whl (4.3 MB) |████████████████████████████████| 4.3 MB 3.3 MB/s Requirement already satisfied: importlib-metadata<5 in c:\users\user_\appdata\roaming\python\python37\site-packages (from ipykernel==6.6.0->mljar-mercury) (4.8.1) Collecting jupyter-client<8.0 Downloading jupyter_client-7.3.4-py3-none-any.whl (132 kB) |████████████████████████████████| 132 kB 3.3 MB/s Collecting backcall Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB) Collecting jedi>=0.16 Using cached jedi-0.18.1-py2.py3-none-any.whl (1.6 MB) Collecting prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0 Using cached prompt_toolkit-3.0.29-py3-none-any.whl (381 kB) Collecting decorator Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB) Collecting pickleshare Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB) Requirement already satisfied: pygments in c:\users\user_\appdata\roaming\python\python37\site-packages (from ipython==7.30.1->mljar-mercury) (2.10.0) Requirement already satisfied: colorama in c:\users\user_\appdata\roaming\python\python37\site-packages (from ipython==7.30.1->mljar-mercury) (0.4.4) Collecting pyee<9.0.0,>=8.1.0 Using cached pyee-8.2.2-py2.py3-none-any.whl (12 kB) Requirement already satisfied: urllib3<2.0.0,>=1.25.8 in c:\users\user_\appdata\roaming\python\python37\site-packages (from pyppeteer==1.0.2->mljar-mercury) (1.26.7) Collecting tqdm<5.0.0,>=4.42.1 Downloading tqdm-4.64.0-py2.py3-none-any.whl (78 kB) |████████████████████████████████| 78 kB 2.1 MB/s Collecting appdirs<2.0.0,>=1.4.3 Using cached appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) Requirement already satisfied: certifi>=2021 in c:\users\user_\appdata\roaming\python\python37\site-packages (from pyppeteer==1.0.2->mljar-mercury) (2021.10.8) Collecting websockets<11.0,>=10.0 Downloading websockets-10.3-cp37-cp37m-win32.whl (97 kB) |████████████████████████████████| 97 kB 1.7 MB/s Collecting entrypoints>=0.2.2 Using cached entrypoints-0.4-py3-none-any.whl (5.3 kB) Collecting jupyter-core>=4.7 Downloading jupyter_core-4.10.0-py3-none-any.whl (87 kB) |████████████████████████████████| 87 kB 2.1 MB/s Collecting defusedxml Using cached defusedxml-0.7.1-py2.py3-none-any.whl (25 kB) Requirement already satisfied: MarkupSafe>=2.0 in c:\users\user_\appdata\roaming\python\python37\site-packages (from nbconvert>=6.5.0->mljar-mercury) (2.1.0) Collecting mistune<2,>=0.8.1 Using cached mistune-0.8.4-py2.py3-none-any.whl (16 kB) Requirement already satisfied: jinja2>=3.0 in c:\users\user_\appdata\roaming\python\python37\site-packages (from nbconvert>=6.5.0->mljar-mercury) (3.0.3) Collecting nbformat>=5.1 Downloading nbformat-5.4.0-py3-none-any.whl (73 kB) |████████████████████████████████| 73 kB 744 kB/s Collecting beautifulsoup4 Using cached beautifulsoup4-4.11.1-py3-none-any.whl (128 kB) Collecting tinycss2 Using cached tinycss2-1.1.1-py3-none-any.whl (21 kB) Collecting bleach Downloading bleach-5.0.0-py3-none-any.whl (160 kB) |████████████████████████████████| 160 kB 6.4 MB/s Collecting nbclient>=0.5.0 Downloading nbclient-0.6.4-py3-none-any.whl (71 kB) |████████████████████████████████| 71 kB 69 kB/s Collecting pandocfilters>=1.4.1 Using cached pandocfilters-1.5.0-py2.py3-none-any.whl (8.7 kB) Collecting jupyterlab-pygments Downloading jupyterlab_pygments-0.2.2-py2.py3-none-any.whl (21 kB) Collecting packaging Using cached packaging-21.3-py3-none-any.whl (40 kB) Requirement already satisfied: typing-extensions in c:\users\user_\appdata\roaming\python\python37\site-packages (from asgiref<4,>=3.3.2->django==3.2.5->mljar-mercury) (3.10.0.2) Requirement already satisfied: pycparser in c:\users\user_\appdata\roaming\python\python37\site-packages (from cffi>=1.12.2->gevent==21.12.0->mljar-mercury) (2.21) Requirement already satisfied: zipp>=0.5 in c:\users\user_\appdata\roaming\python\python37\site-packages (from importlib-metadata<5->ipykernel==6.6.0->mljar-mercury) (3.6.0) Collecting parso<0.9.0,>=0.8.0 Using cached parso-0.8.3-py2.py3-none-any.whl (100 kB) Collecting pyzmq>=23.0 Downloading pyzmq-23.2.0-cp37-cp37m-win32.whl (890 kB) |████████████████████████████████| 890 kB 6.4 MB/s Collecting nest-asyncio>=1.5.4 Downloading nest_asyncio-1.5.5-py3-none-any.whl (5.2 kB) Requirement already satisfied: pywin32>=1.0 in c:\users\user_\appdata\roaming\python\python37\site-packages (from jupyter-core>=4.7->nbconvert>=6.5.0->mljar-mercury) (302) Collecting cached-property Downloading cached_property-1.5.2-py2.py3-none-any.whl (7.6 kB) Collecting amqp<6.0.0,>=5.0.9 Downloading amqp-5.1.1-py3-none-any.whl (50 kB) |████████████████████████████████| 50 kB 3.2 MB/s Collecting fastjsonschema Downloading fastjsonschema-2.15.3-py3-none-any.whl (22 kB) Collecting jsonschema>=2.6 Using cached jsonschema-4.6.0-py3-none-any.whl (80 kB) Requirement already satisfied: wcwidth in c:\users\user_\appdata\roaming\python\python37\site-packages (from prompt-toolkit!=3.0.0,!=3.0.1,<3.1.0,>=2.0.0->ipython==7.30.1->mljar-mercury) (0.2.5) Requirement already satisfied: idna<4,>=2.5 in c:\users\user_\appdata\roaming\python\python37\site-packages (from requests>=2.20.1->django-drf-filepond==0.4.1->mljar-mercury) (3.3) Requirement already satisfied: charset-normalizer~=2.0.0 in c:\users\user_\appdata\roaming\python\python37\site-packages (from requests>=2.20.1->django-drf-filepond==0.4.1->mljar-mercury) (2.0.7) Collecting soupsieve>1.2 Using cached soupsieve-2.3.2.post1-py3-none-any.whl (37 kB) Collecting webencodings Using cached webencodings-0.5.1-py2.py3-none-any.whl (11 kB) Collecting pyparsing!=3.0.5,>=2.0.2 Downloading pyparsing-3.0.9-py3-none-any.whl (98 kB) |████████████████████████████████| 98 kB 2.5 MB/s Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 Downloading pyrsistent-0.18.1-cp37-cp37m-win32.whl (59 kB) |████████████████████████████████| 59 kB 1.7 MB/s Collecting importlib-resources>=1.4.0 Downloading importlib_resources-5.8.0-py3-none-any.whl (28 kB) Requirement already satisfied: attrs>=17.4.0 in c:\users\user_\appdata\roaming\python\python37\site-packages (from jsonschema>=2.6->nbformat>=5.1->nbconvert>=6.5.0->mljar-mercury) (21.2.0) Building wheels for collected packages: mljar-mercury Building wheel for mljar-mercury (pyproject.toml) ... done Created wheel for mljar-mercury: filename=mljar_mercury-1.0.1-py3-none-any.whl size=3914048 sha256=8b827e42b3fc7e12d264c0cb24461c31a14ad2d5c92579e9e93d54ea0f97cc99 Stored in directory: c:\users\user_\appdata\local\pip\cache\wheels\36\67\81\10400133f79915756efa7871a29b31705770d06cb3acea08f7 Successfully built mljar-mercury Installing collected packages: traitlets, pyrsistent, importlib-resources, vine, tornado, sqlparse, pyzmq, parso, nest-asyncio, jupyter-core, jsonschema, fastjsonschema, entrypoints, asgiref, webencodings, soupsieve, pyparsing, prompt-toolkit, pickleshare, nbformat, matplotlib-inline, jupyter-client, jedi, django, decorator, click, cached-property, backcall, amqp, zope.interface, zope.event, websockets, tqdm, tinycss2, shortuuid, pyee, pandocfilters, packaging, nbclient, mistune, kombu, jupyterlab-pygments, ipython, greenlet, djangorestframework, django-storages, defusedxml, debugpy, click-repl, click-plugins, click-didyoumean, bleach, billiard, beautifulsoup4, argcomplete, appdirs, whitenoise, sqlalchemy, python-dotenv, pyppeteer, psutil, nbconvert, markdown, ipython-genutils, ipykernel, gevent, django-filter, django-drf-filepond, django-cors-headers, croniter, celery, mljar-mercury WARNING: The script sqlformat.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts jupyter-migrate.exe, jupyter-troubleshoot.exe and jupyter.exe are installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script jsonschema.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script jupyter-trust.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts jupyter-kernel.exe, jupyter-kernelspec.exe and jupyter-run.exe are installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script django-admin.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Attempting uninstall: click Found existing installation: click 8.0.4 Uninstalling click-8.0.4: Successfully uninstalled click-8.0.4 WARNING: The script tqdm.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script shortuuid.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script jupyter-execute.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts iptest.exe, iptest3.exe, ipython.exe and ipython3.exe are installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script dotenv.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script pyppeteer-install.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The scripts jupyter-dejavu.exe and jupyter-nbconvert.exe are installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script markdown_py.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script celery.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. WARNING: The script mercury.exe is installed in 'C:\Users\user_\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location. Successfully installed amqp-5.1.1 appdirs-1.4.4 argcomplete-2.0.0 asgiref-3.5.2 backcall-0.2.0 beautifulsoup4-4.11.1 billiard-3.6.4.0 bleach-5.0.0 cached-property-1.5.2 celery-5.1.2 click-7.1.2 click-didyoumean-0.3.0 click-plugins-1.1.1 click-repl-0.2.0 croniter-1.3.5 debugpy-1.6.0 decorator-5.1.1 defusedxml-0.7.1 django-3.2.5 django-cors-headers-3.10.1 django-drf-filepond-0.4.1 django-filter-21.1 django-storages-1.12.3 djangorestframework-3.12.4 entrypoints-0.4 fastjsonschema-2.15.3 gevent-21.12.0 greenlet-1.1.2 importlib-resources-5.8.0 ipykernel-6.6.0 ipython-7.30.1 ipython-genutils-0.2.0 jedi-0.18.1 jsonschema-4.6.0 jupyter-client-7.3.4 jupyter-core-4.10.0 jupyterlab-pygments-0.2.2 kombu-5.2.4 markdown-3.3.6 matplotlib-inline-0.1.3 mistune-0.8.4 mljar-mercury-1.0.1 nbclient-0.6.4 nbconvert-6.5.0 nbformat-5.4.0 nest-asyncio-1.5.5 packaging-21.3 pandocfilters-1.5.0 parso-0.8.3 pickleshare-0.7.5 prompt-toolkit-3.0.29 psutil-5.8.0 pyee-8.2.2 pyparsing-3.0.9 pyppeteer-1.0.2 pyrsistent-0.18.1 python-dotenv-0.19.2 pyzmq-23.2.0 shortuuid-1.0.9 soupsieve-2.3.2.post1 sqlalchemy-1.4.27 sqlparse-0.4.2 tinycss2-1.1.1 tornado-6.1 tqdm-4.64.0 traitlets-5.3.0 vine-5.0.0 webencodings-0.5.1 websockets-10.3 whitenoise-5.3.0 zope.event-4.5.0 zope.interface-5.4.0 WARNING: You are using pip version 21.3.1; however, version 22.1.2 is available. You should consider upgrading via the 'C:\Program Files (x86)\Python37-32\python.exe -m pip install --upgrade pip' command.
Enterキーを押すと、インストールが開始され、上記のように「Successfully installed」と表示されます。これが表示されれば、mljar-mercuryが正常にインストールされたことになります。
「WARNING: The script mercury.exe is installed in ‘C:\Users\user_\AppData\Roaming\Python\Python37\Scripts’ which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use –no-warn-script-location.」という警告が多く出力されているが、エラーではなく警告なので、一旦無視しています。
今回はmljar-mercuryのバージョン1.0.1がインストールされました。
コメント