1

这是我尝试卸载软件包时发生的情况:

(soothsayer_py3.8_env) jespinozlt2-osx:Prototype jespinoz$ pip uninstall soothsayer
Found existing installation: soothsayer 2020.5.1
Uninstalling soothsayer-2020.5.1:
  Would remove:
    /Users/jespinoz/anaconda3/envs/soothsayer_py3.8_env/bin/clairvoyance.py
    /Users/jespinoz/anaconda3/envs/soothsayer_py3.8_env/bin/run_soothsayer.py
    /Users/jespinoz/anaconda3/envs/soothsayer_py3.8_env/lib/python3.8/site-packages/
  Would not remove (might be manually added):
    /Users/jespinoz/anaconda3/envs/soothsayer_py3.8_env/lib/python3.8/site-packages/soothsayer-2020.5.1.dist-info/Icon

这是setup.py

import re, datetime
from setuptools import setup, find_packages

# Version
version = None
with open("./soothsayer/__init__.py", "r") as f:
    for line in f.readlines():
        line = line.strip()
        if line.startswith("__version__"):
            version = line.split("=")[-1].strip().strip('"')
assert version is not None, "Check version in soothsayer/__init__.py"

setup(name='soothsayer',
      version=version,
      description='High-level API for (bio-)informatics',
      url='https://github.com/jolespin/soothsayer',
      author='Josh L. Espinoza',
      author_email='jespinoz@jcvi.org',
      license='BSD-3',
      packages=find_packages(include=("*", "./*")),
      install_requires=[
    "matplotlib >= 2.2.2",
    "scipy >= 1.0",
    "scikit-learn >= 0.20.2",
    "numpy >= 1.13", #, < 1.14.0",
    'pandas >= 1.0',
    'networkx >= 2.0',
    'ete3 >= 3.0',
    'scikit-bio >= 0.5.1',
    "biopython >= 1.5",
    "xarray >= 0.10.3",
    "tqdm >=4.19",
    "openpyxl >= 2.5",
    # "astropy >= 3.0",
    "rpy2 >= 2.9.4, < 3.0",
    "matplotlib_venn",
    "palettable >= 3.0.0",
    "adjustText",
    "tzlocal",
    "statsmodels >= 0.10.0", #https://github.com/statsmodels/statsmodels/issues/5899 May need to use this separately: pip install git+https://github.com/statsmodels/statsmodels.git@maintenance/0.10.x
    "teneto",
    "mmh3",
    "soothsayer_utils >= 2020.4.30",

      ],
     include_package_data=True,
     scripts=['bin/clairvoyance.py', "bin/run_soothsayer.py"],


)

这是我的manifest.in

recursive-include soothsayer/io/data_type/ *.py
recursive-include soothsayer/feature_extraction/algorithms/ *.py
recursive-include soothsayer/r_wrappers/packages/ *.py
recursive-include soothsayer/tests/data/ *.py
recursive-include soothsayer/db/ *.pbz2
recursive-exclude releases/ *.tar.gz
global-exclude *.py[cod] __pycache__

这是我的pip版本:

pip 20.1 from /Users/jespinoz/anaconda3/envs/soothsayer_py3.8_env/lib/python3.8/site-packages/pip (python 3.8)

我好像想不通?有谁知道可能导致此问题的原因是什么?

4

1 回答 1

0

我假设导致问题的项目的PyPI页面和源代码存储库如下:

在源代码存储库的根目录中有一个名称包含异常字符的文件。它有时会显示为'Icon'$'\r'. 该文件似乎也存在于目录中 soothsayer 2020.5.4 的源代码分发soothsayer.egg-info中。因此,当pip安装该发行版时,它会以某种方式制作正在安装的文件的奇怪记录:

$ pip show --files soothsayer
Name: soothsayer
Version: 2020.5.4
Summary: High-level package for (bio-)informatics
Home-page: https://github.com/jolespin/soothsayer
Author: Josh L. Espinoza
Author-email: jespinoz@jcvi.org
License: BSD-3
Location: /tmp/tmp.YDoTgEDb9A/.venv/lib/python3.6/site-packages
Requires: networkx, teneto, palettable, matplotlib-venn, rpy2, xarray, ete3, biopython, tqdm, pandas, scikit-learn, scipy, numpy, scikit-bio, openpyxl, mmh3, matplotlib, statsmodels, adjustText, soothsayer-utils, tzlocal
Required-by: 
Files:
  "
  "soothsayer-2020.5.4.dist-info/Icon
  .
  ../../../bin/__pycache__/clairvoyance.cpython-36.pyc
  ../../../bin/__pycache__/run_soothsayer.cpython-36.pyc
  ../../../bin/clairvoyance.py
  ../../../bin/run_soothsayer.py
  soothsayer-2020.5.4.dist-info/INSTALLER
  soothsayer-2020.5.4.dist-info/Icon
  soothsayer-2020.5.4.dist-info/METADATA
  soothsayer-2020.5.4.dist-info/RECORD
  soothsayer-2020.5.4.dist-info/WHEEL
  soothsayer-2020.5.4.dist-info/top_level.txt
  soothsayer/__init__.py

在上面,注意第一个记录的 3 个Files。这些记录显然是错误的。特别是第 3 行可能会导致pip意图删除site-packages目录。

我建议那个预言家项目的所有者应该:

  • 弄清楚这些文件是如何创建的并禁用创建这些文件的软件
  • 清理所有分支中的源代码存储库,以防止在将来的版本中发生这种情况
  • 发布所有错误版本的维护或错误修复版本
  • 删除在PyPI和其他类似索引上发布的所有错误分布

更新

经过进一步检查,似乎Icon在源代码存储库的每个目录中都有一个类似的异常命名的文件,这些文件很可能也需要消失(除了该存储库中的许多其他不寻常的东西)。

于 2020-05-05T08:53:35.917 回答