0


BUG日志

此文总结了我遇到过的问题和解决方法,可以提供一定的参考价值

一、No module named 'pandas._libs.tslib' not built

ModuleNotFoundError: No module named 'kiwisolver'

解决方法:卸载重装就能得到可以适配的版本包

注:遇到这些问题时是可以正常import的

二、ERROR: Could not find a version that satisfies the requirement kiwisolover (from versions: none)
ERROR: No matching distribution found for kiwisolover

包名有误

三、系统名是中文的可能会有问题,以及初始化c盘之后会莫名其妙地解决问题

四、ValueError: check_hostname requires server_hostname

解决方法:关闭VPN或者代理

五、raise ReadTimeoutError

超时,考虑换源或者VPN

六、Could not find a version that satisfies the requirement numpy==1.13.3 (from versions: 1.14.5, 1.14.6, 1.15.0rc2, 1.15.0, 1.15.1, 1.15.2, 1.15.3, 1.15.4, 1.16.0rc1, 1.16.0rc2, 1.16.0, 1.16.1, 1.16.2, 1.16.3, 1.16.4, 1.16.5, 1.16.6, 1.17.0rc1, 1.17.0rc2, 1.17.0, 1.17.1, 1.17.2, 1.17.3, 1.17.4, 1.17.5, 1.18.0rc1, 1.18.0, 1.18.1, 1.18.2, 1.18.3, 1.18.4, 1.18.5, 1.19.0rc1, 1.19.0rc2, 1.19.0, 1.19.1, 1.19.2, 1.19.3, 1.19.4, 1.19.5, 1.20.0rc1, 1.20.0rc2, 1.20.0, 1.20.1, 1.20.2, 1.20.3, 1.21.0rc1, 1.21.0rc2, 1.21.0)
No matching distribution found for numpy==1.13.3

原因:pip版本太低

解决方法:pip install --upgrade pip

七、

CondaError: Downloaded bytes did not match Content-Length
  url: https://repo.anaconda.com/pkgs/main/linux-64/cudnn-7.0.5-cuda8.0_0.tar.bz2
  target_path: /home/yyf/miniconda3/pkgs/cudnn-7.0.5-cuda8.0_0.tar.bz2
  Content-Length: 261398285
  downloaded bytes: 47463195

可以参考这篇博客Conda - Downloaded bytes did not match Content-Length 问题解决方案_月夜长影的博客-CSDN博客

解决方法是创建.condarc 更换国内源(同时才发现conda无法直接通过-i的方式加源)

conda config --set show_channel_urls yes
conda clean -i

恢复原始源只需手动删除.condarc文件即可

具体如何换源参考这篇文章的最后一部分

Anaconda安装与新建虚拟环境_sixian666的博客-CSDN博客_anaconda安装新环境

但是这里会出错,报错如下

CondaHTTPError: HTTP 000 CONNECTION FAILED for url <https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main/noarch/repodata.json>
Elapsed: -

原因:HTTPS协议不能用

解决方法:改为HTTP

八、在安装pytorch环境时遇到了这个问题 (但是新建虚拟环境时没有遇到,可能是因为在安装包时对conda版本的要求更高)

CondaValueError: Malformed version string '~': invalid characte

解决方法:更新conda

conda upgrade -n base -c defaults --override-channels conda

九、在激活虚拟环境时遇到问题

CommandNotFoundError: Your shell has not been properly configured to use 'conda activate'.
To initialize your shell, run

    $ conda init <SHELL_NAME>

Currently supported shells are:
  - bash
  - fish
  - tcsh
  - xonsh
  - zsh
  - powershell

See 'conda init --help' for more information and options.

IMPORTANT: You may need to close and restart your shell after running 'conda init'.

解决方法:

参考这篇博客

a.按照提示执行 conda init+相应的类型 指令,例如

conda init cmd.exe

