【问题标题】:PYTHON ujson. ERROR: Could not build wheels for ujson which use PEP 517 and cannot be installed directly蟒蛇ujson。错误:无法为使用 PEP 517 且无法直接安装的 ujson 构建轮子
【发布时间】:2020-05-03 11:45:14
【问题描述】:

我正在尝试使用 Poetry 在我的 Windows 笔记本电脑上安装 RASA 框架并从源代码构建。使用 pip 对我没有帮助,因为我永远无法安装 Tensorflow,它与 RASA 一起提供。

我已经做了什么:

$ curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python
$ git clone https://github.com/RasaHQ/rasa.git
$ cd rasa
$ poetry install

当安装到要安装 ujson 时,会发生这种情况并且安装停止:

Collecting ujson
  Using cached ujson-2.0.3.tar.gz (7.1 MB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
  Installing backend dependencies: started
  Installing backend dependencies: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Building wheels for collected packages: ujson
  Building wheel for ujson (PEP 517): started
  Building wheel for ujson (PEP 517): finished with status 'error'
  ERROR: Command errored out with exit status 1:
   command: 'c:\users\claudiu\appdata\local\programs\python\python38\python.exe' 'c:\users\claudiu\appdata\local\programs\python\python38\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\claudiu\AppData\Local\Temp\tmp3514zx41'
       cwd: C:\Users\claudiu\AppData\Local\Temp\pip-install-2qy6btub\ujson
  Complete output (16 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'ujson' extension
  creating build
  creating build\temp.win-amd64-3.8
  creating build\temp.win-amd64-3.8\Release
  creating build\temp.win-amd64-3.8\Release\deps
  creating build\temp.win-amd64-3.8\Release\deps\double-conversion
  creating build\temp.win-amd64-3.8\Release\deps\double-conversion\double-conversion
  creating build\temp.win-amd64-3.8\Release\lib
  creating build\temp.win-amd64-3.8\Release\python
  C:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\bin\HostX86\x64\cl.exe /c /nologo /Ox /W3 /GL /DNDEBUG /MD -I./python -I./lib -I./deps/double-conversion/double-conversion -Ic:\users\claudiu\appdata\local\programs\python\python38\include -Ic:\users\claudiu\appdata\local\programs\python\python38\include "-IC:\Program Files (x86)\Microsoft Visual Studio\2017\BuildTools\VC\Tools\MSVC\14.16.27023\include" /EHsc /Tp./deps/double-conversion/double-conversion\bignum-dtoa.cc /Fobuild\temp.win-amd64-3.8\Release\./deps/double-conversion/double-conversion\bignum-dtoa.obj -D_GNU_SOURCE
  bignum-dtoa.cc
  ./deps/double-conversion/double-conversion\bignum-dtoa.cc(28): fatal error C1083: Cannot open include file: 'math.h': No such file or directory
  error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\BuildTools\\VC\\Tools\\MSVC\\14.16.27023\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
  ----------------------------------------
  ERROR: Failed building wheel for ujson
Failed to build ujson
ERROR: Could not build wheels for ujson which use PEP 517 and cannot be installed directly

也许我可以简单地安装 Anaconda 并以这种方式完成它(tensorflow 以这种方式工作),但是我想要构建的项目需要能够在任何给定时间在 Anaconda 之外运行。

谁能帮帮我? 顺便说一句,我已经安装了最新的 Microsoft Visual C++ 和构建工具。

【问题讨论】:

    标签: python pip rasa pep


    【解决方案1】:

    窗口可能有两个问题

    1. 如果您在 32 位而不是 64 位的机器上安装时出现位问题,请使用此 https://rasa.com/docs/rasa/user-guide/installation/#step-by-step-installation-guide

    2. 这里讨论的ujson兼容性问题:https://github.com/ultrajson/ultrajson/issues/369

    https://www.lfd.uci.edu/~gohlke/pythonlibs/#ujson下载您的 whl 文件

    a)pip install ujson-1.35-cp37-cp37m-win_amd64.whl

    b)pip install rasa

    【讨论】:

    • 尝试这些步骤 rasa official 1) conda create --name installrasa python==3.7.6 2) activate installrasa 3) conda install ujson 4) conda install tensorflow 5) pip install rasa rasa init跨度>
    【解决方案2】:

    尝试卸载当前版本的ujson

    conda uninstall ujson
    

    并尝试安装 ujson - 1.35

    conda install ujson==1.35
    

    【讨论】:

      猜你喜欢
      • 2020-11-01
      • 2021-04-14
      • 2020-08-05
      • 2021-02-28
      • 2020-10-16
      • 1970-01-01
      • 1970-01-01
      • 2021-03-07
      • 2021-06-22
      相关资源
      最近更新 更多