ipython pyQt/notebook 的配置

本文介绍了如何配置ipython、PyQt和notebook。首先,通过pip安装ipython,然后下载并正确放置PyQt文件,以避免报错。接着,说明了notebook的安装过程和打开方式,它是基于web的ipython,提供了浏览器界面,但运行代码的方式与传统终端略有不同。

前言 : 最近在学习pandas, 发现ipython很好用. 本文主要介绍如何配置pyQt与notebook

ipython


ipython可以通过pip来进行安装, pip install ipython 下到对应的版本.

下载完成后, 在命令行输入ipython就可以进入了.

如果你有安装matplotlib的话, 可以输入ipython --pylab, 进行gui绘图.

    import matplotlib.pyplot as plt
    plt.plot(range(10))
    plt.show()

你应该去别的地方学习怎么操作ipython.

pyQt


pyQt下载

无论linux还是windos, 保证pyQt的目录在site-packages下即可. 如果你使用virtualenv, 也可以这样尝试.

注意 : sip.pyd文件也要 拷贝/安装 到site-packages下, 否则会有ImportError: No module named sip报错.

拷贝完成后, 输入jupyter qtconsole打开pyQt

注意 : ipython qtconsole 已经失效.

notebook


notebook算是web端的ipython. 有浏览器的优势, 但是在一些地方显得很奇怪, 比如运行代码不是通过enter, 而是alt enter, 比如命令窗口无法自动下滑.

notebook可以通过pip进行安装, 输入pip install notebook, 即可完成安装.

安装完成后, 输入jupyter notebook, 即可打开服务器, 此时应该会有默认浏览器的弹窗, 如果没有的话, 可以cp命令行提示的地址手动访问, 比如http://127.0.0.1:8888.

打开以后是非常友好的界面, 你可以四处游玩, 或者找寻一个new按钮, 继续用浏览器作为终端进行工作.

