[Python] Building wheels for collected packages very slow and memory demanding. Can I skip it?

Discussão em 'Python' iniciado por Stack, Maio 9, 2025.

  1. Stack

    Stack Membro Participativo

    I have this setup.py file for my project and I am running Anaconda3 with Python3.7:

    from setuptools import setup, find_packages
    from setuptools.command.install import install as InstallCommand


    def parse_requirements(requirements):
    with open(requirements) as f:
    return [l.strip('\n') for l in f if l.strip('\n') and not l.startswith('#')]


    class Install(InstallCommand):
    """ Customized setuptools install command which uses pip. """

    def run(self, *args, **kwargs):
    from pip._internal import main as _main
    _main(['install', '.'])
    InstallCommand.run(self, *args, **kwargs)


    setup(
    name="NGF",
    author="Ties van Rozendaal",
    author_email="git@tivaro.nl",
    maintainer="Thomas Evangelidis",
    maintainer_email="tevang3@gmail.com",
    description="\n*** An implementation of Convolutional Networks on Graphs for Learning Molecular Fingerprints in Keras 2.x. ***\n",
    long_description="Read the README.md file.",
    url="https://github.com/iwatobipen/keras-neural-graph-fingerprint",
    license="MIT.",
    version="1.0",
    platforms="Unix",
    dependency_links=[],
    cmdclass={
    'install': Install,
    },
    packages=find_packages(where='.', exclude=()),
    # package_dir={'':'dev'},
    install_requires=parse_requirements('requirements.txt')
    )


    The contents of requirements.txt file are:

    pip==19.0.3
    tensorflow==1.13.1
    setuptools==40.8.0
    Keras==2.2.4
    numpy==1.16.2


    When I do:

    pip install <project dir>/


    Python builds some huge wheels which take ages to finish and eventually consume all the memory! I don't know what exactly it does, perhaps it builds wheels for tensorflow and Keras which as massive packages in C++ with Python wrappers. All I want is pip to check if the required modules are installed, and if not, to install them, and then copy the python files of my project to ~/Anaconda3/lib/python3.7/site-packages/. So simple! How can I do that?

    Continue reading...

Compartilhe esta Página