I have a project such as:
myproject
setup.py
-myproject
-package1
-package2
I am using a setup.py as:
NAME='myproject'
setup(
name=NAME,
version=VERSION,
description=DESCRIPTION,
long_description=long_description,
long_description_content_type='text/markdown',
author=AUTHOR,
author_email=EMAIL,
python_requires=REQUIRES_PYTHON,
url=URL,
packages=find_packages(exclude=('tests',)),
package_data={NAME: ['VERSION']},
install_requires=require(),
extras_require={},
include_package_data=True)
When I install (pip install -e .
) this I can access the packages as import myproject.package1
. However, I want to change this so I instead import it as import mynewname.package1
. In the example above when changing NAME=mynewname
and then installing, the packages become no longer visible, and import mynewname
gives a ModuleNotFoundError
.
I don't want to change the name of the project or structure, just the top level name under which the package is installed. Something like import mynewname.myproject.package1
would also work, but i'm unsure of how to do this.
Thanks