(base) C:\Users\86188>conda activate pytorch (pytorch) C:\Users\86188>conda install jupyter Channels: - defaults - https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/pytorch Platform: win-64 Collecting package metadata (repodata.json): done Solving environment: done ## Package Plan ## environment location: C:\Users\86188\.conda\envs\pytorch added / updated specs: - jupyter The following packages will be downloaded: package | build ---------------------------|----------------- anyio-4.7.0 | py310haa95532_0 210 KB argon2-cffi-bindings-21.2.0| py310h827c3e9_1 41 KB asttokens-3.0.0 | py310haa95532_0 41 KB async-lru-2.0.4 | py310haa95532_0 19 KB attrs-24.3.0 | py310haa95532_0 154 KB babel-2.16.0 | py310haa95532_0 6.8 MB beautifulsoup4-4.12.3 | py310haa95532_0 217 KB bleach-6.2.0 | py310haa95532_0 297 KB brotlicffi-1.0.9.2 | py310h5da7b33_1 358 KB certifi-2025.6.15 | py310haa95532_0 156 KB cffi-1.17.1 | py310h827c3e9_1 254 KB colorama-0.4.6 | py310haa95532_0 32 KB comm-0.2.1 | py310haa95532_0 15 KB debugpy-1.8.11 | py310h5da7b33_0 3.2 MB exceptiongroup-1.2.0 | py310haa95532_0 31 KB h11-0.16.0 | py310haa95532_0 54 KB httpcore-1.0.9 | py310haa95532_0 95 KB httpx-0.28.1 | py310haa95532_0 213 KB idna-3.7 | py310haa95532_0 132 KB ipykernel-6.29.5 | py310haa95532_1 208 KB ipython-8.30.0 | py310haa95532_0 1.2 MB ipywidgets-8.1.5 | py310haa95532_0 205 KB jedi-0.19.2 | py310haa95532_0 1.1 MB json5-0.9.25 | py310haa95532_0 74 KB jsonschema-4.23.0 | py310haa95532_0 180 KB jsonschema-specifications-2023.7.1| py310haa95532_0 16 KB jupyter-1.1.1 | py310haa95532_0 9 KB jupyter-lsp-2.2.5 | py310haa95532_0 93 KB jupyter_client-8.6.3 | py310haa95532_0 214 KB jupyter_console-6.6.3 | py310haa95532_0 64 KB jupyter_core-5.7.2 | py310haa95532_0 110 KB jupyter_events-0.12.0 | py310haa95532_0 63 KB jupyter_server-2.15.0 | py310haa95532_0 527 KB jupyter_server_terminals-0.5.3| py310haa95532_0 26 KB jupyterlab-4.3.4 | py310haa95532_0 5.5 MB jupyterlab_pygments-0.3.0 | py310haa95532_0 19 KB jupyterlab_server-2.27.3 | py310haa95532_0 88 KB jupyterlab_widgets-3.0.13 | py310haa95532_0 195 KB libpq-17.4 | h70ee33d_0 4.2 MB matplotlib-inline-0.1.6 | py310haa95532_0 17 KB mistune-3.1.2 | py310haa95532_0 120 KB nbclient-0.10.2 | py310haa95532_0 67 KB nbconvert-7.16.6 | py310haa95532_0 9 KB nbconvert-core-7.16.6 | py310haa95532_0 509 KB nbconvert-pandoc-7.16.6 | py310haa95532_0 9 KB nbformat-5.10.4 | py310haa95532_0 167 KB nest-asyncio-1.6.0 | py310haa95532_0 15 KB notebook-7.3.2 | py310haa95532_1 10.2 MB notebook-shim-0.2.4 | py310haa95532_0 24 KB overrides-7.4.0 | py310haa95532_0 30 KB packaging-24.2 | py310haa95532_0 175 KB pandoc-2.12 | haa95532_3 14.6 MB parso-0.8.4 | py310haa95532_0 195 KB platformdirs-4.3.7 | py310haa95532_0 37 KB prometheus_client-0.21.1 | py310haa95532_0 121 KB prompt-toolkit-3.0.43 | py310haa95532_0 592 KB psutil-5.9.0 | py310h827c3e9_1 388 KB pygments-2.19.1 | py310haa95532_0 1.9 MB pyqt-6.7.1 | py310h5da7b33_1 3.5 MB pyqt6-sip-13.9.1 | py310h827c3e9_1 77 KB pysocks-1.7.1 | py310haa95532_0 28 KB python-dateutil-2.9.0post0 | py310haa95532_2 281 KB python-fastjsonschema-2.20.0| py310haa95532_0 250 KB python-json-logger-3.2.1 | py310haa95532_0 25 KB pywin32-308 | py310h5da7b33_0 10.5 MB pywinpty-2.0.15 | py310h72d21ff_0 230 KB pyzmq-26.2.0 | py310h5da7b33_0 334 KB qtbase-6.7.3 | h0804d20_0 32.2 MB qtconsole-5.6.1 | py310haa95532_1 238 KB qtdeclarative-6.7.3 | h5da7b33_0 21.4 MB qtpy-2.4.1 | py310haa95532_0 127 KB qtsvg-6.7.3 | hf2fb9eb_0 314 KB qttools-6.7.3 | h0de5f00_0 9.4 MB qtwebchannel-6.7.3 | h5da7b33_0 162 KB qtwebsockets-6.7.3 | h5da7b33_0 147 KB referencing-0.30.2 | py310haa95532_0 63 KB requests-2.32.4 | py310haa95532_0 151 KB rfc3339-validator-0.1.4 | py310haa95532_0 10 KB rfc3986-validator-0.1.1 | py310haa95532_0 10 KB rpds-py-0.22.3 | py310h636fa0f_0 248 KB send2trash-1.8.2 | py310haa95532_1 85 KB sip-6.10.0 | py310h5da7b33_0 576 KB six-1.17.0 | py310haa95532_0 32 KB sniffio-1.3.0 | py310haa95532_0 17 KB soupsieve-2.5 | py310haa95532_0 71 KB terminado-0.17.1 | py310haa95532_0 33 KB tinycss2-1.4.0 | py310haa95532_0 99 KB tomli-2.0.1 | py310haa95532_0 25 KB tornado-6.5.1 | py310h827c3e9_0 690 KB traitlets-5.14.3 | py310haa95532_0 182 KB typing-extensions-4.12.2 | py310haa95532_0 10 KB urllib3-2.5.0 | py310haa95532_0 309 KB wcwidth-0.2.13 | py310haa95532_0 73 KB webencodings-0.5.1 | py310haa95532_1 21 KB websocket-client-1.8.0 | py310haa95532_0 118 KB widgetsnbextension-4.0.13 | py310haa95532_0 949 KB win_inet_pton-1.1.0 | py310haa95532_0 9 KB ------------------------------------------------------------ Total: 138.1 MB The following NEW packages will be INSTALLED: anyio pkgs/main/win-64::anyio-4.7.0-py310haa95532_0 argon2-cffi pkgs/main/noarch::argon2-cffi-21.3.0-pyhd3eb1b0_0 argon2-cffi-bindi~ pkgs/main/win-64::argon2-cffi-bindings-21.2.0-py310h827c3e9_1 asttokens pkgs/main/win-64::asttokens-3.0.0-py310haa95532_0 async-lru pkgs/main/win-64::async-lru-2.0.4-py310haa95532_0 attrs pkgs/main/win-64::attrs-24.3.0-py310haa95532_0 babel pkgs/main/win-64::babel-2.16.0-py310haa95532_0 beautifulsoup4 pkgs/main/win-64::beautifulsoup4-4.12.3-py310haa95532_0 bleach pkgs/main/win-64::bleach-6.2.0-py310haa95532_0 brotlicffi pkgs/main/win-64::brotlicffi-1.0.9.2-py310h5da7b33_1 certifi pkgs/main/win-64::certifi-2025.6.15-py310haa95532_0 cffi pkgs/main/win-64::cffi-1.17.1-py310h827c3e9_1 charset-normalizer pkgs/main/noarch::charset-normalizer-3.3.2-pyhd3eb1b0_0 colorama pkgs/main/win-64::colorama-0.4.6-py310haa95532_0 comm pkgs/main/win-64::comm-0.2.1-py310haa95532_0 debugpy pkgs/main/win-64::debugpy-1.8.11-py310h5da7b33_0 decorator pkgs/main/noarch::decorator-5.1.1-pyhd3eb1b0_0 defusedxml pkgs/main/noarch::defusedxml-0.7.1-pyhd3eb1b0_0 exceptiongroup pkgs/main/win-64::exceptiongroup-1.2.0-py310haa95532_0 executing pkgs/main/noarch::executing-0.8.3-pyhd3eb1b0_0 h11 pkgs/main/win-64::h11-0.16.0-py310haa95532_0 httpcore pkgs/main/win-64::httpcore-1.0.9-py310haa95532_0 httpx pkgs/main/win-64::httpx-0.28.1-py310haa95532_0 icu pkgs/main/win-64::icu-73.1-h6c2663c_0 idna pkgs/main/win-64::idna-3.7-py310haa95532_0 ipykernel pkgs/main/win-64::ipykernel-6.29.5-py310haa95532_1 ipython pkgs/main/win-64::ipython-8.30.0-py310haa95532_0 ipywidgets pkgs/main/win-64::ipywidgets-8.1.5-py310haa95532_0 jedi pkgs/main/win-64::jedi-0.19.2-py310haa95532_0 jpeg pkgs/main/win-64::jpeg-9e-h827c3e9_3 json5 pkgs/main/win-64::json5-0.9.25-py310haa95532_0 jsonschema pkgs/main/win-64::jsonschema-4.23.0-py310haa95532_0 jsonschema-specif~ pkgs/main/win-64::jsonschema-specifications-2023.7.1-py310haa95532_0 jupyter pkgs/main/win-64::jupyter-1.1.1-py310haa95532_0 jupyter-lsp pkgs/main/win-64::jupyter-lsp-2.2.5-py310haa95532_0 jupyter_client pkgs/main/win-64::jupyter_client-8.6.3-py310haa95532_0 jupyter_console pkgs/main/win-64::jupyter_console-6.6.3-py310haa95532_0 jupyter_core pkgs/main/win-64::jupyter_core-5.7.2-py310haa95532_0 jupyter_events pkgs/main/win-64::jupyter_events-0.12.0-py310haa95532_0 jupyter_server pkgs/main/win-64::jupyter_server-2.15.0-py310haa95532_0 jupyter_server_te~ pkgs/main/win-64::jupyter_server_terminals-0.5.3-py310haa95532_0 jupyterlab pkgs/main/win-64::jupyterlab-4.3.4-py310haa95532_0 jupyterlab_pygmen~ pkgs/main/win-64::jupyterlab_pygments-0.3.0-py310haa95532_0 jupyterlab_server pkgs/main/win-64::jupyterlab_server-2.27.3-py310haa95532_0 jupyterlab_widgets pkgs/main/win-64::jupyterlab_widgets-3.0.13-py310haa95532_0 krb5 pkgs/main/win-64::krb5-1.20.1-h5b6d351_0 libpng pkgs/main/win-64::libpng-1.6.39-h8cc25b3_0 libpq pkgs/main/win-64::libpq-17.4-h70ee33d_0 libsodium pkgs/main/win-64::libsodium-1.0.18-h62dcd97_0 lz4-c pkgs/main/win-64::lz4-c-1.9.4-h2bbff1b_1 matplotlib-inline pkgs/main/win-64::matplotlib-inline-0.1.6-py310haa95532_0 mistune pkgs/main/win-64::mistune-3.1.2-py310haa95532_0 nbclient pkgs/main/win-64::nbclient-0.10.2-py310haa95532_0 nbconvert pkgs/main/win-64::nbconvert-7.16.6-py310haa95532_0 nbconvert-core pkgs/main/win-64::nbconvert-core-7.16.6-py310haa95532_0 nbconvert-pandoc pkgs/main/win-64::nbconvert-pandoc-7.16.6-py310haa95532_0 nbformat pkgs/main/win-64::nbformat-5.10.4-py310haa95532_0 nest-asyncio pkgs/main/win-64::nest-asyncio-1.6.0-py310haa95532_0 notebook pkgs/main/win-64::notebook-7.3.2-py310haa95532_1 notebook-shim pkgs/main/win-64::notebook-shim-0.2.4-py310haa95532_0 overrides pkgs/main/win-64::overrides-7.4.0-py310haa95532_0 packaging pkgs/main/win-64::packaging-24.2-py310haa95532_0 pandoc pkgs/main/win-64::pandoc-2.12-haa95532_3 pandocfilters pkgs/main/noarch::pandocfilters-1.5.0-pyhd3eb1b0_0 parso pkgs/main/win-64::parso-0.8.4-py310haa95532_0 platformdirs pkgs/main/win-64::platformdirs-4.3.7-py310haa95532_0 prometheus_client pkgs/main/win-64::prometheus_client-0.21.1-py310haa95532_0 prompt-toolkit pkgs/main/win-64::prompt-toolkit-3.0.43-py310haa95532_0 prompt_toolkit pkgs/main/noarch::prompt_toolkit-3.0.43-hd3eb1b0_0 psutil pkgs/main/win-64::psutil-5.9.0-py310h827c3e9_1 pure_eval pkgs/main/noarch::pure_eval-0.2.2-pyhd3eb1b0_0 pycparser pkgs/main/noarch::pycparser-2.21-pyhd3eb1b0_0 pygments pkgs/main/win-64::pygments-2.19.1-py310haa95532_0 pyqt pkgs/main/win-64::pyqt-6.7.1-py310h5da7b33_1 pyqt6-sip pkgs/main/win-64::pyqt6-sip-13.9.1-py310h827c3e9_1 pysocks pkgs/main/win-64::pysocks-1.7.1-py310haa95532_0 python-dateutil pkgs/main/win-64::python-dateutil-2.9.0post0-py310haa95532_2 python-fastjsonsc~ pkgs/main/win-64::python-fastjsonschema-2.20.0-py310haa95532_0 python-json-logger pkgs/main/win-64::python-json-logger-3.2.1-py310haa95532_0 pywin32 pkgs/main/win-64::pywin32-308-py310h5da7b33_0 pywinpty pkgs/main/win-64::pywinpty-2.0.15-py310h72d21ff_0 pyzmq pkgs/main/win-64::pyzmq-26.2.0-py310h5da7b33_0 qtbase pkgs/main/win-64::qtbase-6.7.3-h0804d20_0 qtconsole pkgs/main/win-64::qtconsole-5.6.1-py310haa95532_1 qtdeclarative pkgs/main/win-64::qtdeclarative-6.7.3-h5da7b33_0 qtpy pkgs/main/win-64::qtpy-2.4.1-py310haa95532_0 qtsvg pkgs/main/win-64::qtsvg-6.7.3-hf2fb9eb_0 qttools pkgs/main/win-64::qttools-6.7.3-h0de5f00_0 qtwebchannel pkgs/main/win-64::qtwebchannel-6.7.3-h5da7b33_0 qtwebsockets pkgs/main/win-64::qtwebsockets-6.7.3-h5da7b33_0 referencing pkgs/main/win-64::referencing-0.30.2-py310haa95532_0 requests pkgs/main/win-64::requests-2.32.4-py310haa95532_0 rfc3339-validator pkgs/main/win-64::rfc3339-validator-0.1.4-py310haa95532_0 rfc3986-validator pkgs/main/win-64::rfc3986-validator-0.1.1-py310haa95532_0 rpds-py pkgs/main/win-64::rpds-py-0.22.3-py310h636fa0f_0 send2trash pkgs/main/win-64::send2trash-1.8.2-py310haa95532_1 sip pkgs/main/win-64::sip-6.10.0-py310h5da7b33_0 six pkgs/main/win-64::six-1.17.0-py310haa95532_0 sniffio pkgs/main/win-64::sniffio-1.3.0-py310haa95532_0 soupsieve pkgs/main/win-64::soupsieve-2.5-py310haa95532_0 stack_data pkgs/main/noarch::stack_data-0.2.0-pyhd3eb1b0_0 terminado pkgs/main/win-64::terminado-0.17.1-py310haa95532_0 tinycss2 pkgs/main/win-64::tinycss2-1.4.0-py310haa95532_0 tomli pkgs/main/win-64::tomli-2.0.1-py310haa95532_0 tornado pkgs/main/win-64::tornado-6.5.1-py310h827c3e9_0 traitlets pkgs/main/win-64::traitlets-5.14.3-py310haa95532_0 typing-extensions pkgs/main/win-64::typing-extensions-4.12.2-py310haa95532_0 urllib3 pkgs/main/win-64::urllib3-2.5.0-py310haa95532_0 wcwidth pkgs/main/win-64::wcwidth-0.2.13-py310haa95532_0 webencodings pkgs/main/win-64::webencodings-0.5.1-py310haa95532_1 websocket-client pkgs/main/win-64::websocket-client-1.8.0-py310haa95532_0 widgetsnbextension pkgs/main/win-64::widgetsnbextension-4.0.13-py310haa95532_0 win_inet_pton pkgs/main/win-64::win_inet_pton-1.1.0-py310haa95532_0 winpty pkgs/main/win-64::winpty-0.4.3-4 zeromq pkgs/main/win-64::zeromq-4.3.5-hd77b12b_0 zstd pkgs/main/win-64::zstd-1.5.6-h8880b57_0 Proceed ([y]/n)? y Downloading and Extracting Packages: qtbase-6.7.3 | 32.2 MB | ############### | 20% qtdeclarative-6.7.3 | 21.4 MB | ############################################################################ | 100% pandoc-2.12 | 14.6 MB | ############################################################################ | 100% pywin32-308 | 10.5 MB | ################5 | 22% notebook-7.3.2 | 10.2 MB | ############################################################################ | 100% qttools-6.7.3 | 9.4 MB | ############################################################################ | 100% babel-2.16.0 | 6.8 MB | ############################################################################ | 100% jupyterlab-4.3.4 | 5.5 MB | ############################################################################ | 100% qtbase-6.7.3 | 32.2 MB | ###################1 | 25% pyqt-6.7.1 | 3.5 MB | ############################################################################ | 100% qtbase-6.7.3 | 32.2 MB | ###############################7 | 42% qtbase-6.7.3 | 32.2 MB | ###############################################3 | 62% ipython-8.30.0 | 1.2 MB | ############################################################################ | 100% pywin32-308 | 10.5 MB | #######################3 | 31% pywin32-308 | 10.5 MB | ############################ | 37% tornado-6.5.1 | 690 KB | ############################################################################ | 100% prompt-toolkit-3.0.4 | 592 KB | ###################################################################7 | 89% sip-6.10.0 | 576 KB | ############################################################################ | 100% jupyter_server-2.15. | 527 KB | ############################################################################ | 100% nbconvert-core-7.16. | 509 KB | ############################################################################ | 100% qtbase-6.7.3 | 32.2 MB | ############################################################################ | 100% jedi-0.19.2 | 1.1 MB | ############################################################################ | 100% pywin32-308 | 10.5 MB | ##################################################1 | 66% pywin32-308 | 10.5 MB | ########################################9 | 54% pywin32-308 | 10.5 MB | ########################################### | 57% bleach-6.2.0 | 297 KB | | 0% Preparing transaction: done Verifying transaction: done Executing transaction: done 这是在虚拟环境中成功安装了jupyter吗
07-07
评论
成就一亿技术人!
拼手气红包6.0元
还能输入1000个字符
 
红包 添加红包
表情包 插入表情
 条评论被折叠 查看
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值