[英]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.