Combine –user with –prefix error with setup.py install

One time workaround: pip install –user –install-option=”–prefix=” <package_name> or python setup.py install –user –prefix= Note that there is no text (not even whitespace) after the =. Do not forget the –user flag. Installing multiple packages: Create ~/.pydistutils.cfg (or equivalent for your OS/platform) with the following contents: [install] prefix= Note that there is no text (not … Read more

pypi UserWarning: Unknown distribution option: ‘install_requires’

python setup.py uses distutils which doesn’t support install_requires. setuptools does, also distribute (its successor), and pip (which uses either) do. But you actually have to use them. I.e. call setuptools through the easy_install command or pip install. Another way is to import setup from setuptools in your setup.py, but this not standard and makes everybody … Read more

How can I make setuptools install a package that’s not on PyPI?

The key is to tell easy_install where the package can be downloaded. In this particular case, it can be found at the url http://github.com/mtai/python-gearman/tarball/master. However, that link by itself won’t work, because easy_install can’t tell just by looking at the URL what it’s going to get. By changing it to http://github.com/mtai/python-gearman/tarball/master#egg=gearman-2.0.0beta instead, easy_install will be … Read more

setuptools vs. distutils: why is distutils still a thing?

Have a look at this SO question. It explains all the packaging methods very well, and might help answer your question to some extent: Differences between distribute, distutils, setuptools and distutils2? Distutils is still the standard tool for packaging in Python. It is included in the standard library (Python 2 and Python 3.0 to 3.3). … Read more

Including non-Python files with setup.py

Probably the best way to do this is to use the setuptools package_data directive. This does mean using setuptools (or distribute) instead of distutils, but this is a very seamless “upgrade”. Here’s a full (but untested) example: from setuptools import setup, find_packages setup( name=”your_project_name”, version=’0.1′, description=’A description.’, packages=find_packages(exclude=[‘ez_setup’, ‘tests’, ‘tests.*’]), package_data={”: [‘license.txt’]}, include_package_data=True, install_requires=[], ) … Read more

Differences between distribute, distutils, setuptools and distutils2?

As of May 2022, most of the other answers to this question are several years out-of-date. When you come across advice on Python packaging issues, remember to look at the date of publication, and don’t trust out-of-date information. The Python Packaging User Guide is worth a read. Every page has a “last updated” date displayed, … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)