When to use pip requirements file versus install_requires in setup.py?

My philosophy is that install_requires should indicate a minimum of what you need. It might include version requirements if you know that some versions will not work; but it shouldn’t have version requirements where you aren’t sure (e.g., you aren’t sure if a future release of a dependency will break your library or not). Requirements … Read more

Installing SetupTools on 64-bit Windows

Problem: you have 64-bit Python, and a 32-bit installer. This will cause problems for extension modules. The reasons why the installer doesn’t finds Python is the transparent 32-bit emulation from Windows 7. 64-bit and 32-bit programs will write to different parts of the Windows registry. 64-bit: HKLM|HKCU\SOFTWARE\ 32-bit: HKLM|HKCU\SOFTWARE\wow6432node\. This means that the 64-bit Python … 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

How to write setup.py to include a Git repository as a dependency

After digging through the pip issue 3939 linked by @muon in the comments above and then the PEP-508 specification, I found success getting my private repo dependency to install via setup.py using this specification pattern in install_requires (no more dependency_links): install_requires = [ ‘some-pkg @ git+ssh://git@github.com/someorgname/pkg-repo-name@v1.1#egg=some-pkg’, ] The @v1.1 indicates the release tag created on … Read more

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