Module Builds Without Attributes
Personne n'a encore pris cette issue.
Évaluation
- Difficulté
- 2/5
- Temps estimé
- 1-3 heures
- Accessibilité débutants
- 42/100
- Type d'issue
- Bug
- Clarté
- Plutôt claire
- Activité
- Calme
- Stack technique
- cmake, python
- Domaine
- build-system
Piste de recherche
Commencez par CMakeLists.txt et les étapes d’installation indiquées dans l’issue, puis reproduisez l’importation et inspectez dir(scikit_build_example). La résolution indiquée consiste à importer scikit_build_example._core ; confirmez donc que cela expose add et subtract, et déterminez si l’exemple ou ses instructions devrait rendre cette utilisation claire.
Rédigé par le modèle d'indexation à partir du texte de l'issue.
Description
Following the instructions I am able to build and import the python module. However the module is missing all attributes (add, docs, subtract),
- Cloned the repo
- Open powershell v7.5.4 Run pip install ./scikit_build_example (pip version 26.0.1)
- Run python (version 3.14)
import scikit_build_examplescikit_build_example.add(1,2)- receive error: AttributeError: module 'scikit_build_example' has no attribute 'add'
Theorized that it may have to do with how pybind11 is linked
- placed pybind11 in submodule scikit_build_example/extern/pybind11
- commented line 14 in CMakeLists.txt
- added line: "add_subdirectory(extern/pybind11)
- Open powershell run
pip install ./scikit_build_example
pip uninstalled scikit_build_example-0.0.1
pip installed scikit_build_example-0.01 - Run python
6.import scikit_build_example scikit_build_example.add(1,2)- receive error: AttributeError: module 'scikit_build_example' has no attribute 'add'
For both cases the python dir(module) command output line
dir(scikit_build_example)
['doc', 'file', 'loader', 'name', 'package', 'path', 'spec']
Nox log has been attached
Help would be appreciated in resolving this issue
*Edit: Solution
- I have a python version with path name "python" and a different version with "py"
used the command python -m pip install, with python -m pip list to ensure the package existed in the correct version - Using the pip uninstall command the output:
*\python314\lib\site-packages\hello-0.0.1.dist-info*
*\python314\lib\site-packages\hello_core.cp314-win_amd64.pyd
gave me a clue that the attributes were being stored in a second location. Issue #63 contained the final clue to the naming convention to get access to the attributes
The automatically generated signatures of the class functions contain then something like packagename.modulename.classname
Therefore in order to get access to the defined attributes and follow the tutorial the import statement must be
import scikit_build_example._core
scikit_build_example._core.add(1,2)
'dir(scikit_build_example._core)'
['doc', 'file', 'loader', 'name', 'package', 'spec', 'version', 'add', 'subtract']
- Langage dominant
- Python
- Étoiles
- 147
- Forks
- 39
- Métriques de merge des PR
- Aucune PR mergée en 30 j
Préparer son environnement
Ce projet ne fournit ni conteneur de développement, ni Dockerfile, ni guide de contribution : l'installation est à votre charge. Commencez par son README, et consultez notre guide de la première contribution pour les étapes générales.
Par où commencer
- Lisez l'issue en entier, puis le guide de contribution du projet.
- Signalez en commentaire que vous la prenez — cela évite que deux personnes fassent le même travail.
- Forkez le dépôt et travaillez sur une branche.
- Ouvrez une pull request qui référence le numéro de l'issue.
Autres issues de pybind/scikit_build_example
-
Difficulté 4/5 3-5 jours Accessibilité débutants 65/100
pybind/scikit_build_example#209 ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
pybind/scikit_build_example#189 · 3 commentaires ·
-
Difficulté 2/5 1-3 heures Accessibilité débutants 45/100
pybind/scikit_build_example#181 · 4 commentaires ·
-
pip install fail to linkOuverte
Difficulté 4/5 3-5 jours Accessibilité débutants 25/100
pybind/scikit_build_example#162 ·
-
Difficulté 4/5 3-5 jours Accessibilité débutants 50/100
pybind/scikit_build_example#161 · 1 réaction ·
Toutes les issues de pybind/scikit_build_example
Issues similaires
-
app: scripts Bucket: KTLO status: backlog type: housekeeping
Difficulté 2/5 1-3 heures Accessibilité débutants 68/100
netbox-community/netbox-scripts#217 ·
Les mainteneurs répondent en général sous 1 jour
-
Difficulté 2/5 1-3 heures Accessibilité débutants 64/100
-
ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)Peut-être pris @nikolya-ctrl l’a pris aujourd’hui. Ouverte
Difficulté 2/5 1-3 heures Accessibilité débutants 85/100
aboutcode-org/vulnerablecode#2533 ·
Les mainteneurs répondent en général sous 5 jours
-
Difficulté 2/5 1-3 heures Accessibilité débutants 62/100
PermafrostDiscoveryGateway/water-timeseries-v2#312 ·
Les mainteneurs répondent en général sous 1 jour
-
bug
Difficulté 2/5 1-3 heures Accessibilité débutants 72/100
ClickHouse/dbt-clickhouse#829 ·
Les mainteneurs répondent en général sous 1 jour