File: installation.html

package info (click to toggle)
python-pywebview 5.0.5%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 33,680 kB
  • sloc: python: 9,592; javascript: 917; java: 158; cs: 130; sh: 16; makefile: 3
file content (56 lines) | stat: -rw-r--r-- 19,351 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
<!DOCTYPE html>
<html lang="en-US">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Installation | pywebview</title>
    <meta name="generator" content="VuePress 1.9.7">

    <meta name="description" content="Build GUI for your Python program with JavaScript, HTML, and CSS">

    <link rel="preload" href="/3.7/assets/css/0.styles.28a501df.css" as="style"><link rel="preload" href="/3.7/assets/js/app.10a559eb.js" as="script"><link rel="preload" href="/3.7/assets/js/2.0ff7ef1d.js" as="script"><link rel="preload" href="/3.7/assets/js/59.d3f412e7.js" as="script"><link rel="prefetch" href="/3.7/assets/js/10.f125ec08.js"><link rel="prefetch" href="/3.7/assets/js/11.81fead78.js"><link rel="prefetch" href="/3.7/assets/js/12.0a86c191.js"><link rel="prefetch" href="/3.7/assets/js/13.c09145fc.js"><link rel="prefetch" href="/3.7/assets/js/14.2a7dc35b.js"><link rel="prefetch" href="/3.7/assets/js/15.90c9f36a.js"><link rel="prefetch" href="/3.7/assets/js/16.69b1f4b4.js"><link rel="prefetch" href="/3.7/assets/js/17.956ed884.js"><link rel="prefetch" href="/3.7/assets/js/18.bd6678a0.js"><link rel="prefetch" href="/3.7/assets/js/19.b31e62b7.js"><link rel="prefetch" href="/3.7/assets/js/20.cebc4a71.js"><link rel="prefetch" href="/3.7/assets/js/21.d2041966.js"><link rel="prefetch" href="/3.7/assets/js/22.2a3916f2.js"><link rel="prefetch" href="/3.7/assets/js/23.712fbf84.js"><link rel="prefetch" href="/3.7/assets/js/24.f768e66b.js"><link rel="prefetch" href="/3.7/assets/js/25.69b3e415.js"><link rel="prefetch" href="/3.7/assets/js/26.6619f84a.js"><link rel="prefetch" href="/3.7/assets/js/27.e2a4e1bf.js"><link rel="prefetch" href="/3.7/assets/js/28.abcc819c.js"><link rel="prefetch" href="/3.7/assets/js/29.c379d080.js"><link rel="prefetch" href="/3.7/assets/js/3.749f6582.js"><link rel="prefetch" href="/3.7/assets/js/30.771e8640.js"><link rel="prefetch" href="/3.7/assets/js/31.547a8393.js"><link rel="prefetch" href="/3.7/assets/js/32.778a82c7.js"><link rel="prefetch" href="/3.7/assets/js/33.6ff70f11.js"><link rel="prefetch" href="/3.7/assets/js/34.ae1b5fb4.js"><link rel="prefetch" href="/3.7/assets/js/35.c5555b94.js"><link rel="prefetch" href="/3.7/assets/js/36.d53c471f.js"><link rel="prefetch" href="/3.7/assets/js/37.bbba2d58.js"><link rel="prefetch" href="/3.7/assets/js/38.5eb30036.js"><link rel="prefetch" href="/3.7/assets/js/39.8cac65fe.js"><link rel="prefetch" href="/3.7/assets/js/4.f2c64e71.js"><link rel="prefetch" href="/3.7/assets/js/40.53182a9c.js"><link rel="prefetch" href="/3.7/assets/js/41.19399765.js"><link rel="prefetch" href="/3.7/assets/js/42.41128068.js"><link rel="prefetch" href="/3.7/assets/js/43.660f3959.js"><link rel="prefetch" href="/3.7/assets/js/44.09d5c6f8.js"><link rel="prefetch" href="/3.7/assets/js/45.4a818eab.js"><link rel="prefetch" href="/3.7/assets/js/46.d1621897.js"><link rel="prefetch" href="/3.7/assets/js/47.7f8f8dec.js"><link rel="prefetch" href="/3.7/assets/js/48.f27d4c39.js"><link rel="prefetch" href="/3.7/assets/js/49.4189d401.js"><link rel="prefetch" href="/3.7/assets/js/5.2a771d7d.js"><link rel="prefetch" href="/3.7/assets/js/50.beff8380.js"><link rel="prefetch" href="/3.7/assets/js/51.8a918a6c.js"><link rel="prefetch" href="/3.7/assets/js/52.92d0105f.js"><link rel="prefetch" href="/3.7/assets/js/53.28701cde.js"><link rel="prefetch" href="/3.7/assets/js/54.2b15d6fb.js"><link rel="prefetch" href="/3.7/assets/js/55.d231c742.js"><link rel="prefetch" href="/3.7/assets/js/56.7e02bbff.js"><link rel="prefetch" href="/3.7/assets/js/57.61e9e46c.js"><link rel="prefetch" href="/3.7/assets/js/58.cc70e253.js"><link rel="prefetch" href="/3.7/assets/js/6.64e1f3ed.js"><link rel="prefetch" href="/3.7/assets/js/60.f4fd7728.js"><link rel="prefetch" href="/3.7/assets/js/61.cd0f1d68.js"><link rel="prefetch" href="/3.7/assets/js/62.bf000bcc.js"><link rel="prefetch" href="/3.7/assets/js/63.807edde1.js"><link rel="prefetch" href="/3.7/assets/js/64.2b6fe843.js"><link rel="prefetch" href="/3.7/assets/js/7.779cbcff.js"><link rel="prefetch" href="/3.7/assets/js/8.66fb3acb.js"><link rel="prefetch" href="/3.7/assets/js/9.84350af9.js">
    <link rel="stylesheet" href="/3.7/assets/css/0.styles.28a501df.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/3.7/" class="home-link router-link-active"><img src="/3.7/logo-no-text.png" alt="pywebview" class="logo"> <span class="site-name can-hide">pywebview</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/3.7/guide/" class="nav-link router-link-active">
  Guide
