1.pydantic

安装pydantic时报以下错误:

ImportError: cannot import name 'Annotated' from 'pydantic.typing' (C:\Users\duole\anaconda3\envs\vrh\lib\site-packages\pydantic\typing.py)

这个是版本错误,删除装好的版本,重新指定版本安装就可以了,解决方法:

pip uninstall pydantic

pip install pydantic==1.10.8

2.zlibwapi

Could not locate zlibwapi.dll. Please make sure it is in your library path!

这是缺少dll的问题,打开下面网站,找到Zlib文件,下载Installation Guide - NVIDIA Docsicon-default.png?t=N7T8https://docs.nvidia.com/deeplearning/cudnn/install-guide/index.html#installdriver-windows

解压文件

lib文件放到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vxx.x\lib
dll文件放到C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\vxx.x\bin

xxx.x是cuda的版本。

3.Numpy

3.1 Numpy版本过高

AttributeError: module ‘numpy’ has no attribute ‘complex’. np.complex was a deprecated alias for the builtin complex. To avoid this error in existing code, use complex by itself. Doing this will not modify any behavior and is safe. If you speci

这是numpy1.24以上的版本的问题,降到1.23就可以解决这个问题了。

pip uninstall numpy
pip install numpy==1.23

3.1 Numpy版本过低

ImportError:Numba needs NumPy 1.22 or less

pip uninstall numpy
pip install numpy

3.2 Numpy与python版本不兼容

RuntimeWarning: NumPy 1.19.5 may not yet support Python 3.10.

python 退回3.9就可以了。

### 3.3 charset-normalizer

cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant'

pip install --upgrade charset-normalizer

pip uninstall charset-normalizer
pip install charset-normalizer

4.yaml.load()报错

TypeError: load() missing 1 required positional argument: ‘Loader’

2.原因:
Yaml 5.1版本后就舍弃了 yaml.load(file) 这个用法。Yaml 5.1版本之后为使得load函数的安全性得以提高,就修改了需要指定Loader,通过默认加载​​器(FullLoader)禁止执行任意函数。

3.解决方法:
有三种解决办法(三选一即可):

d1=yaml.load(file,Loader=yaml.FullLoader)
d1=yaml.safe_load(file)
d1=yaml.load(file, Loader=yaml.CLoader)


 

Logo

旨在为数千万中国开发者提供一个无缝且高效的云端环境,以支持学习、使用和贡献开源项目。

更多推荐