我尝试使用以下方法安装python包:
Python设置.py安装
我的设置.py看起来像这样: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
""",
)
我的问题是,虽然安装了mysql python。它尝试将MySQLdb作为一个包安装。它看起来像是扫描所有文件中使用过的包并尝试安装它们。但是这是不可能的,因为没有名为MySQLdb-only-mysql-python的包。在
以下是我收到的错误:
^{pr2}$
如果我使用pip安装。
我得到的基本相同的错误: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)
MySQLdb包似乎可以在其他python文件中找到,这些文件是projekt的一部分。我将包作为import MySQLdb导入那里。在