我正在尝试在python中进行线路配置文件和内存配置文件。 我通过导入line_profiler 从line_profiler导入LineProfiler 当我运行代码时,出现错误消息: ModuleNotFoundError:没有名为“ line_profiler”的模块
当我尝试使用pip install进行安装时:
py -m pip install line_profiler
一切都很好,但是最后它以红色显示了一些东西
C:\ Users \ asmobari> py -m pip install line_profiler收集 line_profiler使用缓存 https://files.pythonhosted.org/packages/14/fc/ecf4e238bb601ff829068e5a72cd1bd67b0ee0ae379db172eb6a0779c6b6/line_profiler-2.1.2.tar.gz 已经满足要求:IPython> = 0.13 in c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自line_profiler)(7.0.1)已满足要求: 特质> = 4.2 in c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(4.3.2)已有要求 满意:simplegeneric> 0.8 in c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(0.8.1)已有要求 满意:回拨 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(0.1.0)已有要求 满意:装潢在 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(4.3.0)已有要求 满意:在 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(0.7.5)已有要求 满意:jedi> = 0.10 in c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(0.13.1)已有要求 满意:在 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(2.2.0)已有要求 满意:colorama; sys_platform ==“ win32”在 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(0.4.0)已有要求 满意:提示工具包<2.1.0,> = 2.0.0 in c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(2.0.6)已有要求 满意:setuptools> = 18.5 in c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自IPython> = 0.13-> line_profiler)(39.0.1)已有要求 满意:ipython-genutils在 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自traitlets> = 4.2-> IPython> = 0.13-> line_profiler)(0.2.0) 已满足要求:六英寸 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自traitlets> = 4.2-> IPython> = 0.13-> line_profiler)(1.11.0) 已经满足要求:parso> = 0.3.0 in c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自jedi> = 0.10-> IPython> = 0.13-> line_profiler)(0.3.1)要求 已经满足:wcwidth c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages (来自提示工具包<2.1.0,> = 2.0.0-> IPython> = 0.13-> line_profiler) (0.1.7)安装收集的软件包:line-profiler运行 为line-profiler安装setup.py ...错误 来自命令C:\ Users \ asmobari \ AppData \ Local \ Programs \ Python \ Python37 \ python.exe -u的完整输出 -c“导入设置工具,标记化; 文件 ='C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-install-2w13a4ux \ line-profiler \ setup.py'; f = getattr(标记化, '打开',打开)(文件);代码= f.read()。replace('\ r \ n', '\ n'); f.close(); exec(compile(code, file ,'exec')))“安装 --record C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-record-h8dq1h7x \ install-record.txt -单一版本-外部管理-编译: 运行安装 运行构建 运行build_py 创建版本 创建build \ lib.win-amd64-3.7 复制line_profiler.py-> build \ lib.win-amd64-3.7 复制kernprof.py-> build \ lib.win-amd64-3.7 复制line_profiler_py35.py-> build \ lib.win-amd64-3.7 运行build_ext 跳过“ _line_profiler.c” Cython扩展名(最新) 建立'_line_profiler'扩展名 创建build \ temp.win-amd64-3.7 创建build \ temp.win-amd64-3.7 \ Release C:\ Program Files(x86)\ Microsoft Visual Studio \ 2017 \ BuildTools \ VC \ Tools \ MSVC \ 14.15.26726 \ bin \ HostX86 \ x64 \ cl.exe / c / nologo / Ox / W3 / GL / DNDEBUG / MD -IC:\ Users \ asmobari \ AppData \ Local \ Programs \ Python \ Python37 \ include -IC:\ Users \ asmobari \ AppData \ Local \ Programs \ Python \ Python37 \ include“ -IC:\ Program Files(x86)\ Microsoft视觉效果 Studio \ 2017 \ BuildTools \ VC \ Tools \ MSVC \ 14.15.26726 \ include“ “ -IC:\ Program Files(x86)\ Windows Kits \ 10 \ include \ 10.0.17134.0 \ ucrt” “ -IC:\ Program Files(x86)\ Windows Kits \ 10 \ include \ 10.0.17134.0 \ shared” “ -IC:\ Program Files(x86)\ Windows Kits \ 10 \ include \ 10.0.17134.0 \ um” “ -IC:\ Program Files(x86)\ Windows Kits \ 10 \ include \ 10.0.17134.0 \ winrt” “ -IC:\ Program Files(x86)\ Windows 套件\ 10 \ include \ 10.0.17134.0 \ cppwinrt“ /Tc_line_profiler.c /Fobuild\temp.win-amd64-3.7\Release_line_profiler.obj _line_profiler.c _line_profiler.c(7890):错误C2039:'exc_type':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7891):错误C2039:'exc_value':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7892):错误C2039:'exc_traceback':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7899):错误C2039:'exc_type':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7900):错误C2039:'exc_value':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7901):错误C2039:'exc_traceback':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7902):错误C2039:'exc_type':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7903):错误C2039:'exc_value':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7904):错误C2039:'exc_traceback':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7959):错误C2039:'exc_type':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7960):错误C2039:'exc_value':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7961):错误C2039:'exc_traceback':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7962):错误C2039:'exc_type':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7963):错误C2039:'exc_value':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明 _line_profiler.c(7964):错误C2039:'exc_traceback':不是'_ts'的成员 c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ include \ pystate.h(209): 注意:请参见“ _ts”的声明
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe'
退出状态2失败
---------------------------------------- Command "C:\Users\asmobari\AppData\Local\Programs\Python\Python37\python.exe
-u -c“导入设置工具,标记化; 文件 ='C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-install-2w13a4ux \ line-profiler \ setup.py' ; f = getattr(tokenize, '打开',打开)(文件);代码= f.read()。replace('\ r \ n', '\ n'); f.close(); exec(compile(code, file ,'exec')))“安装 --record C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-record-h8dq1h7x \ install-record.txt --single-version-externally-managed --compile“失败,错误代码为1 C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-install-2w13a4ux \ line-profiler \
我想知道是否有人可以帮我解决这个问题,或者是否有人知道从line_profiler导入LineProfiler和导入line_profiler导入line_profiler以外的其他方式