Git Product home page Git Product logo

Comments (10)

paulinus avatar paulinus commented on June 8, 2024

It looks like a problem importing cv2. Can you open a python console and try import cv2? How did you install opencv?

from opensfm.

slightHYP avatar slightHYP commented on June 8, 2024

Just tried to import cv2, but nothing changed.

I installed opencv as described in the documentation: brew install opencv

Thanks

from opensfm.

paulinus avatar paulinus commented on June 8, 2024

Do you mean that import cv2 on a python console works or you get an exception? Can you paste the output here?

from opensfm.

slightHYP avatar slightHYP commented on June 8, 2024
Kayden-MACPRO:site-packages m.andreolli$ python
Python 2.7.11 (v2.7.11:6d1b6a68f775, Dec  5 2015, 12:54:16) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>>import cv2
>>> 

No logs, no errors :-)

from opensfm.

paulinus avatar paulinus commented on June 8, 2024

Ups. It is estrange that it works from the console and not when running the opensfm command. Can you think of any difference? Is the PYTHONPATH and python command the same on the two cases?

from opensfm.

umbertodistaso avatar umbertodistaso commented on June 8, 2024

Unfortunately i've the same issues. I do not have issues with numpy but problems with cv2 are still present.

here my pip list

altgraph (0.10.2)
bdist-mpkg (0.5.0)
bonjour-py (0.3)
cv2 (1.0)
decorator (4.0.9)
ExifRead (2.1.2)
gpxpy (1.1.1)
macholib (1.5.1)
matplotlib (1.3.1)
modulegraph (0.10.4)
networkx (1.11)
numpy (1.8.0rc1)
pip (8.1.1)
py (1.4.31)
py2app (0.7.3)
pyobjc-core (2.5.1)
pyobjc-framework-Accounts (2.5.1)
pyobjc-framework-AddressBook (2.5.1)
pyobjc-framework-AppleScriptKit (2.5.1)
pyobjc-framework-AppleScriptObjC (2.5.1)
pyobjc-framework-Automator (2.5.1)
pyobjc-framework-CFNetwork (2.5.1)
pyobjc-framework-Cocoa (2.5.1)
pyobjc-framework-Collaboration (2.5.1)
pyobjc-framework-CoreData (2.5.1)
pyobjc-framework-CoreLocation (2.5.1)
pyobjc-framework-CoreText (2.5.1)
pyobjc-framework-DictionaryServices (2.5.1)
pyobjc-framework-EventKit (2.5.1)
pyobjc-framework-ExceptionHandling (2.5.1)
pyobjc-framework-FSEvents (2.5.1)
pyobjc-framework-InputMethodKit (2.5.1)
pyobjc-framework-InstallerPlugins (2.5.1)
pyobjc-framework-InstantMessage (2.5.1)
pyobjc-framework-LatentSemanticMapping (2.5.1)
pyobjc-framework-LaunchServices (2.5.1)
pyobjc-framework-Message (2.5.1)
pyobjc-framework-OpenDirectory (2.5.1)
pyobjc-framework-PreferencePanes (2.5.1)
pyobjc-framework-PubSub (2.5.1)
pyobjc-framework-QTKit (2.5.1)
pyobjc-framework-Quartz (2.5.1)
pyobjc-framework-ScreenSaver (2.5.1)
pyobjc-framework-ScriptingBridge (2.5.1)
pyobjc-framework-SearchKit (2.5.1)
pyobjc-framework-ServiceManagement (2.5.1)
pyobjc-framework-Social (2.5.1)
pyobjc-framework-SyncServices (2.5.1)
pyobjc-framework-SystemConfiguration (2.5.1)
pyobjc-framework-WebKit (2.5.1)
pyOpenSSL (0.13.1)
pyparsing (2.0.1)
pytest (2.9.1)
python-dateutil (1.5)
pytz (2013.7)
PyYAML (3.11)
scipy (0.13.0b1)
setuptools (21.0.0)
six (1.4.1)
xattr (0.6.4)
xmltodict (0.10.1)
zope.interface (4.1.1)

....and errors

Traceback (most recent call last):
  File "/Users/u.di.staso/Desktop/OpenSfM/bin/opensfm", line 10, in <module>
    from opensfm import commands
  File "/Users/u.di.staso/Desktop/OpenSfM/opensfm/commands/__init__.py", line 2, in <module>
    import extract_metadata
  File "/Users/u.di.staso/Desktop/OpenSfM/opensfm/commands/extract_metadata.py", line 5, in <module>
    from opensfm import dataset
  File "/Users/u.di.staso/Desktop/OpenSfM/opensfm/dataset.py", line 10, in <module>
    import cv2
ImportError: No module named cv2

from opensfm.

paulinus avatar paulinus commented on June 8, 2024

@umbertodistaso in your case, it looks like python does not find cv2. This might be that PYTHONPATH does not include the directory where cv2 is installed.

from opensfm.

edgarriba avatar edgarriba commented on June 8, 2024

@slightGT @umbertodistaso Have you tried this tutorial for OpenCV Python bindings ?
http://docs.opencv.org/master/tutorial_py_setup_in_fedora.html#gsc.tab=0

from opensfm.

slightHYP avatar slightHYP commented on June 8, 2024

Dear all,

I've just figured out the issue πŸ‘

I discovered from the python console that the numpy module version loaded by python was different from the one in the Python Package Index list.

STEP 1:
Check the numpy version loaded. I run the following command in the python console:

>> print numpy.__version__

In my case,it returned the version 1.8.0, instead of the 1.11.0 of the pip list.

STEP 2:
follow this link in order to remove all the old references of numpy:
http://stackoverflow.com/questions/22815841/python-numpy-update-from-1-6-to-1-8

STEP 3:
Install numpy again:

sudo pip install -U numpy

STEP 4:
Check again the numpy version loaded. If numpy module not present, import it:

>> import numpy
>> print numpy.__version__

STEP 5:
Run the commend reported in the running chapter of the documentation:

bin/run_all data/DATASET_NAME

Thank you for your support, let's start using OpenSfM :-)
Best,
Michele

from opensfm.

AhmedSaym avatar AhmedSaym commented on June 8, 2024

to solve this problem πŸ‘
only : uninstall numpy.exe
and pip install numpy

from opensfm.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.