社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

python,pip,为line profiler构建轮子失败[重复]

Deepak • 6 年前 • 2159 次点击  

这个问题已经有了答案:

我正在尝试为IPython安装行分析器。我在用蟒蛇。

当前版本的python是:

Python 3.6.2 |Anaconda, Inc.| (default, Sep 19 2017, 08:03:39) [MSC v.1900 64 bit (AMD64)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>>

当我尝试用pip安装行分析器时,这是我得到的错误输出。

注意:我和巨蟒一起奔跑蟒蛇。

C:\Users\dsandhu>pip install line_profiler
Collecting line_profiler
  Using cached https://files.pythonhosted.org/packages/14/fc/ecf4e238bb601ff829068e5a72cd1bd67b0ee0ae379db172eb6a0779c6b6/line_profiler-2.1.2.tar.gz
Requirement already satisfied: IPython>=0.13 in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from line_profiler) (6.1.0)
Requirement already satisfied: setuptools>=18.5 in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (36.5.0.post20170921)
Requirement already satisfied: jedi>=0.10 in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (0.10.2)
Requirement already satisfied: decorator in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (4.1.2)
Requirement already satisfied: pickleshare in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (0.7.4)
Requirement already satisfied: simplegeneric>0.8 in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (0.8.1)
Requirement already satisfied: traitlets>=4.2 in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (4.3.2)
Requirement already satisfied: prompt_toolkit<2.0.0,>=1.0.4 in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (1.0.15)
Requirement already satisfied: pygments in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (2.2.0)
Requirement already satisfied: colorama in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from IPython>=0.13->line_profiler) (0.3.9)
Requirement already satisfied: ipython_genutils in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from traitlets>=4.2->IPython>=0.13->line_profiler) (0.2.0)
Requirement already satisfied: six in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from traitlets>=4.2->IPython>=0.13->line_profiler) (1.10.0)
Requirement already satisfied: wcwidth in c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\lib\site-packages (from prompt_toolkit<2.0.0,>=1.0.4->IPython>=0.13->line_profiler) (0.1.7)
Building wheels for collected packages: line-profiler
  Running setup.py bdist_wheel for line-profiler ... error
  Complete output from command "c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\dsandhu\\AppData\\Local\\Temp\\pip-install-0llx4z1k\\line-profiler\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d C:\Users\dsandhu\AppData\Local\Temp\pip-wheel-63ockg8z --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  copying line_profiler.py -> build\lib.win-amd64-3.6
  copying kernprof.py -> build\lib.win-amd64-3.6
  copying line_profiler_py35.py -> build\lib.win-amd64-3.6
  running build_ext
  skipping '_line_profiler.c' Cython extension (up-to-date)
  building '_line_profiler' extension
  error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

  ----------------------------------------
  Failed building wheel for line-profiler
  Running setup.py clean for line-profiler
Failed to build line-profiler
Installing collected packages: line-profiler
  Running setup.py install for line-profiler ... error
    Complete output from command "c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\dsandhu\\AppData\\Local\\Temp\\pip-install-0llx4z1k\\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\dsandhu\AppData\Local\Temp\pip-record-za9vqo8p\install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    copying line_profiler.py -> build\lib.win-amd64-3.6
    copying kernprof.py -> build\lib.win-amd64-3.6
    copying line_profiler_py35.py -> build\lib.win-amd64-3.6
    running build_ext
    skipping '_line_profiler.c' Cython extension (up-to-date)
    building '_line_profiler' extension
    error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

    ----------------------------------------
Command ""c:\program files (x86)\microsoft visual studio\shared\anaconda3_64\python.exe" -u -c "import setuptools, tokenize;__file__='C:\\Users\\dsandhu\\AppData\\Local\\Temp\\pip-install-0llx4z1k\\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\dsandhu\AppData\Local\Temp\pip-record-za9vqo8p\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\dsandhu\AppData\Local\Temp\pip-install-0llx4z1k\line-profiler\
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/38075
 
2159 次点击  
文章 [ 2 ]  |  最新文章 6 年前
Corey Goldberg
Reply   •   1 楼
Corey Goldberg    6 年前

错误很明显:

error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools

我假设您没有安装微软VisualC++构建工具。

(工作链接为: https://visualstudio.microsoft.com/visual-cpp-build-tools/ )

eatmeimadanish
Reply   •   2 楼
eatmeimadanish    6 年前

您应该通过Conda存储库进行安装。

conda install -c anaconda line_profiler