The arguments and syntax of the various invocations of setup.py made by pip, are considered an implementation detail that is strongly coupled with setuptools. This build system interface is not meant to be used by any other build backend, which should be based on the pyproject. toml build system interface instead.
Pip will not flag dependency conflicts. As a result, it will happily install multiple versions of a dependency into your project, which will likely result in errors.
npm, Homebrew, Yarn, RequireJS, and Bower are the most popular alternatives and competitors to pip.
Installing Python Packages with Setup.py To install a package that includes a setup.py file, open a command or terminal window and: cd into the root directory where setup.py is located. Enter: python setup.py install.
Yes you can. You can install a package from a tarball or a folder, on the web or your computer. For example:
pip install https://pypi.python.org/packages/source/r/requests/requests-2.3.0.tar.gz
wget https://pypi.python.org/packages/source/r/requests/requests-2.3.0.tar.gz
pip install requests-2.3.0.tar.gz
tar -zxvf requests-2.3.0.tar.gz
cd requests-2.3.0
pip install .
You can delete the requests-2.3.0
folder.
pip install -e .
This installs the package in editable mode. Any changes you make to the code will immediately apply across the system. This is useful if you are the package developer and want to test changes. It also means you can't delete the folder without breaking the install.
You can pip install
a file perhaps by python setup.py sdist
first. You can also pip install -e .
which is like python setup.py develop
.
If you are really set on using python setup.py install
you could try something like this:
from setuptools import setup, find_packages
from setuptools.command.install import install as InstallCommand
class Install(InstallCommand):
""" Customized setuptools install command which uses pip. """
def run(self, *args, **kwargs):
import pip
pip.main(['install', '.'])
InstallCommand.run(self, *args, **kwargs)
setup(
name='your_project',
version='0.0.1a',
cmdclass={
'install': Install,
},
packages=find_packages(),
install_requires=['simplejson']
)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With