问题在Django项目中安装misaka

时间:2018-06-05 13:44:35

标签: python django misaka

我需要安装misaka,但是当我使用pip install misaka时,我收到的错误是:

  

命令“python setup.py egg_info”失败,错误代码1在C:\ Users \ JHONAT~1 \ AppData \ Local \ Temp \ pip-build-utm0mant \ misaka \

我真的不知道如何解决它。我尝试过使用pip3,没有改变,也使用pip2。我目前正在使用python 3.6.4和Django 1.11。

     Collecting misaka
  Using cached https://files.pythonhosted.org/packages/47/c2/ba9c82ae0ec62bcec62d690e715be6ead4457f83000f4ef6e919f77a8e5f/misaka-2.1.0.tar.gz
Collecting cffi>=1.0.0 (from misaka)
  Cache entry deserialization failed, entry ignored
  Downloading https://files.pythonhosted.org/packages/2f/85/a9184548ad4261916d08a50d9e272bf6f93c54f3735878fbfc9335efd94b/cffi-1.11.5-cp36-cp36m-win_amd64.whl (166kB)
    100% |████████████████████████████████| 174kB 17kB/s
Collecting pycparser (from cffi>=1.0.0->misaka)
Building wheels for collected packages: misaka
  Running setup.py bdist_wheel for misaka ... error
  Complete output from command g:\programming\anaconda3\envs\virtual\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JHONAT~1\\AppData\\Local\\Temp\\pip-b
uild-9fgtbhdd\\misaka\\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:\U
sers\JHONAT~1\AppData\Local\Temp\tmptz2d209jpip-wheel- --python-tag cp36:
  running bdist_wheel
  running build
  running build_py
  creating build
  creating build\lib.win-amd64-3.6
  creating build\lib.win-amd64-3.6\misaka
  copying misaka\api.py -> build\lib.win-amd64-3.6\misaka
  copying misaka\callbacks.py -> build\lib.win-amd64-3.6\misaka
  copying misaka\constants.py -> build\lib.win-amd64-3.6\misaka
  copying misaka\utils.py -> build\lib.win-amd64-3.6\misaka
  copying misaka\__init__.py -> build\lib.win-amd64-3.6\misaka
  running build_ext
  generating cffi module 'build\\temp.win-amd64-3.6\\Release\\misaka._hoedown.c'
  creating build\temp.win-amd64-3.6
  creating build\temp.win-amd64-3.6\Release
  building 'misaka._hoedown' 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 misaka
  Running setup.py clean for misaka
Failed to build misaka
Installing collected packages: pycparser, cffi, misaka
  Running setup.py install for misaka ... error
    Complete output from command g:\programming\anaconda3\envs\virtual\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JHONAT~1\\AppData\\Local\\Temp\\pip
-build-9fgtbhdd\\misaka\\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\JHONAT~1\AppData\Local\Temp\pip-crdk5uw4-record\install-record.txt --single-version-externally-managed --compile --install-headers g:\programming\anaconda3\envs\virtual\inc
lude\site\python3.6\misaka:
    running install
    running build
    running build_py
    creating build
    creating build\lib.win-amd64-3.6
    creating build\lib.win-amd64-3.6\misaka
    copying misaka\api.py -> build\lib.win-amd64-3.6\misaka
    copying misaka\callbacks.py -> build\lib.win-amd64-3.6\misaka
    copying misaka\constants.py -> build\lib.win-amd64-3.6\misaka
    copying misaka\utils.py -> build\lib.win-amd64-3.6\misaka
    copying misaka\__init__.py -> build\lib.win-amd64-3.6\misaka
    running build_ext
    generating cffi module 'build\\temp.win-amd64-3.6\\Release\\misaka._hoedown.c'
    creating build\temp.win-amd64-3.6
    creating build\temp.win-amd64-3.6\Release
    building 'misaka._hoedown' 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 "g:\programming\anaconda3\envs\virtual\scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\JHONAT~1\\AppData\\Local\\Temp\\pip-build-9fgtbhdd\\misaka\
\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\JHONAT~1\AppDat
a\Local\Temp\pip-crdk5uw4-record\install-record.txt --single-version-externally-managed --compile --install-headers g:\programming\anaconda3\envs\virtual\include\site\python3.6\misa
ka" failed with error code 1 in C:\Users\JHONAT~1\AppData\Local\Temp\pip-build-9fgtbhdd\misaka\

我的互联网连接不是最快的,现在我正在下载VS2015以查看它是否解决了我的问题,因为日志提供的链接不再起作用。感谢回复,我将在下载完成时更新

5 个答案:

答案 0 :(得分:0)

来自包documentation

  

如果您从源代码安装并使用Debian或Debian   派生(例如Ubuntu)确保build-essential,python-dev和   安装了libffi-dev。

sudo apt-get install python-setuptools python-dev build-essential

编辑

视窗:

您的错误明确指出您需要安装Microsoft Visual C ++ 14.0

  

错误:需要Microsoft Visual C ++ 14.0。用“微软”来获取它   Visual C ++构建工具“:   http://landinghub.visualstudio.com/visual-cpp-build-tools

答案 1 :(得分:0)

有效的解决方案!

转到https://visualstudio.microsoft.com/downloads/ 向下滚动一页并下载Visual Studio 2017社区。

通过以下链接下载Microsoft Visual C ++ 14.0所需的组件,该链接提供了下载时要选择的组件。

https://developercommunity.visualstudio.com/content/problem/409173/error-microsoft-visual-c-140-is-required.html

希望它对我有用!

答案 2 :(得分:0)

执行此操作:

  1. git clone https://github.com/FSX/misaka.git

2.cd misaka

3.python setup.py安装

答案 3 :(得分:0)

am采取这种方式 1-安装conda 与康达 安装: 康达安装libpython m2w64-toolchain -c msys2

2-通过以下方式升级您的pip:python -m pip install --upgrade pip

3-instal misaka:pip安装misaka

答案 4 :(得分:0)

我为Windows找到的唯一可行的解​​决方案,

按照错误中的说明转到Visual Studio download page,下载最新版本的安装程序,运行安装程序,

如果您已经安装了Visual Studio,则单击“修改”, 请确保选择所需的软件包,尤其是image中的“ windows 10 sdk”软件包(首次安装时需要1.2gb的下载空间和4.2gb的磁盘空间)。

然后运行pip install misaka,以成功构建软件包。

如果系统中安装了Anaconda发行版,则可以尝试运行

conda install libpython m2w64-toolchain -c msys2

就像其他答案中所建议的那样,但是它不适用于所有Windows-python版本组合。任何时候,构建软件包都需要视觉c ++。