question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Can't install locally with `pip install -e .`

See original GitHub issue

Can’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

  1. Mac OS 11.6
  2. Python 3.9.1
  3. OTIO https://github.com/PixarAnimationStudios/OpenTimelineIO/commit/ea64d92024ba4b521132f548df9ceee4585dbd46
  4. 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:closed
  • Created a year ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
JeanChristopheMorinPersocommented, May 3, 2022

The other way is to simply copy the .so into src/py-opentimelineio/opentimelineio and add src/py-opentimelineio to your PYTHONPATH.

  1. python setup.py build_ext
  2. Copy copy the .sos into src/py-opentimelineio/opentimelineio
  3. Set PYTHONPATH to src/py-opentimelineio
0reactions
JeanChristopheMorinPersocommented, May 3, 2022

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).

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found