pyjson5 rasperian安装

问题描述

我无法在Raspbian上成功执行以下命令

pip3 install pyjson5

我收到以下输出

pi@raspBerrypi:~ $ python3 -m pip install pyjson5
Defaulting to user installation because normal site-packages is not writeable
Looking in indexes: https://pypi.org/simple,https://www.piwheels.org/simple
Collecting pyjson5
  Using cached pyjson5-1.4.7.tar.gz (176 kB)
Building wheels for collected packages: pyjson5
  Building wheel for pyjson5 (setup.py) ... error
  ERROR: Command errored out with exit status 1:
   command: /usr/bin/python3 -u -c 'import sys,setuptools,tokenize; sys.argv[0] = '"'"'/tmp/pip-install-9wp1sfpy/pyjson5/setup.py'"'"'; __file__='"'"'/tmp/pip-install-9wp1sfpy/pyjson5/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 /tmp/pip-wheel-qtr5hr6e
       cwd: /tmp/pip-install-9wp1sfpy/pyjson5/
  Complete output (54 lines):
  running bdist_wheel
  running build
  running build_ext
  building 'pyjson5' extension
  creating build
  creating build/temp.linux-armv7l-3.7
  arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc -I/usr/include/python3.7m -c pyjson5.cpp -o build/temp.linux-armv7l-3.7/pyjson5.o -std=c++11 -O2 -fPIC -ggdb1 -pipe -fomit-frame-pointer -fstack-protector-strong
  In file included from pyjson5.cpp:606:
  src/native.hpp:65:27: error: expected unqualified-id before ‘__int128’
       static const unsigned __int128 is_escaped_array;
                             ^~~~~~~~
  src/native.hpp: In static member function ‘static bool JSON5EncoderCpp::EscapeDct::is_escaped(uint32_t)’:
  src/native.hpp:68:34: error: ‘is_escaped_array’ was not declared in this scope
           return (c >= 0x0080) || (is_escaped_array & (
                                    ^~~~~~~~~~~~~~~~
  src/native.hpp:68:34: note: suggested alternative: ‘is_escaped’
           return (c >= 0x0080) || (is_escaped_array & (
                                    ^~~~~~~~~~~~~~~~
                                    is_escaped
  src/native.hpp:69:34: error: expected ‘>’ before ‘__int128’
               static_cast<unsigned __int128>(1) <<
                                    ^~~~~~~~
  src/native.hpp:69:34: error: expected ‘(’ before ‘__int128’
               static_cast<unsigned __int128>(1) <<
                                    ^~~~~~~~
                                    (
  src/native.hpp:69:34: error: expected primary-expression before ‘__int128’
               static_cast<unsigned __int128>(1) <<
                                    ^~~~~~~~
  src/native.hpp:69:33: error: expected ‘)’ before ‘__int128’
               static_cast<unsigned __int128>(1) <<
                                   ^~~~~~~~~
                                   )
  src/native.hpp:69:33: error: expected ‘)’ before ‘__int128’
               static_cast<unsigned __int128>(1) <<
                                   ^~~~~~~~~
                                   )
  src/native.hpp:68:53: note: to match this ‘(’
           return (c >= 0x0080) || (is_escaped_array & (
                                                       ^
  src/native.hpp:71:11: error: expected ‘)’ before ‘;’ token
           ));
             ^
             )
  src/native.hpp:68:33: note: to match this ‘(’
           return (c >= 0x0080) || (is_escaped_array & (
                                   ^
  In file included from src/native.hpp:84,from pyjson5.cpp:606:
  src/./_escape_dct.hpp: At global scope:
  src/./_escape_dct.hpp:259:16: error: expected unqualified-id before ‘__int128’
   const unsigned __int128 EscapeDct::is_escaped_array = (
                  ^~~~~~~~
  error: command 'arm-linux-gnueabihf-gcc' Failed with exit status 1
  ----------------------------------------
  ERROR: Failed building wheel for pyjson5
  Running setup.py clean for pyjson5
Failed to build pyjson5
Installing collected packages: pyjson5
    Running setup.py install for pyjson5 ... error
    ERROR: Command errored out with exit status 1:
     command: /usr/bin/python3 -u -c 'import sys,'"'"'exec'"'"'))' install --record /tmp/pip-record-f9nerkcv/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.7m/pyjson5
         cwd: /tmp/pip-install-9wp1sfpy/pyjson5/
    Complete output (54 lines):
    running install
    running build
    running build_ext
    building 'pyjson5' extension
    creating build
    creating build/temp.linux-armv7l-3.7
    arm-linux-gnueabihf-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Isrc -I/usr/include/python3.7m -c pyjson5.cpp -o build/temp.linux-armv7l-3.7/pyjson5.o -std=c++11 -O2 -fPIC -ggdb1 -pipe -fomit-frame-pointer -fstack-protector-strong
    In file included from pyjson5.cpp:606:
    src/native.hpp:65:27: error: expected unqualified-id before ‘__int128’
         static const unsigned __int128 is_escaped_array;
                               ^~~~~~~~
    src/native.hpp: In static member function ‘static bool JSON5EncoderCpp::EscapeDct::is_escaped(uint32_t)’:
    src/native.hpp:68:34: error: ‘is_escaped_array’ was not declared in this scope
             return (c >= 0x0080) || (is_escaped_array & (
                                      ^~~~~~~~~~~~~~~~
    src/native.hpp:68:34: note: suggested alternative: ‘is_escaped’
             return (c >= 0x0080) || (is_escaped_array & (
                                      ^~~~~~~~~~~~~~~~
                                      is_escaped
    src/native.hpp:69:34: error: expected ‘>’ before ‘__int128’
                 static_cast<unsigned __int128>(1) <<
                                      ^~~~~~~~
    src/native.hpp:69:34: error: expected ‘(’ before ‘__int128’
                 static_cast<unsigned __int128>(1) <<
                                      ^~~~~~~~
                                      (
    src/native.hpp:69:34: error: expected primary-expression before ‘__int128’
                 static_cast<unsigned __int128>(1) <<
                                      ^~~~~~~~
    src/native.hpp:69:33: error: expected ‘)’ before ‘__int128’
                 static_cast<unsigned __int128>(1) <<
                                     ^~~~~~~~~
                                     )
    src/native.hpp:69:33: error: expected ‘)’ before ‘__int128’
                 static_cast<unsigned __int128>(1) <<
                                     ^~~~~~~~~
                                     )
    src/native.hpp:68:53: note: to match this ‘(’
             return (c >= 0x0080) || (is_escaped_array & (
                                                         ^
    src/native.hpp:71:11: error: expected ‘)’ before ‘;’ token
             ));
               ^
               )
    src/native.hpp:68:33: note: to match this ‘(’
             return (c >= 0x0080) || (is_escaped_array & (
                                     ^
    In file included from src/native.hpp:84,from pyjson5.cpp:606:
    src/./_escape_dct.hpp: At global scope:
    src/./_escape_dct.hpp:259:16: error: expected unqualified-id before ‘__int128’
     const unsigned __int128 EscapeDct::is_escaped_array = (
                    ^~~~~~~~
    error: command 'arm-linux-gnueabihf-gcc' Failed with exit status 1
    ----------------------------------------
ERROR: Command errored out with exit status 1: /usr/bin/python3 -u -c 'import sys,'"'"'exec'"'"'))' install --record /tmp/pip-record-f9nerkcv/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/pi/.local/include/python3.7m/pyjson5 Check the logs for full command output.

我正在使用以下设置:

pi@raspBerrypi:~ $ uname -a
Linux raspBerrypi 5.4.51-v7+ #1333 SMP Mon Aug 10 16:45:19 BST 2020 armv7l GNU/Linux
pi@raspBerrypi:~ $ python3 -m pip --version
pip 20.2.3 from /usr/local/lib/python3.7/dist-packages/pip (python 3.7)

是否可以在Raspberian上安装pyjson5软件包? 可能仅仅是编译标志的问题吗?还是更复杂? 预先感谢您的提示和建议。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)