Windows Python 3.5 中的 jasondb

jasondb in Windows Python 3.5

提问人:Hack-R 提问时间:1/4/2016 最后编辑:Hack-R 更新时间:1/7/2016 访问量:210

问:

我开始尝试使用 Python 10 在 Windows 3.5 上从 Github 安装,但它抛出了一个未满足的依赖项错误。ChatterBot-masterjsondb

尝试后:pip

PS C:\Users\hackr> pip install jasondb
Collecting jasondb
  Could not find a version that satisfies the requirement jasondb (from versions: )
No matching distribution found for jasondb
PS C:\Users\hackr> pip3 install jasondb
Collecting jasondb
  Could not find a version that satisfies the requirement jasondb (from versions: )
No matching distribution found for jasondb

所以我按照 python.org 上的说明安装了 jsondb0.1.2。不幸的是,它返回了一些错误:

C:\Users\hackr\Downloads\jsondb-0.1.2>python setup.py install
C:\python35\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'zip_s
  warnings.warn(msg)
C:\python35\lib\distutils\dist.py:261: UserWarning: Unknown distribution option: 'insta
  warnings.warn(msg)
running install
running build
running build_py
running install_lib
byte-compiling C:\python35\Lib\site-packages\jsondb\backends\sqlite3_backend.py to sqli
  File "C:\python35\Lib\site-packages\jsondb\backends\sqlite3_backend.py", line 214
    def insert_root(self, (root_type, value)):
                          ^
SyntaxError: invalid syntax

byte-compiling C:\python35\Lib\site-packages\jsondb\core.py to core.cpython-35.pyc
  File "C:\python35\Lib\site-packages\jsondb\core.py", line 197
    print parent_id, parent_type
                  ^
SyntaxError: Missing parentheses in call to 'print'

byte-compiling C:\python35\Lib\site-packages\jsondb\pyPEG.py to pyPEG.cpython-35.pyc
  File "C:\python35\Lib\site-packages\jsondb\pyPEG.py", line 39
    word_regex = re.compile(ur"\w+")
                                  ^
SyntaxError: invalid syntax

byte-compiling C:\python35\Lib\site-packages\jsondb\__init__.py to __init__.cpython-35.
  File "C:\python35\Lib\site-packages\jsondb\__init__.py", line 40
    print row
            ^
SyntaxError: Missing parentheses in call to 'print'

running install_egg_info
Removing C:\python35\Lib\site-packages\jsondb-0.1.2-py3.5.egg-info
Writing C:\python35\Lib\site-packages\jsondb-0.1.2-py3.5.egg-info

我继续尝试再次安装,但它返回的错误似乎与安装中的警告/错误有关:ChatterBot-masterjasondb

C:\Users\hackr\Downloads\ChatterBot-master>python setup.py install
Traceback (most recent call last):
  File "setup.py", line 13, in <module>
    version = __import__('chatterbot').__version__
  File "C:\Users\hackr\Downloads\ChatterBot-master\chatterbot\__init__.py", line 1, in <module>
    from .chatterbot import ChatBot
  File "C:\Users\hackr\Downloads\ChatterBot-master\chatterbot\chatterbot.py", line 1, in <module>
    from .adapters import Adaptation
  File "C:\Users\hackr\Downloads\ChatterBot-master\chatterbot\adapters\__init__.py", line 2, in <module>
    from .adaptation import Adaptation
  File "C:\Users\hackr\Downloads\ChatterBot-master\chatterbot\adapters\adaptation.py", line 2, in <module>
    from chatterbot.adapters.storage import StorageAdapter
  File "C:\Users\hackr\Downloads\ChatterBot-master\chatterbot\adapters\storage\__init__.py", line 2, in <module>
    from .jsondatabase import JsonDatabaseAdapter
  File "C:\Users\hackr\Downloads\ChatterBot-master\chatterbot\adapters\storage\jsondatabase.py", line 4, in <module>
    from jsondb import Database
  File "C:\python35\lib\site-packages\jsondb\__init__.py", line 40
    print row
            ^
SyntaxError: Missing parentheses in call to 'print'
蟒蛇 jsondb

评论

0赞 Iron Fist 1/4/2016
您安装的是用于 Python2 的,我猜您正在使用 Python3?jsondb

答:

1赞 Iron Fist 1/4/2016 #1

您安装的 jsondb.0.1.2 适用于 Python2。相反,请安装版本 0.1.1。