python setup.py install missing dependencies

1.6k Views Asked by At

I try to install my python package using:

python setup.py install

My setup.py looks like this:

import os

from setuptools import setup, find_packages

here = os.path.abspath(os.path.dirname(__file__))
with open(os.path.join(here, 'README.txt')) as f:
    README = f.read()
with open(os.path.join(here, 'CHANGES.txt')) as f:
    CHANGES = f.read()



requires = [
    'pyramid',
    'pyramid_chameleon',
    'pyramid_debugtoolbar',
    'mysql-python',
    'SQLAlchemy',
    'transaction',
    'zope.sqlalchemy',
    'waitress',
    'pyramid_tm',
    'simplejson',
    'webtest',
    'mock', 'pyopenms'
    ]

setup(name='mypackage',
      version='0.1',
      description='mypackage',
      long_description=README + '\n\n' + CHANGES,
      classifiers=[
        "Programming Language :: Python",
        "Framework :: Pyramid",
        "Topic :: Internet :: WWW/HTTP",
        "Topic :: Internet :: WWW/HTTP :: WSGI :: Application",
        ],
      author='',
      author_email='',
      url='',
      keywords='web wsgi bfg pylons pyramid',
      packages=find_packages(),
      include_package_data=True,
      zip_safe=False,
      test_suite='mypackage_test',
      install_requires=[],
      entry_points="""\
      [paste.app_factory]
      main = mypackage:main
      [console_scripts]
      initialize_mypackage_db = mypackage.scripts.initializedb:main
      """,

      )

My problem is that although mysql-python is installed. It tries to install MySQLdb as a package. It looks like it scans all files for used packages and tries to install them. However this is not possible since there is no package with the name MySQLdb only mysql-python.

Here is the error i receive:

creating /usr/local/lib/python2.7/dist-packages/mypackage-0.1-py2.7.egg
Extracting mypackage-0.1-py2.7.egg to /usr/local/lib/python2.7/dist-packages
Removing mypackage 0.1 from easy-install.pth file
Adding mypackage 0.1 to easy-install.pth file
Installing initialize_mypackage_db script to /usr/local/bin

Installed /usr/local/lib/python2.7/dist-packages/mypackage-0.1-py2.7.egg
Processing dependencies for mypackage==0.1
Searching for MySQLdb
Reading https://pypi.python.org/simple/MySQLdb/
No local packages or working download links found for MySQLdb
error: Could not find suitable distribution for Requirement.parse('MySQLdb')

If I use pip install . I get basically the same error:

Collecting MySQLdb (from mypackage==0.1)
/Users/Backert/ligandomat_env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:318: SNIMissingWarning: An HTTPS request has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may cause the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissingwarning.
  SNIMissingWarning
/Users/Backert/ligandomat_env/lib/python2.7/site-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:122: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
  Could not find a version that satisfies the requirement MySQLdb (from mypackage==0.1) (from versions: )
No matching distribution found for MySQLdb (from mypackage==0.1)

The MySQLdb package seems to be found as requirement in other python files, which are part of the projekt. I import the package there as import MySQLdb.

0

There are 0 best solutions below