我正试图在我的ubuntu上安装一个python包。我正试图通过我编写的安装脚本来安装它。setup.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
# 4 - Beta
# 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目录中。但是,当我导入/usr/local/bin目录外的模块时,会发生导入错误。我尝试将路径更改为/usr/local/bin,但它工作正常,不会发生导入错误。如何安装程序包以便导入任何目录中的模块?提前谢谢。。。