AnswerBun.com

Building a python egg, first letter is incorrectly removed from root file/folder name

Stack Overflow Asked by Tim496 on July 22, 2020

I’m trying to build an egg for my python project using setuptools, however, whenever I build an egg all of the contents are built with the first letter if each file/folder removed.

For example, my parent folder is called dp which gets renamed to p. I.e. when I unzip the egg file, I see a parent folder named p and another folder named GG-INFO (these should be named dp and EGG-INFO respectively). All of the other folders inside folder p are named correctly.

This is an issue because I reference functions in modules within that folder – e.g. from dp.module import function which doesn’t work because it complains about not finding the folder dp (which is true since for some reason it’s been renamed p).

My setup.py file looks like this:

from setuptools import setup, find_packages
setup(
    name="dp",
    version="1.0",
    author="XXXX",
    author_email="XXXX",
    description="Data pipeline for XXX algorithm.",
    long_description_content_type="text/markdown",
    url="XXXX",
    packages=find_packages(),
    package_data={'': ['*.sql', '*.json', '*.txt']},
    include_package_data=True,
    classifiers=[
        "Programming Language :: Python :: 3"
    ],
    python_requires='>=3.6',
    install_requires=['argparse', 'boto3', 'datetime', 'mmlspark', 'pandas', 'pyspark', 'pypandoc', 'scikit-learn',
                      'numpy', 'googleads', 'mlflow']
)

I’ve tried renaming the parent directory and the same thing happens. I’m running this via PyCharm (updated to the latest version) on Mac OS Mojave.

Would appreciate any ideas on how to fix this.

File Structure

Renamed folders

One Answer

Give the wheel a try.

pip install wheel setuptools pip -U
pip wheel --no-deps --wheel-dir=build .

Answered by Nathan Buckner on July 22, 2020

Add your own answers!

Related Questions

std::map::operator[] is more efficient than std::map::insert?

1  Asked on December 27, 2020 by eddieipeace

   

Splitting a list (?)

1  Asked on December 27, 2020 by superannuated

   

Python Scrapy how to save data in different files

1  Asked on December 27, 2020 by silver-flash

   

JS get random value from array and update array

2  Asked on December 27, 2020 by nicolas-schmit

     

Caught and declared exception in Java?

1  Asked on December 26, 2020 by hrvoje-t

   

IEnumerable and Recursion using yield return

8  Asked on December 26, 2020 by jamie-dixon

       

How to parse CSV with node.js?

2  Asked on December 26, 2020 by idarosa

         

Why this program with for loop give zero when y>5 and x=2

2  Asked on December 26, 2020 by vms

 

Null pointer exception. How my connection object is pointing to null

2  Asked on December 26, 2020 by monisha-ravi

     

How do I make contents in HTML by using css

0  Asked on December 26, 2020 by jaeseo-lee

   

How to show Toaster after logout

2  Asked on December 26, 2020

   

How to write to a csv within a pandas UDF in pyspark?

0  Asked on December 26, 2020 by codemaster2020

   

Ask a Question

Get help from others!

© 2022 AnswerBun.com. All rights reserved. Sites we Love: PCI Database, MenuIva, UKBizDB, Menu Kuliner, Sharing RPP, SolveDir