Can't install locally with `pip install -e .`
See original GitHub issueCan’t seem to install locally with pip install -e .
Main error is: ModuleNotFound
Build Problem
git clone https://github.com/pedrolabonia/OpenTimelineIO.git --recursive
Cloning into 'OpenTimelineIO'...
remote: Enumerating objects: 6444, done.
...
...
➜ otio cd OpenTimelineIO
➜ OpenTimelineIO git:(main) python -m venv .venv
➜ OpenTimelineIO git:(main) source .venv/bin/activate
➜ OpenTimelineIO git:(main) (.venv) python -m pip install --upgrade pip
Collecting pip
Using cached pip-22.0.4-py3-none-any.whl (2.1 MB)
Successfully installed pip-22.0.4
➜ OpenTimelineIO git:(main) (.venv) python -m pip install -e .
Obtaining file:///Users/pedrolabonia/dev/otio/OpenTimelineIO
Installing build dependencies ... done
Checking if build backend supports build_editable ... done
Getting requirements to build wheel ... done
Preparing metadata (pyproject.toml) ... done
Collecting pyaaf2~=1.4.0
Using cached pyaaf2-1.4.0-py3-none-any.whl
Installing collected packages: pyaaf2, OpenTimelineIO
Running setup.py develop for OpenTimelineIO
Successfully installed OpenTimelineIO-0.15.0.dev1 pyaaf2-1.4.0
➜ OpenTimelineIO git:(main) (.venv) python
Python 3.9.1 (default, Mar 21 2022, 17:23:00)
[Clang 13.0.0 (clang-1300.0.29.30)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import opentimelineio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'opentimelineio'
➜ OpenTimelineIO git:(main) (.venv) pip list
Package Version Editable project location
-------------- ----------- -------------------------------------------
OpenTimelineIO 0.15.0.dev1 /Users/pedrolabonia/dev/otio/OpenTimelineIO
pip 22.0.4
pyaaf2 1.4.0
setuptools 49.2.1
To Reproduce
- Mac OS 11.6
- Python 3.9.1
- OTIO https://github.com/PixarAnimationStudios/OpenTimelineIO/commit/ea64d92024ba4b521132f548df9ceee4585dbd46
- Compiler information:
➜ OpenTimelineIO git:(main) (.venv) clang -v
Apple clang version 13.0.0 (clang-1300.0.29.30)
Target: arm64-apple-darwin20.6.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Expected Behavior
Expected to be able to install locally with editable mode. I can install it normally via pip install opentimelineio
. I’m trying to figure out what’s going on. There’s a .egg-link
file in site_packages
which seems to be correctly pointing to the root. Contents of the .egg-link:
/Users/pedrolabonia/dev/otio/OpenTimelineIO
.
Issue Analytics
- State:
- Created a year ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Installing local package with pip install . doesn't work without
I used to do this by navigating to the package directory with the setup.py file, and then running pip install .
Read more >pip install doesn't install local package fully. #4810 - GitHub
I suggest you run python setup.py sdist and then inspect the contents of the *.tar.gz file that is generated in the dist/ folder....
Read more >Installing Packages - Python Packaging User Guide - Python.org
This section covers the basics of how to install Python packages. ... If pip does not find a wheel to install, it will...
Read more >Unresolved references to editable packages (pip install
I'm trying to install a local package with -e flag from pip. But that lib cannot be resolved by Goland. But the library...
Read more >pip install - pip documentation v22.3.1
pip looks for packages in a number of places: on PyPI (if not disabled via --no-index ), in the local filesystem, and in...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
The other way is to simply copy the
.so
intosrc/py-opentimelineio/opentimelineio
and addsrc/py-opentimelineio
to yourPYTHONPATH
.python setup.py build_ext
.so
s intosrc/py-opentimelineio/opentimelineio
PYTHONPATH
tosrc/py-opentimelineio
I personally don’t think it should go into the contributing guide. It’s way too hacky. I also wouldn’t add this solution to the
setup.py
script because it wouldn’t work for developers working on the extensions (_otio
and_opentime
).