Using an environment variable set to a path value: the system cannot find the path specified for %OPENCV_DIR%
Posted
by
dumbledad
on Super User
See other posts from Super User
or by dumbledad
Published on 2013-10-10T09:35:13Z
Indexed on
2014/06/10
15:29 UTC
Read the original article
Hit count: 179
I'm trying to set an environment variable to point to the directory into which I have extracted the latest version of OpenCV, following the instructions in OpenCV's Installation in Windows tutorial.
Here's my elevated command line listing.
C:\>cd C:\OpenCV2.4.6\build\x64\vc11
C:\OpenCV2.4.6\build\x64\vc11>cd ../../../..
C:\>setx -m OPENCV_DIR C:\OpenCV2.4.6\build\x64\vc11
SUCCESS: Specified value was saved.
C:\>cd %OPENCV_DIR%
The system cannot find the path specified.
C:\>echo %OPENCV_DIR%
%OPENCV_DIR%
- Firstly I change directory to
C:\OpenCV2.4.6\build\x64\vc11
to ensure that it exists. - After that is successful I change directory back to the root of the C drive.
- Then I use
setx
to makeOPENCV_DIR
a system wide environment variable with value theC:\OpenCV2.4.6\build\x64\vc11
path I verified in step 1. - Noting the success of
setx
in the previous step I now change directory using the new environment variable. But it fails with the messageThe system cannot find the path specified.
- If I try to
echo
the value of theOPENCV_DIR
environment variable it appears not to be set.
Looking in the control panel the OPENCV_DIR environment variable looks correctly set:
What's wrong? Why is the variable not working? Am I evoking it incorrectly when I use it to change directory or echo its value?
© Super User or respective owner