简体   繁体   English

PIP安装lpod失败,错误1和无效的语法

[英]PIP Install lpod fails Error 1 and Invalid Syntax

I have Debian/Cinnamon and I'm trying to install the python lpod-python package so I can open LibreOffice files from Python 3.4. 我有Debian / Cinnamon,我正尝试安装python lpod-python软件包,以便可以从Python 3.4打开LibreOffice文件。 Python 2.7 and Idle 3 are also installed. 还安装了Python 2.7和Idle 3。

When I try 当我尝试

pip3 install lpod-python

it fails. 它失败。 I've read all the other answers to pip install with error code 1 and I'm sure pip and setuptools are correctly installed and up to date, so something else is wrong. 我已经阅读了pip install的所有其他答案,错误代码为1,并且我确定pip和setuptools已正确安装并且是最新的,所以还有其他问题。

ed@eddebian:~$ pip3 install lpod-python
Downloading/unpacking lpod-python
  Downloading lpod-python-1.1.6.tar.gz (1.6MB): 1.6MB downloaded
  Running setup.py (path:/tmp/pip-build-r0wgfnfi/lpod-python/setup.py) egg_info for package lpod-python
    Traceback (most recent call last):
      File "<string>", line 17, in <module>
      File "/tmp/pip-build-r0wgfnfi/lpod-python/setup.py", line 35, in <module>
        from release import has_git, get_release
      File "/tmp/pip-build-r0wgfnfi/lpod-python/release.py", line 92
        print get_release()
                        ^
    SyntaxError: invalid syntax
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):

  File "<string>", line 17, in <module>

  File "/tmp/pip-build-r0wgfnfi/lpod-python/setup.py", line 35, in <module>

    from release import has_git, get_release

  File "/tmp/pip-build-r0wgfnfi/lpod-python/release.py", line 92

    print get_release()

                    ^

SyntaxError: invalid syntax

----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip-build-r0wgfnfi/lpod-python

I next tried cloning lpod from git and ran setup.py from the command line. 接下来,我尝试从git克隆lpod并从命令行运行setup.py。 I get the same syntax error but not the error code 1. 我收到相同的语法错误,但没有错误代码1。

I presently have a work-around by converting the .odt files to text but it would boost my productivity considerably if I could read them straight into python. 我目前有一种解决方法,可以将.odt文件转换为文本,但是如果我可以将它们直接读入python,它将大大提高我的生产率。 Any help would be greatly appreciated. 任何帮助将不胜感激。

That code would only work on Python 2; 该代码仅适用于Python 2; that library is clearly not compatible with Python 3. 该库显然与Python 3不兼容。

Does your project use Python 3 or Python 2.6? 您的项目使用的是Python 3还是Python 2.6? If it uses Python 2.6, just do a 如果使用Python 2.6,只需执行

    pip install lpod-python

If it uses Python 3, you cannot use this library as it is not compatible with Python 3, which you can see by the 如果它使用Python 3,则不能使用该库,因为它与Python 3不兼容,您可以通过

    print get_release()

being shown as syntax error, since print() is the correct syntax for Python3. 显示为语法错误,因为print()是Python3的正确语法。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM