python3.11.4和paddle2.5.1安装CPU版本-笔记
一、python3.11.4安装
下载地址:https://www.python.org/downloads/windows/
Python Releases for Windows
Latest Python 3 Release - Python 3.11.4
https://www.python.org/downloads/release/python-3114/
二、paddle2.5.1安装
CPU 版的 PaddlePaddle OK
python -m pip install paddlepaddle==2.5.1 -i https://mirror.baidu.com/pypi/simple
python -m pip install paddlepaddle==2.5.1 -i https://mirror.baidu.com/pypi/simple
以下是其他来源地址下载方式:
python -m pip install paddlepaddle==2.5.1 -i https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: HTTP error 403 while getting https://pypi.tuna.tsinghua.edu.cn/packages/07
如果报上面的错误信息换成下面的地址下载和安装
python -m pip install paddlepaddle==2.5.1 -i https://pypi.douban.com/simple
需要先升级:
python.exe -m pip install --upgrade pip
python.exe -m pip install --upgrade pip
[notice] A new release of pip is available: 23.1.2 -> 23.2.1
[notice] To update, run: python.exe -m pip install --upgrade pip
升级pip为23.2.1版本的详细过程:
=====================================
E:\python311>python.exe -m pip install --upgrade pip
Requirement already satisfied: pip in e:\python311\lib\site-packages (23.1.2)
Collecting pip
Downloading pip-23.2.1-py3-none-any.whl (2.1 MB)
---------------------------------------- 2.1/2.1 MB 38.8 kB/s eta 0:00:00
Installing collected packages: pip
Attempting uninstall: pip
Found existing installation: pip 23.1.2
Uninstalling pip-23.1.2:
Successfully uninstalled pip-23.1.2
Successfully installed pip-23.2.1
安装paddle2.5.1的详细过程:
==================================
E:\python311>python -m pip install paddlepaddle==2.5.1 -i https://mirror.baidu.com/pypi/simple
Looking in indexes: https://mirror.baidu.com/pypi/simple
Collecting paddlepaddle==2.5.1
Downloading https://mirror.baidu.com/pypi/packages/07/f2/c32d96d9227a71812e96db8f4e6468fb7348bb837238f4416faaeb13443c/paddlepaddle-2.5.1-cp311-cp311-win_amd64.whl (72.0 MB)
---------------------------------------- 72.0/72.0 MB 5.8 MB/s eta 0:00:00
Collecting httpx (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/ec/91/e41f64f03d2a13aee7e8c819d82ee3aa7cdc484d18c0ae859742597d5aa0/httpx-0.24.1-py3-none-any.whl (75 kB)
---------------------------------------- 75.4/75.4 kB 4.1 MB/s eta 0:00:00
Collecting numpy>=1.13 (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/72/b2/02770e60c4e2f7e158d923ab0dea4e9f146a2dbf267fec6d8dc61d475689/numpy-1.25.2-cp311-cp311-win_amd64.whl (15.5 MB)
---------------------------------------- 15.5/15.5 MB 8.7 MB/s eta 0:00:00
Collecting Pillow (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/66/d4/054e491f0880bf0119ee79cdc03264e01d5732e06c454da8c69b83a7c8f2/Pillow-10.0.0-cp311-cp311-win_amd64.whl (2.5 MB)
---------------------------------------- 2.5/2.5 MB 6.4 MB/s eta 0:00:00
Collecting decorator (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/d5/50/83c593b07763e1161326b3b8c6686f0f4b0f24d5526546bee538c89837d6/decorator-5.1.1-py3-none-any.whl (9.1 kB)
Collecting astor (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/c3/88/97eef84f48fa04fbd6750e62dcceafba6c63c81b7ac1420856c8dcc0a3f9/astor-0.8.1-py2.py3-none-any.whl (27 kB)
Collecting paddle-bfloat==0.1.7 (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/17/5e/7024de698a4a6b3604ae25466bffee5ce9fe3ff3a07102938ca6f2e86a42/paddle_bfloat-0.1.7-cp311-cp311-win_amd64.whl (39 kB)
Collecting opt-einsum==3.3.0 (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/bc/19/404708a7e54ad2798907210462fd950c3442ea51acc8790f3da48d2bee8b/opt_einsum-3.3.0-py3-none-any.whl (65 kB)
---------------------------------------- 65.5/65.5 kB ? eta 0:00:00
Collecting protobuf<=3.20.2,>=3.1.0 (from paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/8b/e6/2a47ce2eba1aaf287380a44270da897ada03d118a55c19595ec7b4f0831f/protobuf-3.20.2-py2.py3-none-any.whl (162 kB)
---------------------------------------- 162.1/162.1 kB 9.5 MB/s eta 0:00:00
Collecting certifi (from httpx->paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/4c/dd/2234eab22353ffc7d94e8d13177aaa050113286e93e7b40eae01fbf7c3d9/certifi-2023.7.22-py3-none-any.whl (158 kB)
---------------------------------------- 158.3/158.3 kB 9.3 MB/s eta 0:00:00
Collecting httpcore<0.18.0,>=0.15.0 (from httpx->paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/94/2c/2bde7ff8dd2064395555220cbf7cba79991172bf5315a07eb3ac7688d9f1/httpcore-0.17.3-py3-none-any.whl (74 kB)
---------------------------------------- 74.5/74.5 kB 4.0 MB/s eta 0:00:00
Collecting idna (from httpx->paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/fc/34/3030de6f1370931b9dbb4dad48f6ab1015ab1d32447850b9fc94e60097be/idna-3.4-py3-none-any.whl (61 kB)
---------------------------------------- 61.5/61.5 kB 3.4 MB/s eta 0:00:00
Collecting sniffio (from httpx->paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/c3/a0/5dba8ed157b0136607c7f2151db695885606968d1fae123dc3391e0cfdbf/sniffio-1.3.0-py3-none-any.whl (10 kB)
Collecting h11<0.15,>=0.13 (from httpcore<0.18.0,>=0.15.0->httpx->paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/95/04/ff642e65ad6b90db43e668d70ffb6736436c7ce41fcc549f4e9472234127/h11-0.14.0-py3-none-any.whl (58 kB)
---------------------------------------- 58.3/58.3 kB 3.0 MB/s eta 0:00:00
Collecting anyio<5.0,>=3.0 (from httpcore<0.18.0,>=0.15.0->httpx->paddlepaddle==2.5.1)
Downloading https://mirror.baidu.com/pypi/packages/19/24/44299477fe7dcc9cb58d0a57d5a7588d6af2ff403fdd2d47a246c91a3246/anyio-3.7.1-py3-none-any.whl (80 kB)
---------------------------------------- 80.9/80.9 kB 4.7 MB/s eta 0:00:00
Installing collected packages: paddle-bfloat, sniffio, protobuf, Pillow, numpy, idna, h11, decorator, certifi, astor, opt-einsum, anyio, httpcore, httpx, paddlepaddle
Successfully installed Pillow-10.0.0 anyio-3.7.1 astor-0.8.1 certifi-2023.7.22 decorator-5.1.1 h11-0.14.0 httpcore-0.17.3 httpx-0.24.1 idna-3.4 numpy-1.25.2 opt-einsum-3.3.0 paddle-bfloat-0.1.7 paddlepaddle-2.5.1 protobuf-3.20.2 sniffio-1.3.0
E:\python311>
三、安装paddle环境测试代码:
python -c “import paddle; print(paddle.version)”
python -c "import paddle; print(paddle.__version__)"
报错问题如下所示:
ImportError: DLL load failed while importing libpaddle: 找不到指定的模块。
下载安装VC_redist.x64.exe
https://www.xitongzhijia.net/soft/225178.html
https://www.xitongzhijia.net/soft/225178.html
可解决上面的问题。
安装测试OK
E:\python311>python -c “import paddle; print(paddle.version)”
2.5.1
E:\python311>python -c "import paddle; print(paddle.__version__)"
2.5.1
四、vsCode环境安装扩展Python后测试文件:
testPaddleInstall.py
import paddle
paddle.utils.run_check()
import paddle
paddle.utils.run_check()
测试结果为:
PS F:\project\python\cwgis> & E:/python311/python.exe f:/project/python/cwgis/testPaddleInstall.py
Running verify PaddlePaddle program …
I0805 19:16:48.042397 12912 interpretercore.cc:237] New Executor is Running.
I0805 19:16:51.290495 12912 interpreter_util.cc:518] Standalone Executor is Used.
PaddlePaddle works well on 1 CPU.
PaddlePaddle is installed successfully! Let’s start deep learning with PaddlePaddle now.
PS F:\project\python\cwgis>