如何手动全局安装python包设置.py?

2024-06-25 22:52:51 发布

您现在位置:Python中文网/ 问答频道 /正文

我正在尝试安装一个python包设置.py我曾经拥有过写的。那个设置.py看起来像这样:

    from setuptools import setup
try:
    from setuptools import setup
except ImportError:
    from distutils.core import setup

setup(
    name = 'pyduino',
    description = 'PyDuino project aims to make python interactive with hardware particularly arduino.',
    url = '###',
    keywords = 'python arduino',
    author = '###',
    author_email = '###',
    version = '0.0.0',
    license = 'GNU',
    packages = ['pyduino'],
    install_requires = ['pyserial'],
    classifiers = [

        # How mature is this project? Common values are
        #   3 - Alpha
        #   5 - Production/Stable
        'Development Status :: 3 - Alpha',
        'Intended Audience :: Developers',
        'Topic :: Software Development :: Build Tools', 
        'Programming Language :: Python :: 2',
        'Programming Language :: Python :: 2.6',
        'Programming Language :: Python :: 2.7',
        'Programming Language :: Python :: 3',
        'Programming Language :: Python :: 3.3',
        'Programming Language :: Python :: 3.4',
        'Programming Language :: Python :: 3.5',
    ],
    scripts=['pyduino/pyduino.py'],
) 

但是这个软件包安装在/usr/local/bin目录下,我无法在其他目录中导入该软件包的模块目录。是有什么方法可以全局安装,我可以在所有目录中使用?提前谢谢。。。。在


Tags: frompyimportalpha目录projectsetuplanguage