当前位置:网站首页>The module created by yourself uses CMD to open the report modulenotfounderror: no module named solution
The module created by yourself uses CMD to open the report modulenotfounderror: no module named solution
2022-07-19 10:03:00 【Lao Xiao of Buddhism】
I have such a project script file

here main.py For my program main entrance , stay pycharm It works correctly , stay cmd It's a mistake

resolvent :
Location cannot find module location :
Here I am reporting Freight This module can't be found
Need to put Freight Add the parent directory of the module to the path
import sys
import os
curPath = os.path.abspath(os.path.dirname(__file__))
rootPath = curPath.split("\Freight")[0]
sys.path.append(rootPath)
there rootpath Then for :
C:\Users\Administrator\PycharmProjects\pythonProject1
This code is placed above the import module statement of the main entry script

Again in CMD No error will be reported when running

边栏推荐
- 华为无线设备配置静态负载均衡
- 第4章-一阶多智体系统一致性 -> 领航跟随系统一致性
- 死锁、线程与进程讲解
- Have you learned the database design pattern of multi tenant SaaS?
- 卫星网络中基于时变图的节能资源分配策略
- 在线教育知识付费网站源码系统+直播+小程序,安装教程
- Chapter 4 - first order multi-agent system consistency - > pilot follow system consistency [program code]
- Experiment 1: camera calibration experiment using Matlab toolbox
- Huawei Shengsi mindspire detailed tutorial
- 网络安全学习(千锋网络安全笔记)1--搭建虚拟机
猜你喜欢

Huawei Shengsi mindspire detailed tutorial

SSH連接華為ModelArts notebook

Clwy permission management (I) -- project construction

Flink入门到实战-阶段五(处理函数)

18. Shell Scripting (1)

Add - before the command in makefile to ignore the error caused by the command and continue to execute the next command

SSH Connection Huawei modelarts Notebook

Experiment 1: camera calibration experiment using Matlab toolbox

华为昇思MindSpore详细教程

Have you learned the database design pattern of multi tenant SaaS?
随机推荐
On the problem of dependency invalidation when the dependency in the basic module is inherited by the sub module in the microservice
TLS四次握手
卫星网络中基于时变图的节能资源分配策略
标准化、归一化和正则化的关系
第1周学习:深度学习入门和pytorch基础
数组模拟队列
二维数组与稀疏数组之间的转换
5分钟就能轻松入门的机器学习基础知识
TLS four handshakes
vc查看内存泄漏
对文本实现分词以及绘制词云
华为Ascend910运行yolov3教程
Run yolov3 on Huawei modelarts_ coco_ detection_ dynamic_ AIPP sample
mof定制材料|超薄MOF纳米带|磁性Fe3O4 @Cd-MOF纳米复合材料|ZIF-8/石墨烯复合纳米颗粒
测试vector、list、set调用empty和size的耗时是否为常数
Huawei wireless device configuration dynamic load balancing
等价域名
Huawei wireless devices are configured with static load balancing
Flink introduction to actual combat - phase IV (time and window diagram)
镧系金属有机骨架([email protected])|罗丹明6G修饰MOF材料|过氧化氢酶@ZIF复合材料|mof材料