Ich habe ein Open-Source-Projekt (GridCal) und ich sage den Benutzern, das Paket mit pip install GridCal
oder pip3 install GridCal
für Unix-Systeme zu installieren.Pip kann keine Abhängigkeiten installieren
Die Setup-Datei ist dies:
from distutils.core import setup
import sys
import os
import platform
from GridCal.grid.CalculationEngine import __GridCal_VERSION__
name = "GridCal"
version = str(__GridCal_VERSION__)
description = "Research Oriented electrical simulation software."
# Python 3.5 or later needed
if sys.version_info < (3, 5, 0, 'final', 0):
raise (SystemExit, 'Python 3.5 or later is required!')
# Build a list of all project modules
packages = []
for dir_name, dir_names, file_names in os.walk(name):
if '__init__.py' in file_names:
packages.append(dir_name.replace('/', '.'))
package_dir = {name: name}
# Data_files (e.g. doc) needs (directory, files-in-this-directory) tuples
data_files = []
for dir_name, dir_names, file_names in os.walk('doc'):
files_list = []
for filename in file_names:
fullname = os.path.join(dir_name, filename)
files_list.append(fullname)
data_files.append(('share/' + name + '/' + dir_name, files_list))
if platform.system() == 'Windows':
# list the packages (On windows anaconda is assumed)
required_packages = ["numpy",
"scipy",
"networkx",
"pandas",
"xlwt",
"xlrd",
# "PyQt5",
"matplotlib",
"qtconsole",
"pysot",
"openpyxl",
"pulp"
]
else:
# make the desktop entry
make_linux_desktop_file(version_=version, comment=description)
# list the packages
required_packages = ["numpy",
"scipy",
"networkx",
"pandas",
"xlwt",
"xlrd",
"PyQt5",
"matplotlib",
"qtconsole",
"pysot",
"openpyxl",
"pulp"
]
# Read the license
with open('LICENSE.txt', 'r') as f:
license_text = f.read()
setup(
# Application name:
name=name,
# Version number (initial):
version=version,
# Application author details:
author="Santiago Peñate Vera",
author_email="[email protected]",
# Packages
packages=packages,
data_files=data_files,
# Include additional files into the package
include_package_data=True,
# Details
url="http://pypi.python.org/pypi/GridCal/",
# License file
license=license_text,
# description
description=description,
# long_description=open("README.txt").read(),
# Dependent packages (distributions)
install_requires=required_packages,
setup_requires=required_packages
)
Von Zeit zu Zeit erhalte ich Anwender Berichte sagen, dass die Programm-Module fehlt: https://github.com/SanPen/GridCal/issues/12
Ich habe die Liste der Pakete angegeben sowohl in install_requires
und setup_requires
.
Ist das ein Pip-Bug, oder soll ich etwas anderes machen?
Ich sehe 'PyDOE' nicht in der Liste der Abhängigkeiten. Wie ist es installiert? Ist es eine Abhängigkeit von einer aufgelisteten Abhängigkeit? – phd
Ich bezweifle, dass Sie beide 'install_requires' und' setup_requires' gleichzeitig benötigen. Siehe auch die Warnung unter https://pip.pypa.io/en/stable/user_guide/?highlight=setup_requires#installation-bundles: * Hüten Sie sich schließlich vor dem Schlüsselwort setup_requires arg in setup.py. Die (seltenen) Pakete, die es verwenden, werden dazu führen, dass diese Abhängigkeiten direkt von setuptools heruntergeladen werden, wobei die Schutzmechanismen von pip übersprungen werden. * – phd
pyDOE wird mit pySOT installiert und BTW funktioniert unter Linux und manchmal auch nicht so gut in Windows. Daher die Frage. –