</a></div><div class="nav-item"><a href="/3.7/examples/" class="nav-link">
  Examples
</a></div><div class="nav-item"><a href="/3.7/contributing/" class="nav-link">
  Contributing
</a></div><div class="nav-item"><a href="/3.7/blog/" class="nav-link">
  Blog
</a></div><div class="nav-item"><a href="/3.7/CHANGELOG.html" class="nav-link">
  Changelog
</a></div> <a href="https://github.com/r0x0r/pywebview" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/3.7/guide/" class="nav-link router-link-active">
  Guide
</a></div><div class="nav-item"><a href="/3.7/examples/" class="nav-link">
  Examples
</a></div><div class="nav-item"><a href="/3.7/contributing/" class="nav-link">
  Contributing
</a></div><div class="nav-item"><a href="/3.7/blog/" class="nav-link">
  Blog
</a></div><div class="nav-item"><a href="/3.7/CHANGELOG.html" class="nav-link">
  Changelog
</a></div> <a href="https://github.com/r0x0r/pywebview" target="_blank" rel="noopener noreferrer" class="repo-link">
    GitHub
    <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></nav>  <ul class="sidebar-links"><li><section class="sidebar-group depth-0"><p class="sidebar-heading open"><span>Basics</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/3.7/guide/installation.html" aria-current="page" class="active sidebar-link">Installation</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/3.7/guide/installation.html#dependencies" class="sidebar-link">Dependencies</a></li></ul></li><li><a href="/3.7/guide/usage.html" class="sidebar-link">Usage</a></li></ul></section></li><li><section class="sidebar-group depth-0"><p class="sidebar-heading"><span>Development</span> <!----></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/3.7/guide/api.html" class="sidebar-link">API</a></li><li><a href="/3.7/guide/architecture.html" class="sidebar-link">Application architecture</a></li><li><a href="/3.7/guide/debugging.html" class="sidebar-link">Debugging</a></li><li><a href="/3.7/guide/interdomain.html" class="sidebar-link">Interdomain communication</a></li><li><a href="/3.7/guide/freezing.html" class="sidebar-link">Freezing</a></li><li><a href="/3.7/guide/security.html" class="sidebar-link">Security</a></li><li><a href="/3.7/guide/virtualenv.html" class="sidebar-link">Virtual environment</a></li><li><a href="/3.7/guide/renderer.html" class="sidebar-link">Web engine</a></li></ul></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="installation"><a href="#installation" class="header-anchor">#</a> Installation</h1> <div class="language-bash extra-class"><pre class="language-bash"><code>pip <span class="token function">install</span> pywebview