(因为没看到cmd选项我还在尝试bash和zsh,然后它在我的用户名目录下生成了文件,应该可以直接删除吧(流汗)

b.切换到Anaconda Prompt激活,但是回到cmd还是会相同报错

c.这个方法我在cmd中用不了,提示没有这个指令,可能是要在某种特定的shell

# 首次使用 source activate 命令激活虚拟环境 my_conda_virutal_environment
source activate my_conda_virutal_environment
# 退出虚拟环境
conda deactivate
# 以后使用 conda activate 命令激活虚拟环境
conda activate my_conda_virutal_environment

十、包和包、包和环境版本不匹配问题

首先,为什么会出现这个问题?我很困惑,不应该安装的时候就安装的是兼容的版本吗

我的python38就出现了和numpy不兼容的情况,最后的解决方法是新开了一个python36的环境,操作一模一样,但是没有出问题,所以也建议大家选择Python36

还有遇到的很多ImportError(这些ImportError我没有记录,因为莫名其妙的又没有了)

十一、在安装opencv时出现了这个问题(Python36),暂时还没影响使用

Collecting pywinpty>=1.1.0
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/c3/61/bda90dba80bc6cb905acebd0bf0710777ab04feb29d0f438202da0e82d72/pywinpty-2.0.3.tar.gz (23 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmpiv3i8a4p'
         cwd: C:\Users\17758\AppData\Local\Temp\pip-install-86iw3mw6\pywinpty_8672751d0ecb47d884dcf2c32de97a0e
    Complete output (6 lines):

    Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/

    Checking for Rust toolchain....
    ----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/c3/61/bda90dba80bc6cb905acebd0bf0710777ab04feb29d0f438202da0e82d72/pywinpty-2.0.3.tar.gz#sha256=6b29a826e896105370c38d53904c3aaac6c36146a50448fc0ed5082cf9d092bc (from https://pypi.tuna.tsinghua.edu.cn/simple/pywinpty/) (requires-python:>=3.6). Command errored out with exit status 1: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmpiv3i8a4p' Check the logs for full command output.
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/43/88/f7d9b3b45a8b6109f60702cfa3b011edf7cfd8d2680f738bc4d1cb120897/pywinpty-2.0.2.tar.gz (22 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmp63so3it9'
         cwd: C:\Users\17758\AppData\Local\Temp\pip-install-86iw3mw6\pywinpty_6907665a05b74cc78ab409cb4301d618
    Complete output (6 lines):

    Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/

    Checking for Rust toolchain....
    ----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/43/88/f7d9b3b45a8b6109f60702cfa3b011edf7cfd8d2680f738bc4d1cb120897/pywinpty-2.0.2.tar.gz#sha256=20ec117183f79642eff555ce0dd1823f942618d65813fb6122d14b6e34b5d05a (from https://pypi.tuna.tsinghua.edu.cn/simple/pywinpty/) (requires-python:>=3.6). Command errored out with exit status 1: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmp63so3it9' Check the logs for full command output.
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/b0/85/4a563e195fd5de30e4e18c51a4c398adbcbf656ca9166182ee44e2454719/pywinpty-2.0.1.tar.gz (22 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmp7u79446h'
         cwd: C:\Users\17758\AppData\Local\Temp\pip-install-86iw3mw6\pywinpty_f161c75542234f0d9226d41114024ede
    Complete output (6 lines):

    Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/

    Checking for Rust toolchain....
    ----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/b0/85/4a563e195fd5de30e4e18c51a4c398adbcbf656ca9166182ee44e2454719/pywinpty-2.0.1.tar.gz#sha256=14e7321c6d43743af0de175fca9f111c5cc8d0a9f7c608c9e1cc69ec0d6ac146 (from https://pypi.tuna.tsinghua.edu.cn/simple/pywinpty/) (requires-python:>=3.6). Command errored out with exit status 1: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmp7u79446h' Check the logs for full command output.
  Downloading https://pypi.tuna.tsinghua.edu.cn/packages/9d/6f/79499cdaecb9b83a26dcce6f886312ef23b13392c3ed6047d105de17b740/pywinpty-2.0.0.tar.gz (22 kB)
  Installing build dependencies ... done
  Getting requirements to build wheel ... done
    Preparing wheel metadata ... error
    ERROR: Command errored out with exit status 1:
     command: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmpztjqkq72'
         cwd: C:\Users\17758\AppData\Local\Temp\pip-install-86iw3mw6\pywinpty_aad8cee9d2c4423d846dbef54f407407
    Complete output (6 lines):

    Cargo, the Rust package manager, is not installed or is not on PATH.
    This package requires Rust and Cargo to compile extensions. Install it through
    the system's package manager or via https://rustup.rs/

    Checking for Rust toolchain....
    ----------------------------------------
WARNING: Discarding https://pypi.tuna.tsinghua.edu.cn/packages/9d/6f/79499cdaecb9b83a26dcce6f886312ef23b13392c3ed6047d105de17b740/pywinpty-2.0.0.tar.gz#sha256=42311cbe4fde298ae23a8ada04fbf1f76b88072f9f89c96fe938749558cf897d (from https://pypi.tuna.tsinghua.edu.cn/simple/pywinpty/) (requires-python:>=3.6). Command errored out with exit status 1: 'D:\Anaconda\envs\pytorch\python.exe' 'D:\Anaconda\envs\pytorch\lib\site-packages\pip\_vendor\pep517\in_process\_in_process.py' prepare_metadata_for_build_wheel 'C:\Users\17758\AppData\Local\Temp\tmpztjqkq72' Check the logs for full command output.

十二、安装完pyzbar后不能正常地使用pyzbar.pyzbar

解决方法:安装VS2019

标签: 大数据

本文转载自: https://blog.csdn.net/sixian666/article/details/125692046
版权归原作者 sixian666 所有, 如有侵权,请联系我们删除。

“BUG日志”的评论:

还没有评论