我正在尝试按照本教程使用pip在本地安装python包。
我的结构是这样的:
bacnet-restful/
example-node-red-flows/
flask_version/
images/
swagger_json/
scanning_scripts/
modulepkg/
__init__.py
aioapp.py
bacnet_actions.py
models.py
views.py
.gitignore.txt
LICENSE
README
requirements.txt
runtime.txt
setup.py
根据bacnet-restful
目录中的教程,当我运行pip install wheel
时,我得到这个错误:
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
Requirement already satisfied: wheel in c:python39libsite-packages (0.37.0)
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
同样适用于Windows。Python版本为3.9.6
这是我的setup.py
import setuptools
with open("README.md", "r") as fh:
long_description = fh.read()
setuptools.setup(
name="bacnet-restful",
version="0.0.1",
author="author newb",
author_email="newb.newb@gmail.com",
description="restful BACnet App",
long_description=long_description,
long_description_content_type="text/markdown",
packages=setuptools.find_packages(),
classifiers=[
"Programming Language :: Python :: 3",
"License :: OSI Approved :: MIT License",
"Operating System :: OS Independent",
],
python_requires='>=3.8',
)
编辑
PS C:Desktopbacnet-restful> pip install bacnet-restul
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
ERROR: Could not find a version that satisfies the requirement bacnet-restul (from versions: none)
ERROR: No matching distribution found for bacnet-restul
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
WARNING: Ignoring invalid distribution -ip (c:python39libsite-packages)
编辑2
我在这里得到了一些关于setup.py
应该如何安装包的提示:
from distutils.core import setup
setup(name='bacnet-restful',
version='1.0',
description='Python Distribution Utilities',
author='author newb',
author_email='newb.newb@mail.com',
url='https://www.python.org/',
py_modules=['aiohttp', 'BAC0', 'aiohttp_pydantic'],
)
请在您的虚拟环境中尝试以下操作。
pip install wheel
pip install .