繁体   English   中英

Python:pip找不到setup.py

[英]Python: pip can't find setup.py

如何指示pip找到setup.py 我的setup.py文件位于~/setuptools-3.5.1

我跑了

dustin@dustin:~$ python setuptools-3.5.1/setup.py egg_info
running egg_info
writing requirements to setuptools.egg-info/requires.txt
writing setuptools.egg-info/PKG-INFO
writing top-level names to setuptools.egg-info/top_level.txt
writing dependency_links to setuptools.egg-info/dependency_links.txt
writing entry points to setuptools.egg-info/entry_points.txt
reading manifest file 'setuptools.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'setuptools.egg-info/SOURCES.txt'
dustin@dustin:~$ 

所以它看起来一切都很好,但是当我运行pip时,我得到了

Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/dustin/.pip/pip.log

我的印象是,当我运行pip时,它找不到setup.py

导航到包含setup.py的目录并运行:

pip install -e .

matplotlib有许多外部依赖项。 其中一些是必需的。 您可以在尝试的pip install生成的日志文件中看到所需的列表。 在你的情况下,它是这样的:

REQUIRED DEPENDENCIES AND EXTENSIONS
                 numpy: yes [version 1.8.1]
              dateutil: yes [dateutil was not found. It is required for date
                        axis support. pip/easy_install may attempt to
                        install it after matplotlib.]
               tornado: yes [using tornado version 3.2.1]
             pyparsing: yes [pyparsing was not found. It is required for
                        mathtext support. pip/easy_install may attempt to
                        install it after matplotlib.]
                 pycxx: yes [Couldn't import.  Using local copy.]
                libagg: yes [pkg-config information for 'libagg' could not
                        be found. Using local copy.]
              freetype: no  [pkg-config information for 'freetype2' could
                        not be found.]
                   png: yes [pkg-config information for 'libpng' could not
                        be found. Using unknown version.]

============================================================================
                        * The following required packages can not be built:
                        * freetype
Complete output from command python setup.py egg_info:
============================================================================

在这里,您可以看到无法找到freetype 您需要在系统上安装它。

有同样的问题。 这可能是因为可能未安装某些依赖项。 通过在ubuntu中使用包管理器安装解决了这个问题。 使用以下命令

sudo apt-get install python-matplotlib

希望这可以帮助。

导航到包含setup.py的目录并运行:

pip install -e。

这对我有用。 但是当我在anaconda环境终端使用“pip install -e”。[all]'“时,我仍然没有找到按钮setup.py。 相反,我使用“pip安装健身房[全部]”,它的工作!

暂无
暂无

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

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