Module Builds Without Attributes
Ninguém assumiu esta issue ainda.
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 42/100
- Tipo de issue
- Bug
- Clareza
- Razoavelmente clara
- Status de atividade
- Pouca atividade
- Stack de tecnologia
- cmake, python
- Domínio
- build-system
Direção de pesquisa
Comece com CMakeLists.txt e com as etapas de instalação indicadas na issue; em seguida, reproduza a importação e inspecione dir(scikit_build_example). A resolução relatada é importar scikit_build_example._core, portanto confirme que isso expõe add e subtract e determine se o exemplo ou suas instruções devem deixar claro esse uso.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
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']
- Linguagem predominante
- Python
- Estrelas
- 147
- Forks
- 39
- Métricas de merge de PRs
- Nenhum PR com merge em 30d
Preparar o ambiente
Este projeto não oferece contêiner de desenvolvimento, Dockerfile nem guia de contribuição, então a configuração fica por sua conta: comece pelo README e veja nosso guia da primeira contribuição para os passos gerais.
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de pybind/scikit_build_example
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 65/100
pybind/scikit_build_example#209 ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 45/100
pybind/scikit_build_example#189 · 3 comentários ·
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 45/100
pybind/scikit_build_example#181 · 4 comentários ·
-
pip install fail to linkAberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 25/100
pybind/scikit_build_example#162 ·
-
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 50/100
pybind/scikit_build_example#161 · 1 reação ·
Todas as issues de pybind/scikit_build_example
Issues semelhantes
-
app: scripts Bucket: KTLO status: backlog type: housekeeping
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
netbox-community/netbox-scripts#217 ·
Mantenedores costumam responder em até 1 dia
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 64/100
-
ApacheTomcatImporterPipeline truncates milestone fixed versions (e.g. 11.0.0-M6 -> 11.0.0)Talvez já em andamento @nikolya-ctrl assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 85/100
aboutcode-org/vulnerablecode#2533 ·
Mantenedores costumam responder em até 5 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 62/100
PermafrostDiscoveryGateway/water-timeseries-v2#312 ·
Mantenedores costumam responder em até 1 dia
-
bug
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
ClickHouse/dbt-clickhouse#829 ·
Mantenedores costumam responder em até 1 dia