安装 python at windows
1. 官网安装地址: https://www.python.org/downloads/
自定义安装:
python 添加环境变量 for all users
AI 学习 建议 安装版本:
python:v3.8.10
虚拟环境1:
numpy:1.22
pandas:1.4
虚拟环境2:
numpy:1.13.1
pandas:1.0
建议安装 Jupyter
2. 确认安装的python版本
PS C:\> py --version Python 3.11.0 PS C:\> pip --version pip 22.3.1 from C:\Python311\Lib\site-packages\pip (python 3.11) # powershell admin权限,执行安装cmd PS C:\> py -m pip install --upgrade pip Requirement already satisfied: pip in c:\python311\lib\site-packages (22.3) Collecting pip Using cached pip-22.3.1-py3-none-any.whl (2.1 MB) Installing collected packages: pip Attempting uninstall: pip Found existing installation: pip 22.3 Uninstalling pip-22.3: Successfully uninstalled pip-22.3 Successfully installed pip-22.3.1
安装版本过多 =》执行特定的python脚本
PS C:\> py --list -V:3.11 * Python 3.11 (64-bit) -V:3.10 -V:3.9 Python 3.9 (64-bit) -V:3.8 Python 3.8 (64-bit) -V:3.7 Python 3.7 (64-bit) PS C:\> py -3.8 --version Python 3.8.10
修改python默认版本:
通过py.ini
文件或PY_PYTHON
环境变量自定义此默认值.有关更多详细信息,请参阅文档.
我在py.exe存在的地方创建了一个py.ini
文件,c:\windows\
其中包含以下内容:
[defaults] python=3
PS C:\> py --list -V:3.11 * Python 3.11 (64-bit) -V:3.10 -V:3.9 Python 3.9 (64-bit) -V:3.8 Python 3.8 (64-bit) -V:3.7 Python 3.7 (64-bit) PS C:\> py --list -V:3.11 Python 3.11 (64-bit) -V:3.10 -V:3.9 Python 3.9 (64-bit) -V:3.8 * Python 3.8 (64-bit) -V:3.7 Python 3.7 (64-bit) PS C:\>
PS C:\> py --version Python 3.8.10
3. 针对特定的project 创建 特定的project
why?
特定的project:安装,下载特定的 modules =》避免 版本冲突
how?
3.1 创建目录:python环境,特定的projects
3.2 创建python虚拟环境:创建一个目录 & 目录中 包含所有的依赖
Type: py -m venv Your_Environment_Name_Related_to_your_Project
PS C:\> cd .\Python\ PS C:\Python> ls Directory: C:\Python Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2023/1/20 14:52 panTestProject PS C:\Python> cd .\panTestProject\ PS C:\Python\panTestProject> py -m venv py3_8_10_IA_lab_project PS C:\Python\panTestProject> ls Directory: C:\Python\panTestProject Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2023/1/20 18:55 py3_8_10_IA_lab_project PS C:\Python\panTestProject>
3.2 激活新创建的 虚拟环境 by 激活创建的虚拟环境中的目录的 激活脚本
Type : .\Your_Environment_Name_Related_to_your_Project\Scripts\activate
PS C:\Python\panTestProject> cd .\py3_8_10_IA_lab_project\ PS C:\Python\panTestProject\py3_8_10_IA_lab_project> ls Directory: C:\Python\panTestProject\py3_8_10_IA_lab_project Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2023/1/20 18:55 Include d----- 2023/1/20 18:55 Lib d----- 2023/1/20 18:55 Scripts -a---- 2023/1/20 18:55 90 pyvenv.cfg PS C:\Python\panTestProject\py3_8_10_IA_lab_project> cd .\Scripts\ PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts> ls Directory: C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts Mode LastWriteTime Length Name ---- ------------- ------ ---- -a---- 2023/1/20 18:55 2325 activate -a---- 2023/1/20 18:55 1004 activate.bat -a---- 2023/1/20 18:55 19332 Activate.ps1 -a---- 2023/1/20 18:55 368 deactivate.bat -a---- 2023/1/20 18:55 106378 pip.exe -a---- 2023/1/20 18:55 106378 pip3.8.exe -a---- 2023/1/20 18:55 106378 pip3.exe -a---- 2023/1/20 18:55 537776 python.exe -a---- 2023/1/20 18:55 536752 pythonw.exe -a---- 2023/1/20 18:55 710144 pythonw_d.exe -a---- 2023/1/20 18:55 711168 python_d.exe PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts> .\activate (py3_8_10_IA_lab_project) PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts>
3.3 列出 新创建的 虚拟环境中 的 所有已经安装的 modules
Type : py -m pip list
PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts> .\activate (py3_8_10_IA_lab_project) PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts> cd ../../.. (py3_8_10_IA_lab_project) PS C:\Python> cd .\panTestProject\ (py3_8_10_IA_lab_project) PS C:\Python\panTestProject> py -m pip list Package Version ---------- ------- pip 21.1.1 setuptools 56.0.0 (py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip list Package Version ---------- ------- pip 21.1.1 setuptools 56.0.0 (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
总结:
针对 不同项目,需要 多个不同版本的 modules
=》 创建多个 虚拟环境, 重新安装不同的 module版本
-
A virtual environment is a semi-isolated Python environment that allows packages to be installed for use by a particular application, rather than being installed system wide.
-
venv
is the standard tool for creating virtual environments, and has been part of Python since Python 3.3. Starting with Python 3.4, it defaults to installing into all created virtual environments.pip
python 如何安装 软件包:Installing Packages — Python Packaging User Guide
It’s important to note that the term “package” in this context is being used to describe a bundle of software to be installed (i.e. as a synonym for a distribution). It does not to refer to the kind of package that you import in your Python source code (i.e. a container of modules).
python 如何安装 modules:Installing Python Modules — Python 3.11.1 documentation
python 创建 虚拟环境:venv — Creation of virtual environments — Python 3.11.1 documentation
The module supports creating lightweight “virtual environments”, each with their own independent set of Python packages installed in their site
directories. A virtual environment is created on top of an existing Python installation, known as the virtual environment’s “base” Python, and may optionally be isolated from the packages in the base environment, so only those explicitly installed in the virtual environment are available.
When used from within a virtual environment, common installation tools such as pip will install Python packages into a virtual environment without needing to be told to do so explicitly.
示例:
当前 虚拟环境,安装Jupiter-Notebook
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> py -m pip install jupyterlab Collecting jupyterlab Downloading jupyterlab-3.5.2-py3-none-any.whl (8.8 MB) |████████████████████████████████| 8.8 MB 3.3 MB/s Collecting packaging Downloading packaging-23.0-py3-none-any.whl (42 kB) |████████████████████████████████| 42 kB 463 kB/s Collecting notebook<7 Downloading notebook-6.5.2-py3-none-any.whl (439 kB) |████████████████████████████████| 439 kB 2.2 MB/s Collecting ipython Downloading ipython-8.8.0-py3-none-any.whl (775 kB) |████████████████████████████████| 775 kB 3.3 MB/s Collecting nbclassic Downloading nbclassic-0.4.8-py3-none-any.whl (9.8 MB) |████████████████████████████████| 9.8 MB 2.2 MB/s Collecting jupyterlab-server~=2.10 Downloading jupyterlab_server-2.19.0-py3-none-any.whl (56 kB) |████████████████████████████████| 56 kB 3.8 MB/s Collecting tomli Downloading tomli-2.0.1-py3-none-any.whl (12 kB) Collecting tornado>=6.1.0 Using cached tornado-6.2-cp37-abi3-win_amd64.whl (425 kB) Collecting jinja2>=2.1 Using cached Jinja2-3.1.2-py3-none-any.whl (133 kB) Collecting jupyter-core Downloading jupyter_core-5.1.3-py3-none-any.whl (93 kB) |████████████████████████████████| 93 kB 682 kB/s Collecting jupyter-server<3,>=1.16.0 Downloading jupyter_server-2.1.0-py3-none-any.whl (365 kB) |████████████████████████████████| 365 kB 2.2 MB/s Collecting MarkupSafe>=2.0 Downloading MarkupSafe-2.1.2-cp38-cp38-win_amd64.whl (16 kB) Collecting anyio<4,>=3.1.0 Downloading anyio-3.6.2-py3-none-any.whl (80 kB) |████████████████████████████████| 80 kB 2.5 MB/s Collecting pywinpty Downloading pywinpty-2.0.10-cp38-none-win_amd64.whl (1.4 MB) |████████████████████████████████| 1.4 MB 6.4 MB/s Collecting nbconvert>=6.4.4 Downloading nbconvert-7.2.8-py3-none-any.whl (274 kB) |████████████████████████████████| 274 kB 3.3 MB/s Collecting send2trash Downloading Send2Trash-1.8.0-py3-none-any.whl (18 kB) Collecting jupyter-events>=0.4.0 Downloading jupyter_events-0.6.3-py3-none-any.whl (18 kB) Collecting traitlets>=5.6.0 Downloading traitlets-5.8.1-py3-none-any.whl (116 kB) |████████████████████████████████| 116 kB 2.2 MB/s Collecting websocket-client Downloading websocket_client-1.4.2-py3-none-any.whl (55 kB) |████████████████████████████████| 55 kB 1.1 MB/s Collecting pyzmq>=24 Downloading pyzmq-25.0.0-cp38-cp38-win_amd64.whl (975 kB) |████████████████████████████████| 975 kB 3.3 MB/s Collecting jupyter-server-terminals Downloading jupyter_server_terminals-0.4.4-py3-none-any.whl (13 kB) Collecting argon2-cffi Downloading argon2_cffi-21.3.0-py3-none-any.whl (14 kB) Collecting nbformat>=5.3.0 Downloading nbformat-5.7.3-py3-none-any.whl (78 kB) |████████████████████████████████| 78 kB 1.5 MB/s Collecting jupyter-client>=7.4.4 Downloading jupyter_client-7.4.9-py3-none-any.whl (133 kB) |████████████████████████████████| 133 kB 3.2 MB/s Collecting terminado>=0.8.3 Downloading terminado-0.17.1-py3-none-any.whl (17 kB) Collecting prometheus-client Downloading prometheus_client-0.15.0-py3-none-any.whl (60 kB) |████████████████████████████████| 60 kB 2.0 MB/s Collecting sniffio>=1.1 Downloading sniffio-1.3.0-py3-none-any.whl (10 kB) Collecting idna>=2.8 Downloading idna-3.4-py3-none-any.whl (61 kB) |████████████████████████████████| 61 kB 45 kB/s Collecting entrypoints Using cached entrypoints-0.4-py3-none-any.whl (5.3 kB) Collecting python-dateutil>=2.8.2 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Collecting nest-asyncio>=1.5.4 Using cached nest_asyncio-1.5.6-py3-none-any.whl (5.2 kB) Collecting platformdirs>=2.5 Downloading platformdirs-2.6.2-py3-none-any.whl (14 kB) Collecting pywin32>=1.0 Downloading pywin32-305-cp38-cp38-win_amd64.whl (12.3 MB) |████████████████████████████████| 12.3 MB 1.7 MB/s Collecting python-json-logger>=2.0.4 Downloading python_json_logger-2.0.4-py3-none-any.whl (7.8 kB) Collecting pyyaml>=5.3 Downloading PyYAML-6.0-cp38-cp38-win_amd64.whl (155 kB) |████████████████████████████████| 155 kB 3.3 MB/s Collecting jsonschema[format-nongpl]>=3.2.0 Downloading jsonschema-4.17.3-py3-none-any.whl (90 kB) |████████████████████████████████| 90 kB 3.0 MB/s Collecting rfc3986-validator>=0.1.1 Downloading rfc3986_validator-0.1.1-py2.py3-none-any.whl (4.2 kB) Collecting rfc3339-validator Downloading rfc3339_validator-0.1.4-py2.py3-none-any.whl (3.5 kB) Collecting importlib-resources>=1.4.0 Downloading importlib_resources-5.10.2-py3-none-any.whl (34 kB) Collecting pkgutil-resolve-name>=1.3.10 Using cached pkgutil_resolve_name-1.3.10-py3-none-any.whl (4.7 kB) Collecting attrs>=17.4.0 Downloading attrs-22.2.0-py3-none-any.whl (60 kB) |████████████████████████████████| 60 kB 1.8 MB/s Collecting pyrsistent!=0.17.0,!=0.17.1,!=0.17.2,>=0.14.0 Downloading pyrsistent-0.19.3-cp38-cp38-win_amd64.whl (62 kB) |████████████████████████████████| 62 kB 514 kB/s Collecting jsonpointer>1.13 Downloading jsonpointer-2.3-py2.py3-none-any.whl (7.8 kB) Collecting isoduration Downloading isoduration-20.11.0-py3-none-any.whl (11 kB) Collecting uri-template Downloading uri_template-1.2.0-py3-none-any.whl (10 kB) Collecting fqdn Downloading fqdn-1.5.1-py3-none-any.whl (9.1 kB) Collecting webcolors>=1.11 Downloading webcolors-1.12-py3-none-any.whl (9.9 kB) Collecting zipp>=3.1.0 Downloading zipp-3.11.0-py3-none-any.whl (6.6 kB) Collecting importlib-metadata>=4.8.3 Downloading importlib_metadata-6.0.0-py3-none-any.whl (21 kB) Collecting requests>=2.28 Downloading requests-2.28.2-py3-none-any.whl (62 kB) |████████████████████████████████| 62 kB 479 kB/s Collecting babel>=2.10 Downloading Babel-2.11.0-py3-none-any.whl (9.5 MB) |████████████████████████████████| 9.5 MB 3.2 MB/s Collecting json5>=0.9.0 Downloading json5-0.9.11-py2.py3-none-any.whl (19 kB) Collecting pytz>=2015.7 Downloading pytz-2022.7.1-py2.py3-none-any.whl (499 kB) |████████████████████████████████| 499 kB 3.3 MB/s Collecting nbclient>=0.5.0 Downloading nbclient-0.7.2-py3-none-any.whl (71 kB) |████████████████████████████████| 71 kB 2.6 MB/s Collecting jupyterlab-pygments Downloading jupyterlab_pygments-0.2.2-py2.py3-none-any.whl (21 kB) Collecting tinycss2 Downloading tinycss2-1.2.1-py3-none-any.whl (21 kB) Collecting pygments>=2.4.1 Downloading Pygments-2.14.0-py3-none-any.whl (1.1 MB) |████████████████████████████████| 1.1 MB 2.2 MB/s Collecting beautifulsoup4 Downloading beautifulsoup4-4.11.1-py3-none-any.whl (128 kB) |████████████████████████████████| 128 kB 3.2 MB/s Collecting bleach Downloading bleach-5.0.1-py3-none-any.whl (160 kB) |████████████████████████████████| 160 kB 3.3 MB/s Collecting pandocfilters>=1.4.1 Downloading pandocfilters-1.5.0-py2.py3-none-any.whl (8.7 kB) Collecting mistune<3,>=2.0.3 Using cached mistune-2.0.4-py2.py3-none-any.whl (24 kB) Collecting defusedxml Downloading defusedxml-0.7.1-py2.py3-none-any.whl (25 kB) Collecting fastjsonschema Downloading fastjsonschema-2.16.2-py3-none-any.whl (22 kB) Collecting ipykernel Downloading ipykernel-6.20.2-py3-none-any.whl (149 kB) |████████████████████████████████| 149 kB 2.2 MB/s Collecting ipython-genutils Downloading ipython_genutils-0.2.0-py2.py3-none-any.whl (26 kB) Collecting notebook-shim>=0.1.0 Downloading notebook_shim-0.2.2-py3-none-any.whl (13 kB) Collecting six>=1.5 Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Collecting charset-normalizer<4,>=2 Downloading charset_normalizer-3.0.1-cp38-cp38-win_amd64.whl (95 kB) |████████████████████████████████| 95 kB 1.7 MB/s Collecting certifi>=2017.4.17 Downloading certifi-2022.12.7-py3-none-any.whl (155 kB) |████████████████████████████████| 155 kB 6.4 MB/s Collecting urllib3<1.27,>=1.21.1 Downloading urllib3-1.26.14-py2.py3-none-any.whl (140 kB) |████████████████████████████████| 140 kB 3.3 MB/s Collecting argon2-cffi-bindings Downloading argon2_cffi_bindings-21.2.0-cp36-abi3-win_amd64.whl (30 kB) Collecting cffi>=1.0.1 Downloading cffi-1.15.1-cp38-cp38-win_amd64.whl (178 kB) |████████████████████████████████| 178 kB 3.3 MB/s Collecting pycparser Using cached pycparser-2.21-py2.py3-none-any.whl (118 kB) Collecting soupsieve>1.2 Downloading soupsieve-2.3.2.post1-py3-none-any.whl (37 kB) Collecting webencodings Downloading webencodings-0.5.1-py2.py3-none-any.whl (11 kB) Collecting matplotlib-inline>=0.1 Using cached matplotlib_inline-0.1.6-py3-none-any.whl (9.4 kB) Collecting debugpy>=1.0 Downloading debugpy-1.6.5-cp38-cp38-win_amd64.whl (4.9 MB) |████████████████████████████████| 4.9 MB 2.2 MB/s Collecting comm>=0.1.1 Downloading comm-0.1.2-py3-none-any.whl (6.5 kB) Collecting psutil Using cached psutil-5.9.4-cp36-abi3-win_amd64.whl (252 kB) Collecting prompt-toolkit<3.1.0,>=3.0.11 Downloading prompt_toolkit-3.0.36-py3-none-any.whl (386 kB) |████████████████████████████████| 386 kB 2.2 MB/s Collecting backcall Using cached backcall-0.2.0-py2.py3-none-any.whl (11 kB) Collecting stack-data Downloading stack_data-0.6.2-py3-none-any.whl (24 kB) Collecting decorator Using cached decorator-5.1.1-py3-none-any.whl (9.1 kB) Collecting jedi>=0.16 Using cached jedi-0.18.2-py2.py3-none-any.whl (1.6 MB) Collecting pickleshare Using cached pickleshare-0.7.5-py2.py3-none-any.whl (6.9 kB) Collecting colorama Using cached colorama-0.4.6-py2.py3-none-any.whl (25 kB) Collecting parso<0.9.0,>=0.8.0 Using cached parso-0.8.3-py2.py3-none-any.whl (100 kB) Collecting wcwidth Downloading wcwidth-0.2.6-py2.py3-none-any.whl (29 kB) Collecting arrow>=0.15.0 Downloading arrow-1.2.3-py3-none-any.whl (66 kB) |████████████████████████████████| 66 kB 1.1 MB/s Collecting asttokens>=2.1.0 Downloading asttokens-2.2.1-py2.py3-none-any.whl (26 kB) Collecting pure-eval Using cached pure_eval-0.2.2-py3-none-any.whl (11 kB) Collecting executing>=1.2.0 Using cached executing-1.2.0-py2.py3-none-any.whl (24 kB) Installing collected packages: zipp, six, traitlets, pywin32, python-dateutil, pyrsistent, platformdirs, pkgutil-resolve-name, importlib-resources, attrs, tornado, pyzmq, pycparser, nest-asyncio, jupyter-core, jsonschema, fastjsonschema, entrypoints, arrow, webencodings, webcolors, uri-template, soupsieve, rfc3986-validator, rfc3339-validator, pywinpty, nbformat, MarkupSafe, jupyter-client, jsonpointer, isoduration, idna, fqdn, cffi, wcwidth, tinycss2, terminado, sniffio, pyyaml, python-json-logger, pygments, pure-eval, parso, pandocfilters, packaging, nbclient, mistune, jupyterlab-pygments, jinja2, importlib-metadata, executing, defusedxml, bleach, beautifulsoup4, asttokens, argon2-cffi-bindings, websocket-client, stack-data, send2trash, prompt-toolkit, prometheus-client, pickleshare, nbconvert, matplotlib-inline, jupyter-server-terminals, jupyter-events, jedi, decorator, colorama, backcall, argon2-cffi, anyio, psutil, jupyter-server, ipython, debugpy, comm, urllib3, pytz, notebook-shim, ipython-genutils, ipykernel, charset-normalizer, certifi, requests, nbclassic, json5, babel, tomli, notebook, jupyterlab-server, jupyterlab Successfully installed MarkupSafe-2.1.2 anyio-3.6.2 argon2-cffi-21.3.0 argon2-cffi-bindings-21.2.0 arrow-1.2.3 asttokens-2.2.1 attrs-22.2.0 babel-2.11.0 backcall-0.2.0 beautifulsoup4-4.11.1 bleach-5.0.1 certifi-2022.12.7 cffi-1.15.1 charset-normalizer-3.0.1 colorama-0.4.6 comm-0.1.2 debugpy-1.6.5 decorator-5.1.1 defusedxml-0.7.1 entrypoints-0.4 executing-1.2.0 fastjsonschema-2.16.2 fqdn-1.5.1 idna-3.4 importlib-metadata-6.0.0 importlib-resources-5.10.2 ipykernel-6.20.2 ipython-8.8.0 ipython-genutils-0.2.0 isoduration-20.11.0 jedi-0.18.2 jinja2-3.1.2 json5-0.9.11 jsonpointer-2.3 jsonschema-4.17.3 jupyter-client-7.4.9 jupyter-core-5.1.3 jupyter-events-0.6.3 jupyter-server-2.1.0 jupyter-server-terminals-0.4.4 jupyterlab-3.5.2 jupyterlab-pygments-0.2.2 jupyterlab-server-2.19.0 matplotlib-inline-0.1.6 mistune-2.0.4 nbclassic-0.4.8 nbclient-0.7.2 nbconvert-7.2.8 nbformat-5.7.3 nest-asyncio-1.5.6 notebook-6.5.2 notebook-shim-0.2.2 packaging-23.0 pandocfilters-1.5.0 parso-0.8.3 pickleshare-0.7.5 pkgutil-resolve-name-1.3.10 platformdirs-2.6.2 prometheus-client-0.15.0 prompt-toolkit-3.0.36 psutil-5.9.4 pure-eval-0.2.2 pycparser-2.21 pygments-2.14.0 pyrsistent-0.19.3 python-dateutil-2.8.2 python-json-logger-2.0.4 pytz-2022.7.1 pywin32-305 pywinpty-2.0.10 pyyaml-6.0 pyzmq-25.0.0 requests-2.28.2 rfc3339-validator-0.1.4 rfc3986-validator-0.1.1 send2trash-1.8.0 six-1.16.0 sniffio-1.3.0 soupsieve-2.3.2.post1 stack-data-0.6.2 terminado-0.17.1 tinycss2-1.2.1 tomli-2.0.1 tornado-6.2 traitlets-5.8.1 uri-template-1.2.0 urllib3-1.26.14 wcwidth-0.2.6 webcolors-1.12 webencodings-0.5.1 websocket-client-1.4.2 zipp-3.11.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
当前 虚拟环境,安装 numpy: NumPy - Installing NumPy
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> py -m pip install numpy Collecting numpy Downloading numpy-1.24.1-cp38-cp38-win_amd64.whl (14.9 MB) |████████████████████████████████| 14.9 MB 233 kB/s Installing collected packages: numpy Successfully installed numpy-1.24.1 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
当前 虚拟环境,安装 pandas : pandas - Python Data Analysis Library (pydata.org)
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip install pandas Collecting pandas Downloading pandas-1.5.3-cp38-cp38-win_amd64.whl (11.0 MB) |████████████████████████████████| 11.0 MB 3.3 MB/s Requirement already satisfied: pytz>=2020.1 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from pandas) (2022.7.1) Requirement already satisfied: numpy>=1.20.3 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from pandas) (1.24.1) Requirement already satisfied: python-dateutil>=2.8.1 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from pandas) (2.8.2) Requirement already satisfied: six>=1.5 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from python-dateutil>=2.8.1->pandas) (1.16.0) Installing collected packages: pandas Successfully installed pandas-1.5.3 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_ia_lab_project\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
当前 虚拟环境,安装 SciPy :https://www.scipy.org/install.html
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip install scipy Collecting scipy Downloading scipy-1.10.0-cp38-cp38-win_amd64.whl (42.2 MB) |████████████████████████████████| 42.2 MB 3.2 MB/s Requirement already satisfied: numpy<1.27.0,>=1.19.5 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from scipy) (1.24.1) Installing collected packages: scipy Successfully installed scipy-1.10.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_ia_lab_project\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
当前 虚拟环境,安装 SciKit-Learn:scikit-learn: machine learning in Python — scikit-learn 1.2.0 documentation
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip install -U scikit-learn Collecting scikit-learn Downloading scikit_learn-1.2.0-cp38-cp38-win_amd64.whl (8.2 MB) |████████████████████████████████| 8.2 MB 3.2 MB/s Requirement already satisfied: numpy>=1.17.3 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from scikit-learn) (1.24.1) Requirement already satisfied: scipy>=1.3.2 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from scikit-learn) (1.10.0) Collecting joblib>=1.1.1 Using cached joblib-1.2.0-py3-none-any.whl (297 kB) Collecting threadpoolctl>=2.0.0 Using cached threadpoolctl-3.1.0-py3-none-any.whl (14 kB) Installing collected packages: threadpoolctl, joblib, scikit-learn Successfully installed joblib-1.2.0 scikit-learn-1.2.0 threadpoolctl-3.1.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_ia_lab_project\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip show scikit-learn Name: scikit-learn Version: 1.2.0 Summary: A set of python modules for machine learning and data mining Home-page: http://scikit-learn.org Author: None Author-email: None License: new BSD Location: c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages Requires: threadpoolctl, scipy, numpy, joblib Required-by: (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
当前 虚拟环境,安装 TensorFlow : TensorFlow
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip install tensorflow Collecting tensorflow Downloading tensorflow-2.11.0-cp38-cp38-win_amd64.whl (1.9 kB) Collecting tensorflow-intel==2.11.0 Downloading tensorflow_intel-2.11.0-cp38-cp38-win_amd64.whl (266.3 MB) |████████████████████████████████| 266.3 MB 21 kB/s Collecting protobuf<3.20,>=3.9.2 Downloading protobuf-3.19.6-cp38-cp38-win_amd64.whl (896 kB) |████████████████████████████████| 896 kB 930 kB/s Collecting keras<2.12,>=2.11.0 Downloading keras-2.11.0-py2.py3-none-any.whl (1.7 MB) |████████████████████████████████| 1.7 MB 731 kB/s Collecting gast<=0.4.0,>=0.2.1 Downloading gast-0.4.0-py3-none-any.whl (9.8 kB) Collecting tensorflow-estimator<2.12,>=2.11.0 Downloading tensorflow_estimator-2.11.0-py2.py3-none-any.whl (439 kB) |████████████████████████████████| 439 kB 939 kB/s Collecting h5py>=2.9.0 Downloading h5py-3.7.0-cp38-cp38-win_amd64.whl (2.6 MB) |████████████████████████████████| 2.6 MB 1.1 MB/s Collecting wrapt>=1.11.0 Downloading wrapt-1.14.1-cp38-cp38-win_amd64.whl (35 kB) Collecting termcolor>=1.1.0 Downloading termcolor-2.2.0-py3-none-any.whl (6.6 kB) Collecting grpcio<2.0,>=1.24.3 Downloading grpcio-1.51.1-cp38-cp38-win_amd64.whl (3.7 MB) |████████████████████████████████| 3.7 MB 1.1 MB/s Collecting tensorflow-io-gcs-filesystem>=0.23.1 Downloading tensorflow_io_gcs_filesystem-0.29.0-cp38-cp38-win_amd64.whl (1.5 MB) |████████████████████████████████| 1.5 MB 1.1 MB/s Collecting google-pasta>=0.1.1 Downloading google_pasta-0.2.0-py3-none-any.whl (57 kB) |████████████████████████████████| 57 kB 456 kB/s Collecting astunparse>=1.6.0 Downloading astunparse-1.6.3-py2.py3-none-any.whl (12 kB) Collecting opt-einsum>=2.3.2 Downloading opt_einsum-3.3.0-py3-none-any.whl (65 kB) |████████████████████████████████| 65 kB 2.3 MB/s Requirement already satisfied: packaging in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from tensorflow-intel==2.11.0->tensorflow) (23.0) Requirement already satisfied: numpy>=1.20 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from tensorflow-intel==2.11.0->tensorflow) (1.24.1) Requirement already satisfied: setuptools in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from tensorflow-intel==2.11.0->tensorflow) (56.0.0) Requirement already satisfied: six>=1.12.0 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from tensorflow-intel==2.11.0->tensorflow) (1.16.0) Collecting libclang>=13.0.0 Downloading libclang-15.0.6.1-py2.py3-none-win_amd64.whl (23.2 MB) |████████████████████████████████| 23.2 MB 3.3 MB/s Collecting absl-py>=1.0.0 Downloading absl_py-1.4.0-py3-none-any.whl (126 kB) |████████████████████████████████| 126 kB 3.3 MB/s Collecting typing-extensions>=3.6.6 Using cached typing_extensions-4.4.0-py3-none-any.whl (26 kB) Collecting tensorboard<2.12,>=2.11 Downloading tensorboard-2.11.2-py3-none-any.whl (6.0 MB) |████████████████████████████████| 6.0 MB 3.2 MB/s Collecting flatbuffers>=2.0 Downloading flatbuffers-23.1.4-py2.py3-none-any.whl (26 kB) Collecting wheel<1.0,>=0.23.0 Downloading wheel-0.38.4-py3-none-any.whl (36 kB) Collecting tensorboard-plugin-wit>=1.6.0 Downloading tensorboard_plugin_wit-1.8.1-py3-none-any.whl (781 kB) |████████████████████████████████| 781 kB 6.8 MB/s Requirement already satisfied: requests<3,>=2.21.0 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (2.28.2) Collecting markdown>=2.6.8 Downloading Markdown-3.4.1-py3-none-any.whl (93 kB) |████████████████████████████████| 93 kB 583 kB/s Collecting werkzeug>=1.0.1 Using cached Werkzeug-2.2.2-py3-none-any.whl (232 kB) Collecting google-auth-oauthlib<0.5,>=0.4.1 Downloading google_auth_oauthlib-0.4.6-py2.py3-none-any.whl (18 kB) Collecting google-auth<3,>=1.6.3 Downloading google_auth-2.16.0-py2.py3-none-any.whl (177 kB) |████████████████████████████████| 177 kB 6.8 MB/s Collecting tensorboard-data-server<0.7.0,>=0.6.0 Downloading tensorboard_data_server-0.6.1-py3-none-any.whl (2.4 kB) Collecting pyasn1-modules>=0.2.1 Downloading pyasn1_modules-0.2.8-py2.py3-none-any.whl (155 kB) |████████████████████████████████| 155 kB 3.3 MB/s Collecting rsa<5,>=3.1.4 Downloading rsa-4.9-py3-none-any.whl (34 kB) Collecting cachetools<6.0,>=2.0.0 Downloading cachetools-5.2.1-py3-none-any.whl (9.3 kB) Collecting requests-oauthlib>=0.7.0 Downloading requests_oauthlib-1.3.1-py2.py3-none-any.whl (23 kB) Requirement already satisfied: importlib-metadata>=4.4 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from markdown>=2.6.8->tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (6.0.0) Requirement already satisfied: zipp>=0.5 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from importlib-metadata>=4.4->markdown>=2.6.8->tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (3.11.0) Collecting pyasn1<0.5.0,>=0.4.6 Downloading pyasn1-0.4.8-py2.py3-none-any.whl (77 kB) |████████████████████████████████| 77 kB 1.9 MB/s Requirement already satisfied: urllib3<1.27,>=1.21.1 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (1.26.14) Requirement already satisfied: charset-normalizer<4,>=2 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (3.0.1) Requirement already satisfied: idna<4,>=2.5 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (3.4) Requirement already satisfied: certifi>=2017.4.17 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from requests<3,>=2.21.0->tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (2022.12.7) Collecting oauthlib>=3.0.0 Downloading oauthlib-3.2.2-py3-none-any.whl (151 kB) |████████████████████████████████| 151 kB 3.3 MB/s Requirement already satisfied: MarkupSafe>=2.1.1 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from werkzeug>=1.0.1->tensorboard<2.12,>=2.11->tensorflow-intel==2.11.0->tensorflow) (2.1.2) Installing collected packages: pyasn1, rsa, pyasn1-modules, oauthlib, cachetools, requests-oauthlib, google-auth, wheel, werkzeug, tensorboard-plugin-wit, tensorboard-data-server, protobuf, markdown, grpcio, google-auth-oauthlib, absl-py, wrapt, typing-extensions, termcolor, tensorflow-io-gcs-filesystem, tensorflow-estimator, tensorboard, opt-einsum, libclang, keras, h5py, google-pasta, gast, flatbuffers, astunparse, tensorflow-intel, tensorflow Successfully installed absl-py-1.4.0 astunparse-1.6.3 cachetools-5.2.1 flatbuffers-23.1.4 gast-0.4.0 google-auth-2.16.0 google-auth-oauthlib-0.4.6 google-pasta-0.2.0 grpcio-1.51.1 h5py-3.7.0 keras-2.11.0 libclang-15.0.6.1 markdown-3.4.1 oauthlib-3.2.2 opt-einsum-3.3.0 protobuf-3.19.6 pyasn1-0.4.8 pyasn1-modules-0.2.8 requests-oauthlib-1.3.1 rsa-4.9 tensorboard-2.11.2 tensorboard-data-server-0.6.1 tensorboard-plugin-wit-1.8.1 tensorflow-2.11.0 tensorflow-estimator-2.11.0 tensorflow-intel-2.11.0 tensorflow-io-gcs-filesystem-0.29.0 termcolor-2.2.0 typing-extensions-4.4.0 werkzeug-2.2.2 wheel-0.38.4 wrapt-1.14.1 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_ia_lab_project\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
当前 虚拟环境,安装 Keras : Keras: the Python deep learning API
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip install keras Requirement already satisfied: keras in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (2.11.0) WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_ia_lab_project\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip show keras Name: keras Version: 2.11.0 Summary: Deep learning for humans. Home-page: https://keras.io/ Author: Keras team Author-email: keras-users@googlegroups.com License: Apache 2.0 Location: c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages Requires: Required-by: tensorflow-intel (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
当前 虚拟环境,安装 PyTorch :Start Locally | PyTorch
MatPlotLib :Matplotlib — Visualization with Python
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip install matplotlib Collecting matplotlib Downloading matplotlib-3.6.3-cp38-cp38-win_amd64.whl (7.2 MB) |████████████████████████████████| 7.2 MB 3.3 MB/s Collecting pyparsing>=2.2.1 Using cached pyparsing-3.0.9-py3-none-any.whl (98 kB) Requirement already satisfied: python-dateutil>=2.7 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from matplotlib) (2.8.2) Collecting contourpy>=1.0.1 Downloading contourpy-1.0.7-cp38-cp38-win_amd64.whl (162 kB) |████████████████████████████████| 162 kB 3.2 MB/s Requirement already satisfied: packaging>=20.0 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from matplotlib) (23.0) Collecting cycler>=0.10 Downloading cycler-0.11.0-py3-none-any.whl (6.4 kB) Requirement already satisfied: numpy>=1.19 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from matplotlib) (1.24.1) Collecting fonttools>=4.22.0 Downloading fonttools-4.38.0-py3-none-any.whl (965 kB) |████████████████████████████████| 965 kB 3.3 MB/s Collecting pillow>=6.2.0 Downloading Pillow-9.4.0-cp38-cp38-win_amd64.whl (2.5 MB) |████████████████████████████████| 2.5 MB 3.3 MB/s Collecting kiwisolver>=1.0.1 Downloading kiwisolver-1.4.4-cp38-cp38-win_amd64.whl (55 kB) |████████████████████████████████| 55 kB 1.9 MB/s Requirement already satisfied: six>=1.5 in c:\python\pantestproject\py3_8_10_ia_lab_project\lib\site-packages (from python-dateutil>=2.7->matplotlib) (1.16.0) Installing collected packages: pyparsing, pillow, kiwisolver, fonttools, cycler, contourpy, matplotlib Successfully installed contourpy-1.0.7 cycler-0.11.0 fonttools-4.38.0 kiwisolver-1.4.4 matplotlib-3.6.3 pillow-9.4.0 pyparsing-3.0.9 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_ia_lab_project\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
Plotly Express : https://plotly.com/python/plotly-express/
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject> pip install plotly Collecting plotly Downloading plotly-5.12.0-py2.py3-none-any.whl (15.2 MB) |████████████████████████████████| 15.2 MB 2.2 MB/s Collecting tenacity>=6.2.0 Downloading tenacity-8.1.0-py3-none-any.whl (23 kB) Installing collected packages: tenacity, plotly Successfully installed plotly-5.12.0 tenacity-8.1.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_ia_lab_project\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject>
总结:
- jupyterlab: Overview — JupyterLab 3.6.0rc0 documentation
- Numpy : https://numpy.org/install/
- pandas : https://pandas.pydata.org/
- SciPy : https://www.scipy.org/install.html
- SciKit-Learn : https://scikit-learn.org/stable/
- TensorFlow : https://www.tensorflow.org/
- Keras : https://keras.io/
- PyTorch : https://pytorch.org/get-started/locally/
- MatPlotLib : https://matplotlib.org/
- Plotly Express : https://plotly.com/python/plotly-express/
- python installing packages : https://packaging.python.org/tutorials/installing-packages/
- pip install : https://docs.python.org/3/installing/index.html
- venv documentation : https://docs.python.org/3/library/venv.html
关闭 已经激活的 虚拟环境
(py3_8_10_IA_lab_project) PS C:\Python\panTestProject\py3_8_10_IA_lab_project> ls Directory: C:\Python\panTestProject\py3_8_10_IA_lab_project Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2023/1/20 19:16 etc d----- 2023/1/20 18:55 Include d----- 2023/1/20 18:55 Lib d----- 2023/1/20 19:44 Scripts d----- 2023/1/20 19:17 share -a---- 2023/1/20 18:55 90 pyvenv.cfg (py3_8_10_IA_lab_project) PS C:\Python\panTestProject\py3_8_10_IA_lab_project> deactivate PS C:\Python\panTestProject\py3_8_10_IA_lab_project>
自动激活BAT脚本:
cd C:\[path]\Python\[Your_Environment_Name_Related_to_your_Project]\ call Scripts\activate call jupyter lab C:\[path]\Python\[Your_Environment_Name_Related_to_your_Project]\ PAUSE
PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts> .\activate (py3_8_10_IA_lab_project) PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts> py -m pip list Package Version ---------------------------- ----------- absl-py 1.4.0 anyio 3.6.2 argon2-cffi 21.3.0 argon2-cffi-bindings 21.2.0 arrow 1.2.3 asttokens 2.2.1 astunparse 1.6.3 attrs 22.2.0 Babel 2.11.0 backcall 0.2.0 beautifulsoup4 4.11.1 bleach 5.0.1 cachetools 5.2.1 certifi 2022.12.7 cffi 1.15.1 charset-normalizer 3.0.1 colorama 0.4.6 comm 0.1.2 contourpy 1.0.7 cycler 0.11.0 debugpy 1.6.5 decorator 5.1.1 defusedxml 0.7.1 entrypoints 0.4 executing 1.2.0 fastjsonschema 2.16.2 flatbuffers 23.1.4 fonttools 4.38.0 fqdn 1.5.1 gast 0.4.0 google-auth 2.16.0 google-auth-oauthlib 0.4.6 google-pasta 0.2.0 grpcio 1.51.1 h5py 3.7.0 idna 3.4 importlib-metadata 6.0.0 importlib-resources 5.10.2 ipykernel 6.20.2 ipython 8.8.0 ipython-genutils 0.2.0 isoduration 20.11.0 jedi 0.18.2 Jinja2 3.1.2 joblib 1.2.0 json5 0.9.11 jsonpointer 2.3 jsonschema 4.17.3 jupyter-client 7.4.9 jupyter-core 5.1.3 jupyter-events 0.6.3 jupyter-server 2.1.0 jupyter-server-terminals 0.4.4 jupyterlab 3.5.2 jupyterlab-pygments 0.2.2 jupyterlab-server 2.19.0 keras 2.11.0 kiwisolver 1.4.4 libclang 15.0.6.1 Markdown 3.4.1 MarkupSafe 2.1.2 matplotlib 3.6.3 matplotlib-inline 0.1.6 mistune 2.0.4 nbclassic 0.4.8 nbclient 0.7.2 nbconvert 7.2.8 nbformat 5.7.3 nest-asyncio 1.5.6 notebook 6.5.2 notebook-shim 0.2.2 numpy 1.24.1 oauthlib 3.2.2 opt-einsum 3.3.0 packaging 23.0 pandas 1.5.3 pandocfilters 1.5.0 parso 0.8.3 pickleshare 0.7.5 Pillow 9.4.0 pip 21.1.1 pkgutil-resolve-name 1.3.10 platformdirs 2.6.2 plotly 5.12.0 prometheus-client 0.15.0 prompt-toolkit 3.0.36 protobuf 3.19.6 psutil 5.9.4 pure-eval 0.2.2 pyasn1 0.4.8 pyasn1-modules 0.2.8 pycparser 2.21 Pygments 2.14.0 pyparsing 3.0.9 pyrsistent 0.19.3 python-dateutil 2.8.2 python-json-logger 2.0.4 pytz 2022.7.1 pywin32 305 pywinpty 2.0.10 PyYAML 6.0 pyzmq 25.0.0 requests 2.28.2 requests-oauthlib 1.3.1 rfc3339-validator 0.1.4 rfc3986-validator 0.1.1 rsa 4.9 scikit-learn 1.2.0 scipy 1.10.0 Send2Trash 1.8.0 setuptools 56.0.0 six 1.16.0 sniffio 1.3.0 soupsieve 2.3.2.post1 stack-data 0.6.2 tenacity 8.1.0 tensorboard 2.11.2 tensorboard-data-server 0.6.1 tensorboard-plugin-wit 1.8.1 tensorflow 2.11.0 tensorflow-estimator 2.11.0 tensorflow-intel 2.11.0 tensorflow-io-gcs-filesystem 0.29.0 termcolor 2.2.0 terminado 0.17.1 threadpoolctl 3.1.0 tinycss2 1.2.1 tomli 2.0.1 tornado 6.2 traitlets 5.8.1 typing-extensions 4.4.0 uri-template 1.2.0 urllib3 1.26.14 wcwidth 0.2.6 webcolors 1.12 webencodings 0.5.1 websocket-client 1.4.2 Werkzeug 2.2.2 wheel 0.38.4 wrapt 1.14.1 zipp 3.11.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_IA_lab_project) PS C:\Python\panTestProject\py3_8_10_IA_lab_project\Scripts> cd ../ (py3_8_10_IA_lab_project) PS C:\Python\panTestProject\py3_8_10_IA_lab_project> deactivate PS C:\Python\panTestProject\py3_8_10_IA_lab_project>
AI 学习 建议 安装版本:
python:v3.8.10
jupyter
虚拟环境1:
numpy:1.22
pandas:1.4
PS C:\Python\panTestProject> py -m venv py3_8_10_Numpy1_22_Pandas1_4 PS C:\Python\panTestProject> ls Directory: C:\Python\panTestProject Mode LastWriteTime Length Name ---- ------------- ------ ---- d----- 2023/1/20 19:16 py3_8_10_IA_lab_project d----- 2023/1/20 19:56 py3_8_10_Numpy1_22_Pandas1_4 PS C:\Python\panTestProject> cd .\py3_8_10_Numpy1_22_Pandas1_4\ PS C:\Python\panTestProject\py3_8_10_Numpy1_22_Pandas1_4> .\Scripts\activate (py3_8_10_Numpy1_22_Pandas1_4) PS C:\Python\panTestProject\py3_8_10_Numpy1_22_Pandas1_4> pip install numpy==1.22 Collecting numpy==1.22 Downloading numpy-1.22.0-cp38-cp38-win_amd64.whl (14.7 MB) |████████████████████████████████| 14.7 MB 3.2 MB/s Installing collected packages: numpy Successfully installed numpy-1.22.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_numpy1_22_pandas1_4\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_Numpy1_22_Pandas1_4) PS C:\Python\panTestProject\py3_8_10_Numpy1_22_Pandas1_4> pip install pandas==1.4 Collecting pandas==1.4 Downloading pandas-1.4.0-cp38-cp38-win_amd64.whl (10.6 MB) |████████████████████████████████| 10.6 MB 3.3 MB/s Collecting pytz>=2020.1 Using cached pytz-2022.7.1-py2.py3-none-any.whl (499 kB) Collecting python-dateutil>=2.8.1 Using cached python_dateutil-2.8.2-py2.py3-none-any.whl (247 kB) Requirement already satisfied: numpy>=1.18.5 in c:\python\pantestproject\py3_8_10_numpy1_22_pandas1_4\lib\site-packages (from pandas==1.4) (1.22.0) Collecting six>=1.5 Using cached six-1.16.0-py2.py3-none-any.whl (11 kB) Installing collected packages: six, pytz, python-dateutil, pandas Successfully installed pandas-1.4.0 python-dateutil-2.8.2 pytz-2022.7.1 six-1.16.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_numpy1_22_pandas1_4\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_Numpy1_22_Pandas1_4) PS C:\Python\panTestProject\py3_8_10_Numpy1_22_Pandas1_4> pip list Package Version --------------- -------- numpy 1.22.0 pandas 1.4.0 pip 21.1.1 python-dateutil 2.8.2 pytz 2022.7.1 setuptools 56.0.0 six 1.16.0 WARNING: You are using pip version 21.1.1; however, version 22.3.1 is available. You should consider upgrading via the 'c:\python\pantestproject\py3_8_10_numpy1_22_pandas1_4\scripts\python.exe -m pip install --upgrade pip' command. (py3_8_10_Numpy1_22_Pandas1_4) PS C:\Python\panTestProject\py3_8_10_Numpy1_22_Pandas1_4> deactivate PS C:\Python\panTestProject\py3_8_10_Numpy1_22_Pandas1_4> cd .. PS C:\Python\panTestProject>
AI 学习 建议 安装版本:
python:v3.8.10
jupyter
虚拟环境2:
numpy:1.13.1
pandas:1.0