I’m trying to install locally a personal package that I called circuits
.
I installed it with pip install -e .
, it shows up in the pip list
, but I have a ModuleNotFoundError
when I try to import it.
(venv) pip install -e .
Obtaining file:///Users/me/my_project/circuits
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build editable ... done
Preparing editable metadata (pyproject.toml) ... done
Requirement already satisfied: numpy in /Users/me/my_project/venv/lib/python3.9/site-packages (from circuits==0.1.0) (1.23.3)
Requirement already satisfied: tabulate in /Users/me/my_project/venv/lib/python3.9/site-packages (from circuits==0.1.0) (0.8.10)
Building wheels for collected packages: circuits
Building editable for circuits (pyproject.toml) ... done
Created wheel for circuits: filename=circuits-0.1.0-0.editable-py3-none-any.whl size=2277 sha256=a1ab6479e6d2761d7aae5cb156dd239001e54c397e712e279c6331b9ed217d0d
Stored in directory: /private/var/folders/mw/k72xg0bx6yz48vzqq4fbgsk80000gn/T/pip-ephem-wheel-cache-d5600og9/wheels/6d/ed/4d/6b97818bf8ea2c80312b9134aa990bb61b776a1399143dec7d
Successfully built circuits
Installing collected packages: circuits
Attempting uninstall: circuits
Found existing installation: circuits 0.1.0
Uninstalling circuits-0.1.0:
Successfully uninstalled circuits-0.1.0
Successfully installed circuits-0.1.0
(venv) cd ../projects
(venv) python -c "import circuits"
Traceback (most recent call last):
File "<string>", line 1, in <module>
ModuleNotFoundError: No module named 'circuits'
It turns out that the package is not added to my sys.path
, although other packages that also are on my laptop are when I install them the same way.
I suspect that there may be some link with the fact that there already exists a package with the same name on pypi (https://pypi.org/project/circuits/)
which python
returns/Users/me/my_project/venv/bin/python
which pip
returns/Users/me/my_project/venv/bin/pip
Project directory structure:
.
├── README.md
├── build
│ └── bdist.macosx-12-arm64
├── circuits
│ ├── file_a.py
│ ├── file_b.py
│ └── file_c.py
├── circuits.egg-info
│ ├── PKG-INFO
│ ├── SOURCES.txt
│ ├── dependency_links.txt
│ ├── requires.txt
│ └── top_level.txt
├── pyproject.toml
├── setup.cfg
pyproject.toml
content:
[build-system]
requires = ["setuptools", "wheel"]
build-backend = "setuptools.build_meta"
setup.cfg
content:
[metadata]
name = circuits
version = 0.1.0
authors = ["me"]
[options]
packages = find:
install_requires =
numpy
I use MacOS 12.6
--
Edit 1: added precisions on the config and project tree, removed screenshot.