简体   繁体   中英

Wheel not built when pip installing from source - causes ModuleNotFoundError

I have written a python package mypackage , hosted on github, that I now want to install as a dependency to another project (specifically branch branch ).

I can build it locally using setuptools and a pyproject.toml file by running python3 -m pip install. at the top of mypackage/ and can then successfully import it into python.

I pushed this to github and now try to install it using

python3 -m pip install "git+https://github.com/mygituser/mypackage.git@branch"

This runs without warning, and if I then run python3 -m pip list I can see mypackage listed there. However, if I enter python and run import mypackage I get the error ModuleNotFoundError: No module named 'mypackage' .

Comparing the verbose outputs I can see that for the local install after installing the dependencies I get

  running bdist_wheel
  running build
  running build_py
  running egg_info
  writing mypackage/mypackage.egg-info/PKG-INFO
  writing dependency_links to mypackage/mypackage.egg-info/dependency_links.txt
...
...

etc. which is absent for the github build process (this just ends after dependencies are installed).

Am I missing a setting in pyproject.toml or somewhere to tell it to build a wheel so I can import mypackage it in python?

I have tried appending with #egg=mypackage and adding wheel to the build dependencies, but none of this has worked.

TIA

In addition to the changes you made to your pyprojcet.toml file here: https://github.com/jatkinson1000/archeryutils/commit/f5fb491aa37961a65796ce4be3616d8be23548ed

You also need to include a __init__.py file in your round_data_files folder so it gets included in the package install.

https://github.com/jatkinson1000/archeryutils/pull/9

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM