1

I'm attempting to install a featurestore package from a private GitHub repo via ssh with the following command:

pip3 install -U git+ssh://git@dsghe.<mydomain>/bshelton/package_test.git@master#egg=featurestore

The install is successful, per the image below: enter image description here

But when trying to run from featurestore import *, I get a ModuleNotFoundError: No module named 'featurestore' error.

Using pip3 freeze, I see that the package is installed, but not with the <package>==<version> syntax I would expect, but it seems to be referencing the git commit instead as its "version":

enter image description here

I believe that the repo's directory set-up is appropriate for a Python package, per the screenshot below.

enter image description here

A noticeable difference between this package's install and the other packages I've installed is that it seems like only the ...dist-info folder is installed for my featurestore package, while every other installed package includes the actual package directory, in addition to the ...dist-info folder. Using ls ~/.local/lib/python3.6/site-packages:

enter image description here

This is my first time, trying to create a package like this, and I've been referencing the several sources below, but would appreciate some insight from the community as to what I'm missing. Thanks.

https://packaging.python.org/tutorials/packaging-projects/

pip install from git repo branch

torek
  • 448,244
  • 59
  • 642
  • 775
bshelt141
  • 1,183
  • 15
  • 31
  • 1
    Try the URL with `...#egg=featurestore` appended. https://stackoverflow.com/questions/11835396/why-egg-foo-when-pip-installing-from-git-repo – VPfB May 07 '21 at 11:49
  • @VPfB I still get the same results when specifying `#egg=featurestore` at the end. In addition to your link, I've been reviewing the following link too, and it seems like it should work. https://pip.pypa.io/en/stable/cli/pip_install/#git – bshelt141 May 07 '21 at 12:20

2 Answers2

1

The cause of my issue turned out to be a syntax error in my setup.cfg above the package_dir and packages lines, which are important if using a package layout with 'src'. Until I fixed the error, my package installed and imported fine in some contexts but not others

Bede Constantinides
  • 2,424
  • 3
  • 25
  • 28
0

I was able to solve for this by moving my featurestore directory up one level, and getting rid of the src directory. Based on the top answer here, I may have been able to also solve for it by simply adding a __init__.py file directly in the src directory. But for my need, src was really an unnecessary level.


New package directory set-up:

enter image description here


Code ran in terminal:

!pip3 install -U git+ssh://git@dsghe.<mydomain>/bshelton/package_test.git@master#egg=featurestore
from featurestore.featurestore import *
bshelt141
  • 1,183
  • 15
  • 31