</code></pre></div><p>This will install <em>pywebview</em> with default dependencies. To install <em>pywebview</em> with PySide2 (available on Linux and macOS and Windows) use</p> <div class="language-bash extra-class"><pre class="language-bash"><code>pip <span class="token function">install</span> pywebview<span class="token punctuation">[</span>qt<span class="token punctuation">]</span>
</code></pre></div><p>To install <em>pywebview</em> with CEF (available on Windows) use</p> <div class="language-bash extra-class"><pre class="language-bash"><code>pip <span class="token function">install</span> pywebview<span class="token punctuation">[</span>cef<span class="token punctuation">]</span>
</code></pre></div><h2 id="dependencies"><a href="#dependencies" class="header-anchor">#</a> Dependencies</h2> <h3 id="windows"><a href="#windows" class="header-anchor">#</a> Windows</h3> <p><a href="https://github.com/pythonnet/pythonnet" target="_blank" rel="noopener noreferrer">pythonnet<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> (requires &gt; .NET 4.0)</p> <p>To use with the latest Chromium you need <a href="https://developer.microsoft.com/en-us/microsoft-edge/webview2/" target="_blank" rel="noopener noreferrer">WebView2 Runtime<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a>. If you plan to distribute your software, check out <a href="https://docs.microsoft.com/en-us/microsoft-edge/webview2/concepts/distribution" target="_blank" rel="noopener noreferrer">distribution guidelines<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> too.</p> <p>To use with CEF you need
<a href="https://github.com/cztomczak/cefpython/" target="_blank" rel="noopener noreferrer">cefpython<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <div class="language-bash extra-class"><pre class="language-bash"><code>pip <span class="token function">install</span> cefpython3
</code></pre></div><h3 id="macos"><a href="#macos" class="header-anchor">#</a> macOS</h3> <p><a href="https://pythonhosted.org/pyobjc/" target="_blank" rel="noopener noreferrer">pyobjc<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p><code>PyObjC</code> comes presintalled with the Python bundled in macOS. For a stand-alone Python installation you have to install it separately.
You can also use QT5 in macOS</p> <h3 id="linux"><a href="#linux" class="header-anchor">#</a> Linux</h3> <p><code>pip install pywebview[qt]</code> should take of QT dependencies. If it does not work or you would like to use GTK, you may try these recipes.</p> <p><a href="https://pygobject.readthedocs.io/en/latest/" target="_blank" rel="noopener noreferrer">PyGObject<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> is used with GTK. To install dependencies on Ubuntu for both Python 3 and 2</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> python3-gi python3-gi-cairo gir1.2-gtk-3.0 gir1.2-webkit2-4.0
</code></pre></div><p>For other distributions, consult the <a href="https://pygobject.readthedocs.io/en/latest/getting_started.html" target="_blank" rel="noopener noreferrer">PyGObject documentation<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></p> <p>Note that WebKit2 version 2.22 or greater is required for certain features to work correctly. If your distribution ships with an older version, you may need to install it manually from a backport.</p> <p><br><br></p> <p><a href="https://doc.qt.io/qtforpython-5/" target="_blank" rel="noopener noreferrer">PySide2<span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a> is used with QT. <code>pywebview</code> supports both QtWebChannel (newer and preferred) and QtWebKit implementations. Use QtWebChannel, unless it is not available on your system.</p> <p>To install QT via pip</p> <div class="language-bash extra-class"><pre class="language-bash"><code>pip <span class="token function">install</span> qtpy pyside2
</code></pre></div><p>To install QtWebChannel on Debian-based systems (more modern, preferred)</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> python3-pyqt5 python3-pyqt5.qtwebengine python3-pyqt5.qtwebchannel libqt5webkit5-dev
</code></pre></div><p>To install QtWebKit (legacy, but available for more platforms).</p> <div class="language-bash extra-class"><pre class="language-bash"><code><span class="token function">sudo</span> <span class="token function">apt</span> <span class="token function">install</span> python3-pyqt5 python3-pyqt5.qtwebkit python-pyqt5 python-pyqt5.qtwebkit libqt5webkit5-dev
</code></pre></div><br> <div class="custom-block warning"><p class="custom-block-title">WARNING</p> <p>Starting from Ubuntu Disco Dingo <em>pywebview</em> can be installed via <code>apt</code> on Debian based system as <code>python-pywebview</code>. This package features an old version of <em>pywebview</em> that is API incompatible with the current version. If you choose to install it, you can find documentation <a href="/2.4">here</a></p></div></div> <footer class="page-edit"><div class="edit-link"><a href="https://github.com/r0x0r/pywebview/edit/docs/docs/guide/installation.md" target="_blank" rel="noopener noreferrer">Help us improve this page!</a> <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></div> <!----></footer> <div class="page-nav"><p class="inner"><!----> <span class="next"><a href="/3.7/guide/usage.html">
        Usage
      </a>
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/3.7/assets/js/app.10a559eb.js" defer></script><script src="/3.7/assets/js/2.0ff7ef1d.js" defer></script><script src="/3.7/assets/js/59.d3f412e7.js" defer></script>
  </body>
</html>