How do I set up Setuptools for Python 2.6 on Windows?

First Option – Online Installation (i.e. remaining connected to the Internet during the entire installation process): Download setuptools-0.6c9.tar.gz Use 7-zip to extract it to a folder(directory) outside your Windows Python installation folder Go the folder (refer step 2) and run ez_setup.py from the corresponding dos (command) prompt Ensure that your PATH includes the appropriate C:\Python2X\Scripts … Read more

Python packages and egg-info directories

The .egg-info directories get only created if –single-version-externally-managed was used to install the egg. “Normally”, installing an egg would create a single directory (or zip file), containing both the code and the metadata. pkg_resources (which is the library that reads the metadata) has a function require which can be used to request a specific version … Read more

Setuptools “development” Requirements

For more info on using setup.py vs requirements.txt, I found this article helpful. Update: September 2016 I no longer use requirements.txt (see original answer below) for installing development only packages. The prevailing wisdom seems to be that requirements.txt should be used to pin deployments to specific version numbers, typically using pip freeze > requirements.txt. This … Read more

What is the difference between `extras_require()` and `install_requires()` in setup.py?

According to the setuptools documentation, extras_require A dictionary mapping names of “extras” (optional features of your project) to strings or lists of strings specifying what other distributions must be installed to support those features. and install_requires A string or list of strings specifying what other distributions need to be installed when this one is. The … Read more

What’s the difference between setup.py and setup.cfg in python projects

Traditionally, setup.py has been used to build a Python package, i.e., python setup.py build Like any old Python file, setup.py can contain lots of code. In most cases, however, it is purely declarative and simply lists package properties, e.g., from setuptools import setup setup( name=”foobar”, version=”0.1.0″, author=”John Doe”, # … ) In fact, some consider … Read more

pip install . creates only the dist-info not the package

Since the question has become quite popular, here are the diagnosis steps to go through when you’re missing files after installation. Imagine having an example project with the following structure: root ├── spam │ ├── __init__.py │ ├── data.txt │ ├── eggs.py │ └── fizz │ ├── __init__.py │ └── buzz.py ├── bacon.py └── setup.py … Read more

What is the official “preferred” way to install pip and virtualenv systemwide?

If you can install the latest Python (2.7.9 and up) Pip is now bundled with it. See: https://docs.python.org/2.7//installing/index.html If not : Update (from the release notes): Beginning with v1.5.1, pip does not require setuptools prior to running get-pip.py. Additionally, if setuptools (or distribute) is not already installed, get-pip.py will install setuptools for you. I now … Read more

How include static files to setuptools – python package

As pointed out in the comments, there are 2 ways to add the static files: 1 – include_package_data=True + MANIFEST.in A MANIFEST.in file in the same directory of setup.py that looks like this: include src/static/* include src/Potato/*.txt With include_package_data = True in setup.py. 2 – package_data in setup.py package_data = { ‘static’: [‘*’], ‘Potato’: [‘*.txt’] … Read more

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