Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pip install opentimelineio causes CMake Error on Windows 10 x64 #770

Closed
maptz opened this issue Aug 16, 2020 · 20 comments
Closed

pip install opentimelineio causes CMake Error on Windows 10 x64 #770

maptz opened this issue Aug 16, 2020 · 20 comments

Comments

@maptz
Copy link

maptz commented Aug 16, 2020

Hi,

I'm trying to install OpenTimelineIO on a clean windows box by using the pip install command. I've installed the latest CMAKE package for x64 which has suppressed some errors, but I'm still not able to pip install opentimelineio

The error I'm getting is:

CMake Error at CMakeLists.txt:7 (project):
      Generator

        NMake Makefiles

      does not support platform specification, but platform

        x64

      was specified.


    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

What are the appropriate settings and pre-requisites for including this package on a Windows box?

@meshula
Copy link
Collaborator

meshula commented Aug 17, 2020

You mention a clean machine, and the error reports not finding a toolchain. If you haven't already, I'd install VS2019 and try again. If you have done that, we'll need to dig deeper.

@maptz
Copy link
Author

maptz commented Aug 17, 2020

Hi @meshula ,

Well, the machine is clean-ish. VS2019 (Community) is installed as is Python (v3.8.5).

I've also installed:

  • CMake - First via WinGet, then using the CMAKE redistributable. It's in the PATH, though no more setup than that.
  • I've installed MinGW as I wasn't sure how CMAKE wanted to compile things.

I haven't installed the Desktop Development with C++ components in VS2019 though. Is this a prerequisite?

image

@maptz
Copy link
Author

maptz commented Aug 17, 2020

I've now uninstalled CMake (installed from the official distribution) and I've installed the C++ components for VS2019 which should include CMAKE.

Now when I open a Visual Studio Command Prompt (so CMAKE is in the path and should be setup for the correct compilers) and type pip install opentimelineio it still fails with the same error:

 CMake Error at CMakeLists.txt:7 (project):
      Generator

        NMake Makefiles

      does not support platform specification, but platform

        x64

      was specified.


    CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
    CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage

Any help much appreciated.

@meshula
Copy link
Collaborator

meshula commented Aug 17, 2020

I have a hunch that the cmake portions of the build are still configured from before you installed the C++ components. Could you try renaming, or deleting your existing OTIO directory, cloning it from scratch, and then running pip again from within the Visual Studio Command Prompt please?

@maptz
Copy link
Author

maptz commented Aug 17, 2020

Thanks.

I'm not actually doing this by cloning the project, so I don't have the OTIO directory on my computer. I was just trying to consume it as a library in python as per the QuickStart.

I was actually surprised it wanted to build anything in CMake at all, and wondered if there might be a bug in the package.

I'll try building it from source though and see what happens.

@maptz
Copy link
Author

maptz commented Aug 17, 2020

Hi,

So, I've made some progress. Some combination of the following got rid of the original error:

  1. Installing the VS C++ components
  2. rebooting the machine
  3. Using a Developer Command Prompt for VS 2019 rather than the x86 x64 Cross Tools Command for VS 2019.

It's definitely made some progress as it's now doing some compilation when I pip install opentimelineio.

The compilation is still failing though, now with the following error:

error: [Errno 2] No such file or directory: 'C:\\Users\\steph\\AppData\\Local\\Packages\\PythonSoftwareFoundation.Python.3.8_qbz5n2kfra8p0\\LocalCache\\local-packages\\Python38\\site-packages\\opentimelineio_contrib\\application_plugins\\rv\\example_otio_reader\\__pycache__\\example_otio_reader_plugin.cpython-38.pyc.1612991305328'

@apetrynet
Copy link
Contributor

Hi! Glad to hear you've made some progress.
I'm not a windows user so haven't been through this myself, but would you mind trying to use python 3.7? Python 3.8 isn't officially supported and properly tested yet.
Could be worth trying while you wait for the US west coast to "boot up" again 😁

@maptz
Copy link
Author

maptz commented Aug 18, 2020

You cracked it!

image

Here's what's working for me as a pre-requisite for pip install opentimelineio

  1. VS2019 with C++ components installed.
  2. Python 3.7.9
  3. Running the command in the Developer Command Prompt for VS 2019.

Thanks for your help everyone.

Is it sensible to amend the Quickstart document in the documentation?

@maptz
Copy link
Author

maptz commented Aug 18, 2020

Argh. Famous last words! Not quite there.

Tried running a .py file with the following content

import opentimelineio as openio

timeline = openio.adapters.read_from_file("path-to-aaf.aaf")
for clip in timeline.each_clip():
  print(clip.name, clip.duration())

The failure is:

