当前位置:网站首页>pytest框架优化
pytest框架优化
2022-08-10 14:36:00 【疯批美人东方陨】
1. 如遇
from libs.file_operate.read_conf import setting
ModuleNotFoundError: No module named 'libs'
解决办法:添加如下内容
import sys
sys.path.append('.')
有时候,自己在运行代码时,明明pycharm上在引用包时,系统可以正常识别到包,运行也一切正常。但是到终端去运行代码就会报错,发现无法正常引用自己编写的包了。详细解释可以看这一篇sys详解
python就会在你的当前运行目录下搜索对应的包,自己编写的模块就能顺利引用了。注意:sys.path.append('.')这段代码要添加在自己引用包的代码之前,不然也会出错
边栏推荐
- 【MinIO】Using tools
- 【有限元分析】异型密封圈计算泄漏量与参数化优化过程(带分析源文件)
- fatal error C1083 无法打开包括文件'io.h' No such file
- FPN详解
- laravel 抛错给钉钉
- 力扣解法汇总640-求解方程
- Summary of tensorflow installation stepping on the pit
- 面试面到了一个腾讯30k出来的,有见识到何为精通MySQL调优
- “Oracle 封禁了我的账户”
- PHP judges whether the file has content, and if there is no content, copy another file to write
猜你喜欢
随机推荐
物资采购小程序开发制作功能介绍
tensorflow安装踩坑总结
Steam教育在新时代中综合学习论
Second half of 2011 System Architect Afternoon Paper II
写不完的数学试卷-----试卷生成器(Qt含源码)
符合信创要求的堡垒机有哪些?支持哪些系统?
重要通知 | “移动云杯”算力网络应用创新大赛初赛延期!!
@RequestBody的使用[通俗易懂]
2012年下半年 系统架构设计师 下午试卷 II
Lack of comparators, op amps come to the rescue!(Op amp is recorded as a comparator circuit)
这一次,话筒给你:向自由软件之父斯托曼 提问啦!
redhat替换yum源时redhat.repo无法删除或无法禁用的问题解决方法
面试面到了一个腾讯30k出来的,有见识到何为精通MySQL调优
高薪程序员&面试题精讲系列135之你对分布式是怎么理解的?CAP理论你知道吗?
Do not access Object.prototype method ‘hasOwnProperty‘ from target object....
波士顿房价预测
数学建模学习视频及资料集(2022.08.10)
DB2查询2个时间段之间的所有月份,DB2查询2个时间段之间的所有日期
领域驱动模型设计与微服务架构落地-从项目去剖析领域驱动
PHP judges whether the file has content, and if there is no content, copy another file to write