I want to install my project as a folder instead of .egg file. So I have used zip_safe= False inside setup function in setup.py file
But when I am running this my project is getting installed as .egg file instead of a directory inside /Library/Python/2.7/site-packages. Below is my setup.py file
from setuptools import setup, find_packages
setup(name = "my-project",
version = "0.1",
description = "Python version of my-project",
author = "Priyal Jain",
author_email = "jpriyal@gmail.com",
license="Apache 2.0",
keywords="Python my project",
package_dir={'': 'lib'},
#packages=find_packages('lib'),
packages= ['abc','pqr'],
package_data={
'abc.sample': ['*.yml']
},
zip_safe= False,
scripts = ["abc"],
classifiers=[
'Environment :: Console',
'Intended Audience :: Developers',
'Intended Audience :: Information Technology',
'Intended Audience :: System Administrators',
'Intended Audience :: Telecommunications Industry',
'Operating System :: OS Independent',
'Programming Language :: Python',
],
)
Am I missing anything?? Is there some other way to install python project as a directory instead of .egg files
The zip_safe flag controls whether the package can be safely installed as a zipped archive. By setting it to False, you're telling setuptools to not install your package as a .egg file.
However, you also need to specify the installation directory of your package. You can do this by setting the --install-lib option when running the pip install command.
For example:
pip install --install-lib=/path/to/installation/dir my-project
This tells pip to install your package in the specified directory instead of the default site-packages folder.
Another way to install your project as a directory instead of .egg is by using --editable flag.
pip install --editable .
This will install your package as a directory and any changes made to the source code will be reflected in the installed package.
You can also use pip install -e or pip install --user -e for installing in the user directory.
Make sure you are using the correct version of pip to install your package and the correct version of python for your package.