Traceback (most recent call last):
  File "ots.py", line 1, in <module>
    import opentimelineio as openio
  File "C:\Users\usr\AppData\Local\Programs\Python\Python37\lib\site-packages\opentimelineio\__init__.py", line 35, in <module>
    from . import (
  File "C:\Users\usr\AppData\Local\Programs\Python\Python37\lib\site-packages\opentimelineio\opentime.py", line 1, in <module>
    from . _opentime import ( # noqa
ImportError: DLL load failed: The specified module could not be found.

Any help?

@apetrynet
Copy link
Contributor

You might be running into the issue "resolved" in #667 by moving some libs described here

Hope this helps you further along.

@maptz
Copy link
Author

maptz commented Aug 18, 2020

Thanks, Will take a look

@meshula
Copy link
Collaborator

meshula commented Aug 19, 2020

I have a work in progress fix that puts the dlls in a place that's convenient for python to find them. I don't recommend working from this branch as I still have a couple of small issues to iron out, but I'm noting it here so we can track the issue. In the meantime copying the dlls as @apetrynet suggested will get you going.

#764

@maptz
Copy link
Author

maptz commented Aug 19, 2020

Thanks. Will take a look and confirm.

@maptz
Copy link
Author

maptz commented Aug 19, 2020

Well done @apetrynet and @meshula. We're working!

Just a quick overview on how I got pip install opentimelineio to work in Windows as of today (2020/08/20) for anyone with the same issue.

  1. Installed VS2019 with C++ components installed.
  2. Made sure I wasn't running Python version greater than 3.7.9.
  3. Ran pip install opentimelineio in a Developer Command Prompt for VS 2019.
  4. Created a new .py file called test.py:
import opentimelineio as openio
timeline = openio.adapters.read_from_file("path to/some.aaf")
for clip in timeline.each_clip():
  print(clip.name, clip.duration())
  1. Went to C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python37\Lib\site-packages\opentimelineio\cxx-libs\bin and copied the two dlls in that folder (opentime.dll and opentimelineio.dll) to C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python37\Lib\site-packages\opentimelineio.
  2. Ran py test-py.
  3. She's alive!

@IgorRidanovic
Copy link

IgorRidanovic commented Oct 27, 2020

The solution by @maptz worked for me too in an identical set of circumstances. I just ran pip install opentimelineio from the command line and it worked after I installed VS with the C++ option. I also had the issue with the two missing libraries.

@neilpercy
Copy link

Thanks for the really useful info, I'm very close to getting this working but failing at the last hurdle.

I followed @maptz 's guide and (eventually) got python and pip installed (thank you!), but then the fun started....

KDEnlive complained it couldn't find "python3" executable when I tried to export a timeline - after a bit of digging I renamed the freshly installed python.exe (3.7.9) to 'python3' and things moved forward.......

Then the error message was that KDENlive didn't have permission to write the temp file... I tried unticking the 'Read Only' permission on the 'Temp' folder, which seemed to complete... but still the error (and the permission on the Temp folder seems to revert back).......

So I eventually came up with the idea to run KDEnlive with Administrator privileges... no error messages, tried to save a file is FCPXML.... message saying "Project conversion complete"......... but no file anywhere!

Is there anything else I need to do to export an XML file...... do I need to install or enable any Adapters - I think I read that some are enabled by default, including XML ???

Any thoughts greatly appreciated,

regards

neil

@ssteinbach
Copy link
Collaborator

With the heavy caveat that I'm not familiar with KDEnlive, and haven't tried the guide referenced above:

pip list | grep OpenTimelineIO

should list OTIO.

Then, from python, check:

import opentimelineio as otio

Finally, check to see that FCPXML is in the list of adapters:

'xml' in otio.adapters.suffixes_with_defined_adapters()

(should return True)

@meshula
Copy link
Collaborator

meshula commented Dec 21, 2020

@ssteinbach I'm noticing the following in my Windows install. Is this indicative of an error in the generated manifest? With regards Neil's situation, I do see that the 'xml' adapter is indeed in the list of adapters, so overall the install looks good.

[Edit] ---- this is not a problem. I started python in my opentimelineio source directory, and that's why the path to my source code was in the sys.path.

Python 3.8.5 (default, Sep  3 2020, 21:29:08) [MSC v.1916 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import opentimelineio
C:\bin\miniconda3\envs\dev\lib\site-packages\opentimelineio\plugins\manifest.py:33: UserWarning: Module opentimelineio was already imported from C:\bin\miniconda3\envs\dev\lib\site-packages\opentimelineio\__init__.py, but c:\projects\pixar\opentimelineio is being added to sys.path
  import pkg_resources

@neilpercy
Copy link

neilpercy commented Dec 23, 2020

With the heavy caveat that I'm not familiar with KDEnlive, and haven't tried the guide referenced above:

@ssteinbach

me saying mpatz's 'guide' is probably a bit misleading - its the instructions two post above mine:-

      > 1. Installed VS2019 with C++ components installed.
      > 2. Made sure I wasn't running Python version greater than 3.7.9.
      > 3. Ran pip install opentimelineio in a Developer Command Prompt for VS 2019.
      > .......
      > 
      > 4. 9. Went to C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python37\Lib\site-packages\opentimelineio\cxx-libs\bin and copied the two dlls in that folder (opentime.dll and opentimelineio.dll) to C:\Users\[USERNAME]\AppData\Local\Programs\Python\Python37\Lib\site-packages\opentimelineio.
      > 

pip list | grep OpenTimelineIO

Just so we're on the same page - this is for a Windows 10 install:- I'm presuming GREP is Linux only ???
(unless it can be used in one of the development tools, VS2019 ??)

thanks for the help,

neil

@jminor jminor added this to the Public Beta 14 milestone Apr 22, 2021
@Erriez
Copy link

Erriez commented Jul 30, 2023

Is it sensible to amend the Quickstart document in the documentation?

@maptz Yes, the Quickstart documentation is very poor and incomplete. I used different steps as your commands results in linker errors:

  1. Install VS2022 Community with components:

image

(Maybe too much will be installed)

  1. Install Python 3.11.4 and make sure the Python path environment variable is set.
  2. Open x64 Native Tools Command Prompt for VS 2022 via start menu.
    Note: Developer Command Prompt for VS2022 did not work with my setup.
  3. pip install opentimelineio:

image

Can someone update the Quickstart documentation?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants