3

I have a local project which I am developing and I want to install it into my pipenv so that I can try running some scripts that use the code I have developed.

I created a very basic setup.py located in the root of the project (mypackage/setup.py):

from setuptools import find_packages, setup

setup(
    name="mypackage",
    version="0.1",
    packages=find_packages(),
)

And have also added __init__.py files (although they are all empty, but that should be fine) into all of the desired directories within the project.

Then when I run pipenv install /Users/me/path/to/mypackage it tells me that it is installing 'mypackage', and then it even adds it to the pipfile.

But then when I run the venv pipenv shell and try importing the package python -c 'import mypackage' (also tried using python3 but same result), I get the error: ModuleNotFoundError: No module named 'mypackage'.

I also tried to remove the venv pipenv --rm and re-install it pipenv install, but the same result. So at this point I'm a bit stuck on what I should do.

1 Answers1

0

Not sure but try to see where your virtual environment is and list of packages inside it.

pipenv --where
pipenv --venv
pipenv graph
mahesh s
  • 31
  • 4
  • 2
    Hmm, when I look it shows that mypackage is available in the venv. Looking at `pipenv graph`. Also the `--where` shows it is in the root of mypackage. – Steve Ahlswede Aug 17 '22 at 06:31
  • cant know whats issue without looking and debugging, look at poetry once its similar to pipenv. [link](https://github.com/python-poetry/poetry) – mahesh s Aug 17 '22 at 15:49