我是Python新手,我正在使用pytest运行一个测试脚本。我不知道该怎么解决这个问题。我已经尝试了安装pip install pyangbind,上面写着--要求已经满足了。我有点不知道下一步该怎么做。
然而,我正面临着这个问题--
#pytest test.py
Hint: make sure your test modules/packages have valid Python names.
Traceback:
test.py:12: in <module>
from config.generator import NcConfig
../config/generator.py:4: in <module>
from .base import PybBase
../config/base.py:9: in <module>
from pyangbind.lib.serialise import pybindIETFXMLEncoder
E ImportError: cannot import name 'pybindIETFXMLEncoder'python freeze告诉我--以下是对我的虚拟py环境的依赖
$pip freeze
asn1crypto==0.24.0
atomicwrites==1.1.5
attrs==18.1.0
bcrypt==3.1.4
bitarray==0.8.3
certifi==2018.4.16
cffi==1.11.5
chardet==3.0.4
cryptography==2.3
defusedxml==0.5.0
enum34==1.1.6
idna==2.7
jira==1.0.15
lxml==4.2.3
more-itertools==4.2.0
ncclient==0.5.4
oauthlib==2.1.0
paramiko==2.4.1
pathlib2==2.3.2
pbr==4.0.4
pluggy==0.6.0
py==1.5.4
pyang==1.7.5
pyangbind==0.8.1
pyasn1==0.4.4
pycparser==2.18
PyNaCl==1.2.1
pytest==3.5.1
regex==2018.7.11
requests==2.19.0
requests-oauthlib==1.0.0
requests-toolbelt==0.8.0
six==1.11.0
tabulate==0.8.2
urllib3==1.23python版本是3.5.2。
$python --version
Python 3.5.2发布于 2018-07-31 14:29:21
您尝试从pyangbind.lib.serialise导入的名称在0.8.1版中不存在。该版本于2018年5月发布,而该类型仅在2018年6月发布committed to the repository。
如果您希望使用此类型,则需要使用source repository中尚未发布的代码。
有关如何执行此操作,请参阅pip documentation。
https://stackoverflow.com/questions/51606284
复制相似问题