目录
正文开始:
打开“anaconda prompt”环境:
创建环境并指定名称:
conda create --name SB python=3.8
运行:
继续:“Y”,会自动安装必备的库
下面是安装各种库:
GDAL安装
找到一篇宝藏博主,可以直接下载gdal库
01.Releases · cgohlke/geospatial-wheels (github.com)
02.Release v2024.1.1 · cgohlke/geospatial-wheels · GitHub
找到相应的库下载
下载后的文件
将下载的文件放到python环境路径下:
“F:\anaconda\envs\SB\Scripts\”
回到conda环境,安装gdal依赖库
pip install GDAL-3.8.4-cp311-cp311-win_amd64.whl
如果报错,试试下面这种写法:
pip install F:\anaconda\envs\SB\Scripts\GDAL-3.8.4-cp311-cp311-win_amd64.whl
这样,gdal库就安装ok了
Numpy
numpy直接安装即可,不需要考虑版本
pip install numpy
这样numpy就安装成功了
Tqdm
直接安装即可
pip install tqdm
如果显示下载轮子失败,可以试试镜像源:
推荐几个镜像源:(清华镜像源比较好用)
清华大学镜像源:https://pypi.tuna.tsinghua.edu.cn/simple/
阿里云镜像源:http://mirrors.aliyun.com/pypi/simple/
中国科技大学镜像源:https://pypi.mirrors.ustc.edu.cn/simple/
华中科技大学镜像源:http://pypi.hustunique.com/simple/
上海交通大学镜像源:https://mirror.sjtu.edu.cn/pypi/web/simple/
豆瓣镜像源:http://pypi.douban.com/simple/
山东理工大学镜像源:http://pypi.sdutlinux.org/
百度镜像源:https://mirror.baidu.com/pypi/simple
pip install tqdm https://pypi.tuna.tsinghua.edu.cn/simple/
如果报错,再试试加上具体版本号
pip install tqdm==4.62.2 https://pypi.tuna.tsinghua.edu.cn/simple/
这样,就安装成功了
pyinstaller
封装库
pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple/
我们打开代码看一下,运行一下:
没有下划线了,环境都ok了
运行一下,也ok
-------------ending-----------