python 深度学习 解决遇到的报错问题5

目录

一、conda安装shapefile失败

二、conda安装osmnx失败:To search for alternate channels that may provide the conda package you'relooking for, navigate to

三、ERROR: Could not build wheels for llvmlite, which is required to install pyproject.toml-based projects

四、bash: pip: command not found

解决报错:ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none)

解决报错:Exception: HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /anaconda/pkgs/free/linux-64/current_repodata.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:1002)'))

五、linux重新安装miniconda3

5.1 卸载旧的

5.2 安装新的

六 pip install osgeo失败


一、conda安装shapefile失败

报错:

问题:可能是我开梯子的问题,把梯子关掉就好了。

解决:首先关闭VPN!在命令行窗口输入以下命令,查看是否存在.condarc文件:

conda config --show-sources

如果输出如下图所示的信息,出现以下代码,就代表根目录下自动生成了.condarc文件说明,condarc文件已经存在:

如果生成了此文件,将此文件删除。

rm -rf ~/.condarc

然后,尝试重新安装geopandas,

conda install geopandas

使用conda查看,发现安装成功。

conda list  

二、conda安装osmnx失败:To search for alternate channels that may provide the conda package you're
looking for, navigate to

报错:

To search for alternate channels that may provide the conda package you're
looking for, navigate to

解决方法:原来是>>conda install 包,改用>>pip install 包

 使用conda查看,发现安装成功。

conda list  

安装成功了。

三、ERROR: Could not build wheels for llvmlite, which is required to install pyproject.toml-based projects

报错

pip install llvmlite==0.32.1

解决方法:下python版本对应.whl文件进行手动安装。

下载地址:PyPI · The Python Package Index

搜索包名(想安装什么模块就搜自己需要的),

找到对应版本然后点击下载, 

发现,之前没成功安装包是因为我的python3.9版本不对应,重新试了之后,发现安装成功了。

四、bash: pip: command not found

报错:pip未找到命令

原因:原有可能是本身就没有安装pip,又或者pip文件损坏导致pip无法使用。

解决方法:

(1)检查自身python对应版本,执行 python --version 查看,我这里是python 2.7.12版本,

(2)新建一个get-pip.py文件,将pip内容复制进去,内容非常多,链接如下:
https://bootstrap.pypa.io/pip/2.7/get-pip.py
内容如下图所示:

将链接里面的内容全选复制到新建的get-pip.py文件,保存退出。

(3)执行 python get-pip.py 命令,从而安装下载安装pip。

没成功。

解决报错:ERROR: Could not find a version that satisfies the requirement pip<21.0 (from versions: none)

报错:

原因:

解决方法:

解决报错:Exception: HTTPSConnectionPool(host='mirrors.tuna.tsinghua.edu.cn', port=443): Max retries exceeded with url: /anaconda/pkgs/free/linux-64/current_repodata.json (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: EE certificate key too weak (_ssl.c:1002)'))

报错:在我设置好国内源之后,用conda创建虚拟环境,下载python版本时出现以下错误。

原因:这个是因为缺少ssl依赖包,网上的解决方案是yum install openssl-devel ,由于Debian系统没有yum,用apt-get安装安装完成之后只能解决系统自带的python2对应的pip安装问题,无法解决python3的pip3安装问题。

解决方法:编译的时候需加上参数 --with-ssl重新执行make和make install 就可以了

五、linux重新安装miniconda3

5.1 卸载旧的

这一步比较简单,找到miniconda存在的路径,直接删除 miniconda 的那一整个文件就OK了。

5.2 安装新的

(1)找到 miniconda 下载地址,找到自己想装的版本,

下载地址:Index of /anaconda/miniconda/ | 清华大学开源软件镜像站 | Tsinghua Open Source Mirror

下载,上传到服务器上。

(2)使用如下命令安装miniconda,输入以下指令,

bash Miniconda3-py39_23.3.1-0-Linux-x86_64.sh

安装全程要选yes,中间某一步(conda 初始化)默认是 no,一定要选yes。过程中,需要一番简单的操作: 按 enter ---- 3下空格 — 输入yes — 按enter — 输入 yes — 激活配置

安装好之后,输入 bash,即可切换至base环境,

bash

六 pip install osgeo失败

报错:

因此我使用pip install osgeo来安装osgeo第三方库,但是安装失败了,如下图所示: 

原因:该问题通常是由python版本与GDAL安装包的版本不一致导致的。

解决方法:

(1)我们可以通过win+r打开cmd窗口,输入命令:

pip debug --verbose

可以看到支持的版本有这么多种。需要选择适合的一个版本。

(2)进入官方提供的扩展包下载网站寻找版本适配的whl文件,寻找版本适配的whl文件,

  • cpxxx代表cpython版本;
  • 要选择cp(python版本)和你python解释器的版本对应。比如我的python版本是3.9,选择cp39对应的版本即可;
  • 虽然CPU是Intel家的,但是需要选择下载amd64的才能正常pip(因为使用“AMD64”或“amd64”同时指代AMD64和Intel64);

这里我以GDAL‑3.4.3‑cp39‑cp39‑win_amd64.whl为例,

下载好之后需要将这个文件放到对应python3.9版本的路径下,也就是移动到python下载目录下的Scripts目录下,

  • 例如我的路径是:D:\my\python-pycharm\python-envs\pathplanning\Scripts

然后在当前路径下,打开cmd窗口,输入命令,

  • 这里的文件名需要替换为你自己版本的文件名
  • 注意:如果是conda环境,需要启动conda虚拟环境再进行下载
pip install GDAL‑3.4.3‑cp39‑cp39‑win_amd64.whl

如果你出现下面这个提示就表示安装成功了。

如果报is not a supported wheel on this platform错误就表示python版本和GDAL版本不一致导致的。

发现文件夹下出现了相关文件,

回到pycharm写入from osgeo import gdal,或者重新打开需要导入osgeo的文件,未报错,表明安装成功。

  • 2
    点赞
  • 7
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 1
    评论
When searching for an alternate source to find a Conda package you need, you can follow these steps: 1. **Anaconda Cloud** (anaconda.org): Visit the Anaconda Cloud website (<https://anaconda.org>) and search for your package in the repository. You can browse by package name or use the search bar. 2. **Miniconda Channels**: - **Conda-forge** (conda-forge.org): A community-driven channel that provides a wide range of open-source packages. To add it, run `conda config --add channels conda-forge` in your terminal. - **conda-smithy** or **bioconda**: These channels are specific to scientific software or bioinformatics packages, respectively. Add them with `conda config --add channels conda-smithy` or `conda config --add channels bioconda`. 3. **Custom Channels**: - If the package is not available on official channels, you might have to create a custom channel or upload the package yourself if you have the rights to do so. 4. **GitHub Repositories**: - Sometimes, developers host their packages directly on GitHub. Check the package's GitHub page for a "Releases" section where you might find a Conda package. 5. **Using Package Manager Directories**: - Some package managers like `conda` maintain directories (`conda-meta`) where package information is stored. You can look for your package in these directories if you have access to the installation. 6. **Stack Overflow, forums, or GitHub Issues**: - Ask for help in online communities or search for similar issues on GitHub to find out if others have found alternative sources or workarounds. After identifying the appropriate channel, ensure you update your Conda environment and install using the command `conda install <package_name>`, specifying the channel if necessary.
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

水w

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值