我卸载后出现以下错误,然后尝试重新安装我正在处理的pip包。
由于预先存在的构建目录, pip无法继续使用要求my-package
。
location: /private/var/folders/t0/45yvxfds0gsgyvd3147j2sk00000gp/T/pip_build_jonathan/my-package
。这可能是由于先前的安装失败了。
pip负责,而不是假设它可以删除它。
请删除它,然后重试。
但之前的安装并没有失败。因此,我想知道在安装软件包时是否必须执行某些操作来清理代码中的构建目录。在这种情况下你需要做什么?
更新
Downloading/unpacking my-package
Downloading my-package-0.16.tar.gz
Running setup.py (path:/private/var/folders/t0/45yvxfds0gsgyvd3147j2sk00000gp/T/pip_build_jonathan/my-package/setup.py) egg_info for package my-package
Requirement already satisfied (use --upgrade to upgrade): docopt in /usr/local/lib/python2.7/site-packages (from my-package)
Requirement already satisfied (use --upgrade to upgrade): requests in /usr/local/lib/python2.7/site-packages (from my-package)
我注意到,当您安装我的软件包时,它正在运行setup.py。而当您安装其他软件包时,它只表示已成功安装。没有提到setup.py。
import os
from setuptools import setup, find_packages
from pip.req import parse_requirements
CONFIG_PATH = '~/'
install_reqs = parse_requirements('requirements.txt')
reqs = [str(ir.req) for ir in install_reqs]
setup(name='my-package',
packages=['my-package'],
version='0.17',
description='description',
author='My name',
author_email='email@email.com',
keywords=['some keywodrd'],
url='',
scripts=['scriptfile'],
install_requires=reqs,
data_files=[(os.path.expanduser(CONFIG_PATH), ['.config.json'])]