Closed slightHYP closed 7 years ago
It looks like a problem importing cv2
. Can you open a python console and try import cv2
? How did you install opencv?
Just tried to import cv2, but nothing changed.
I installed opencv as described in the documentation: brew install opencv
Thanks
Do you mean that import cv2
on a python console works or you get an exception? Can you paste the output here?
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 :-)
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?
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
@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.
@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
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
to solve this problem 👍 only : uninstall numpy.exe and pip install numpy
Dear all,
I followed all the instructions to compile and build OpenSfm, but now I'm stuck at the last step.
If I run the command:
bin/run_all data/berlin
It gives me the following error:
I downgraded numpy from 1.11.0 to 1.9.3 but nothing changed.
Any advice is more than welcome ;-)
I'll paste here the
python setup.py build
log:here my
pip list
:and I'm running on OSX 10.11.4 El Capitan.
Thank you for your support and for any advice. Best, Michele