Getting error No module named 'pip._internal.download' and ModuleNotFoundError: No module named 'pip.download'

BTW, the Github account mentioned in that config is 404ing for me. Not just the repository, the entire account.

But yes, the simplest fix at this point is probably to just get rid of everything related to Pip, and also the redundant from distutils.core import setup - this is replacing the setuptools import (you don’t want that to happen) even if importing setuptools succeeds (which it certainly should). In fact, if we’re requiring a modern version of Setuptools then there is no point in trying to use distutils.core as a fallback; it will and should fail anyway.

I also fixed it to use a with block for the version info file, as well as the requirements.txt file; made the handling of the README file work the same way; and fixed indentation to use spaces consistently.

from setuptools import setup
from os import path

with open('requirements.txt') as reqh:
    install_reqs = reqh.readlines()

with open(path.join(path.dirname(__file__), 'VERSION')) as v:
    VERSION = v.readline().strip()

with open('README.md') as f:
    long_description = f.read()

setup(
    name='mailer',
    version=VERSION,
    author='Vita Chaos',
    author_email='vitachaos@gmail.com',
    packages=['emaildiff', 'emaildiff/mail',],
    data_files=['VERSION'],
    scripts=['scripts/git-maildiff'],
    url='https://github.com/vitachaos/mailer',
    license='BSD',
    description='Package to email color git diff',
    long_description=long_description,
    long_description_content_type='text/markdown',
    setup_requires=["setuptools>=58.0.4"],
    install_requires=install_reqs,
    entry_points={
        'console_scripts': ['mailer=emaildiff.mailer_cmd:main']
    },
    classifiers=[
        'Development Status :: 5 - Production/Stable',
        'Environment :: Console',
        'Intended Audience :: Developers',
        'Intended Audience :: System Administrators',
        'License :: OSI Approved :: BSD License',
        'Operating System :: Unix',
        'Programming Language :: Python',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.7',
        'Topic :: Software Development',
        'Topic :: Software Development :: Version Control',
        'Topic :: Utilities',
    ],
    platforms=['Unix', 'Darwin', 'Windows']
)

If there’s still a problem then we’ll need to look at the requirements.txt next.

(You’ll probably also want to try to test the code with various minor versions of Python 3, and update the related trove classifiers.)

2 Likes