我试图在python中进行行配置文件和内存配置文件。我在运行代码时从line_profiler导入LineProfiler导入了line_profiler,我收到错误消息: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 0)要求已经满足:c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages中的pickleshare(来自IPython> = 0.13-> line_profiler)(0.7.5)要求已经满足:jedi > = 0.10在c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages(来自IPython> = 0.13-> line_profiler)(0.13.1)要求已经满足:c:中的pygments users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages(来自IPython> = 0.13-> line_profiler)(2.2.0)要求已满足:colorama; c:\ users \ asmobari \ appdata \ local \ programs \ python \ python37 \ lib \ site-packages中的sys_platform ==“win32”(来自IPython> = 0.13-> line_profiler)(0.4.0)要求已经满足:提示 - 工具包<2.1.0,> = 2.0.0 in c:file ='C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-install-2w13a4ux \ line-profiler \ setup.py'; f = getattr(tokenize,'open',open)(file); code = f .read()。replace('\ r \ n','\ n'); f.close(); exec(编译(代码,文件),'exec'))“install --record C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-record-h8dq1h7x \ install-record.txt --single-version-external-managed --compile:running install运行构建运行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 Visual 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套件\ 10 \ include \ 10.0.17134.0 \ winrt“” - IC:\ Program Files(x86)\ Windows Kits \ 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'的声明_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'的声明_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'的声明看'_ts'的声明看'_ts'的声明
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.15.26726\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
命令“C:\ Users \ asmobari \ AppData \ Local \ Programs \ Python \ Python37 \ python.exe -u -c”import setuptools,tokenize; file ='C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-install-2w13a4ux \ line-profiler \ setup.py'; f = getattr(tokenize,'open',open)(file); code = f .read()。replace('\ r \ n','\ n'); f.close(); exec(compile(code,file,'exec'))“install --record C:\ Users \ asmobari \ AppData \ Local \ Temp \ pip-record-h8dq1h7x \ install-record.txt --single-version-external-managed --compile“在C:\ Users \ asmobari \ AppData \ Local \ Temp \中失败,错误代码为1 PIP-安装-2w13a4ux \线廓\
我想知道是否有人能够解决这个问题,或者是否有人知道除了line_profiler之外的其他方式导入LineProfiler并导入line_profiler以导入line_profiler
发布于 2018-10-30 16:28:10
您可以从此处安装预构建的二进制文件
https://stackoverflow.com/questions/-100006189
复制相似问题