得到错误,同时使用PIP安装(Getting error while using pip insta

2019-10-28 12:45发布

我试图安装聊天机器人使用PIP但得到以下错误。

在/private/var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/pip-build-8wG6yW/ruamel.yaml/命令“蟒蛇setup.py egg_info”失败,错误代码1

全部日志如下

➜  Documents pip install ./ChatterBot
Processing ./ChatterBot
Collecting chatterbot-corpus<1.1,>=1.0 (from ChatterBot==0.7.3)
  Using cached chatterbot_corpus-1.0.0-py2.py3-none-any.whl
Collecting jsondatabase<1.0.0,>=0.1.7 (from ChatterBot==0.7.3)
  Using cached jsondatabase-0.1.7-py2.py3-none-any.whl
Collecting nltk<4.0,>=3.2 (from ChatterBot==0.7.3)
  Using cached nltk-3.2.4.tar.gz
Collecting pymongo<4.0,>=3.3 (from ChatterBot==0.7.3)
  Using cached pymongo-3.4.0-cp27-cp27m-macosx_10_12_intel.whl
Collecting python-dateutil<2.7,>=2.6 (from ChatterBot==0.7.3)
  Using cached python_dateutil-2.6.1-py2.py3-none-any.whl
Collecting python-twitter<4.0,>=3.0 (from ChatterBot==0.7.3)
  Using cached python_twitter-3.3-py2-none-any.whl
Collecting sqlalchemy<1.2,>=1.1 (from ChatterBot==0.7.3)
  Using cached SQLAlchemy-1.1.11.tar.gz
Collecting ruamel.yaml<=0.15 (from chatterbot-corpus<1.1,>=1.0->ChatterBot==0.7.3)
  Using cached ruamel.yaml-0.15.0.tar.gz
    Complete output from command python setup.py egg_info:
    /var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/tmp_ruamel_H5mSkZ/test_ruamel_yaml.c:6:8: warning: explicitly assigning value of variable of type 'yaml_parser_t' (aka 'struct yaml_parser_s') to itself [-Wself-assign]
    parser = parser;  /* prevent warning */
    ~~~~~~ ^ ~~~~~~
    /var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/tmp_ruamel_H5mSkZ/test_ruamel_yaml.c:6:10: warning: variable 'parser' is uninitialized when used here [-Wuninitialized]
    parser = parser;  /* prevent warning */
             ^~~~~~
    /var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/tmp_ruamel_H5mSkZ/test_ruamel_yaml.c:5:1: note: variable 'parser' is declared here
    yaml_parser_t parser;
    ^
    2 warnings generated.
    /var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/tmp_ruamel_H5mSkZ/test_ruamel_yaml.c:6:8: warning: explicitly assigning value of variable of type 'yaml_parser_t' (aka 'struct yaml_parser_s') to itself [-Wself-assign]
    parser = parser;  /* prevent warning */
    ~~~~~~ ^ ~~~~~~
    /var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/tmp_ruamel_H5mSkZ/test_ruamel_yaml.c:6:10: warning: variable 'parser' is uninitialized when used here [-Wuninitialized]
    parser = parser;  /* prevent warning */
             ^~~~~~
    /var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/tmp_ruamel_H5mSkZ/test_ruamel_yaml.c:5:1: note: variable 'parser' is declared here
    yaml_parser_t parser;
    ^
    2 warnings generated.
    sys.argv ['-c', 'egg_info', '--egg-base', 'pip-egg-info']
    test compiling test_ruamel_yaml
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/private/var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/pip-build-8wG6yW/ruamel.yaml/setup.py", line 858, in <module>
        main()
      File "/private/var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/pip-build-8wG6yW/ruamel.yaml/setup.py", line 847, in main
        setup(**kw)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 111, in setup
        _setup_distribution = dist = klass(attrs)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 272, in __init__
        _Distribution.__init__(self,attrs)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 287, in __init__
        self.finalize_options()
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/setuptools/dist.py", line 326, in finalize_options
        ep.require(installer=self.fetch_build_egg)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2385, in require
        reqs = self.dist.requires(self.extras)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2617, in requires
        dm = self._dep_map
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 2606, in _dep_map
        if invalid_marker(marker):
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1424, in is_invalid_marker
        cls.evaluate_marker(text)
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1549, in _markerlib_evaluate
        env = cls._translate_metadata2(_markerlib.default_environment())
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1537, in _translate_metadata2
        for key, value in env
      File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources/__init__.py", line 1536, in <genexpr>
        (key.replace('.', '_'), value)
    ValueError: too many values to unpack

    ----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/nw/vxggqrcx463g3f3zxp71dc5r0000gn/T/pip-build-8wG6yW/ruamel.yaml/

我的点子安装已在最新的版本。 我甚至尝试重新安装它在其他网站上的建议,但不能让它工作呢。 任何帮助表示赞赏。

Answer 1:

安装setuptools的命令后工作。

pip install -U pip setuptools --user python 

我想这也较早,但没有--user python 。 就在那时失败,但用户追加后的工作。



文章来源: Getting error while using pip installation