I am having issue when creating a cookbook, like shown below:
What could this be related to? I have the chef-dk installed. I am new to chef, so please do not hesitate if you need more information about my environment.
root#chef-work:/home/ubuntu/chef-repo/cookbooks# chef generate cookbook learn_chef_apache2
perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
LANGUAGE = (unset),
LC_ALL = (unset),
LC_PAPER = "nb_NO.UTF-8",
LANG = "en_US.UTF-8"
are supported and installed on your system.
perl: warning: Falling back to the standard locale ("C").
Can't open generate: No such file or directory.
Can't open cookbook: No such file or directory.
Can't open learn_chef_apache2: No such file or directory.
Check your $PATH, type -a chef. I'm guessing you have multiple chef executables installed, and the one from ChefDK is not first. You can move the chef shell-init to the bottom of your shellrc file.
Related
My project is based on QT5.14 and relies on the mxml library and libhv library. Now to port to Ubuntu, I choose to use ddpkg-buildpackage to generate the deb package. Run the dpkg-buildpackage -b -rfakeroot -us-uc command. The following error message is displayed:
dpkg-shlibdeps: error: cannot find library libmxml.so.1 need by debian/pip/opt/pip/bin/pip(ELF format: elf64-littleaarch64 abi:'020100b7000000000'; rpath:'usr/lib/qt5/lib')
How can I solve this problem?
I am not familiar with linux environment, please help me to look at it, thank you
This is the structure directory for my project
pip
pip/src // source code
pip/vendor // dependent library directory
pip/vendor/mxml/lib/libmxml.so.1
pip/vendor/libhv/lib/libhv.so
debian/ruler Is generated using dh_make and is not modified
I am not familiar with linux environment
I am implementing qgis 3.4.3 in a custom application, but when I instantiate the QgsApplication() class, I receive the error "Could not find the Qt platform plugin "Windows" in "".
I've attempted using various installs of qgis 3.x+ including the standalone installer and OSGeo4W web installer. I currently am sticking with the OSGeo4W web installer installation. I am using a Python 3.7 installation separate from what comes with OSGeo4W and attempting to integrate qgis functionality.
I have followed the instructions in the following QGIS help doc under the section: "Using PyQGIS in Custom Applications"
https://docs.qgis.org/2.18/en/docs/pyqgis_developer_cookbook/intro.html#run-python-code-when-qgis-starts
After attempting to run the script I realized a dll plugin was missing. After some research, I found its the qwindows.dll that qt uses. The qwindows.dll is included in the OSGeo4W installation under: C:\OSGeo4W\apps\Qt5\plugins\platforms
I changed the QT_PLUGIN_PATH variable on the local command prompt to include the directory above, but the same error prevailed. I also changed the QT_DEBUG_PLUGINS variable to 1 which printed out the locations Qt is looking for plugins. Interestingly, it wasn't looking for plugins in the path I specified in the QT_PLUGIN_PATH variable.
Python Code:
import sys
#add qgis python libraries to instance python path in case not added
#at the environment variable %PYTHONPATH% level
sys.path.extend(['C:\\OSGeo4W\\apps\\qgis\\python',
'C:\\OSGeo4W\\apps\\Python37\\Lib\\site-packages'])
from qgis.core import *
# supply path to qgis install location
QgsApplication.setPrefixPath('C:\\OSGeo4W\\apps\\qgis', True)
# create a reference to the QgsApplication
# setting the second argument to True enables the GUI, which we need to do
# since this is a custom application
qgs = QgsApplication([], True)
# load providers
qgs.initQgis()
# Write your code here to load some layers, use processing algorithms, etc.
# When your script is complete, call exitQgis() to remove the provider and
# layer registries from memory
qgs.exitQgis()
Batch File Code to Start Cmd Prompt with Proper Variables:
#echo off
SET OSGEO4W_ROOT=C:\OSGeo4W
::Include environment variables set by qgis on startup
call %OSGEO4W_ROOT%\bin\o4w_env.bat
call %OSGEO4W_ROOT%\bin\qt5_env.bat
call %OSGEO4W_ROOT%\bin\py3_env.bat
#echo off
path %PATH%;%OSGEO4W_ROOT%\apps\qgis\bin
path %PATH%;C:\OSGeo4W\apps\Qt5\bin
path %PATH%;C:\OSGeo4W\apps\Python37\Scripts
path %PATH%;C:\OSGeo4W\apps\Python37
set PYTHONPATH=%PYTHONPATH%;%OSGEO4W_ROOT%\apps\qgis\python
set PYTHONHOME=%OSGEO4W_ROOT%\apps\Python37
set QT_PLUGIN_PATH=%OSGEO4W_ROOT%\apps\Qt5\plugins;%OSGEO4W_ROOT%\apps\qgis\qtplugins
set QT_DEBUG_PLUGINS=1
cmd.exe
I expect to run the python script and receive no errors since I'm pointing to the directory where the qwindows.dll missing plugin is stored. However, I am still receiving the missing windows plugin error.
Here is the actual message with QT_DEBUG_PLUGINS set to 1:
QFactoryLoader::QFactoryLoader() checking directory path "C:/OSGeo4W/apps/qgis/qtplugins/platforms" ...
QFactoryLoader::QFactoryLoader() checking directory path "C:/OSGeo4W/apps/Python37/platforms" ...
qt.qpa.plugin: Could not find the Qt platform plugin "windows" in ""
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Add the following environment variables at the beginning of your python script before loading qgis.core:
#modify environment variables to find qgis and qt plugins during qgis.core import
os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = r'~qgis directory\apps\Qt5\plugins'
os.environ['PATH'] += r';~qgis directory\apps\qgis\bin;~qgis directory\apps\Qt5\bin'
The QT_QPA_PLATFORM_PLUGIN_PATH variable is used by Qt to look up certain drivers including the qwindows.dll. It doesn't know the path to the '~qgis directory\apps\Qt5\plugins' directory, so you need to provide it before using the QgsApplication module imported from qgis.core.
In order for your local version of python to find the qgis.core directory, you will also need to add the following qgis directories to your script before loading qgis.core:
sys.path.extend([r'~qgis directory\apps\qgis\python',r'~qgis directory\apps\Python37\Lib\site-packages'])
I'm working on Ubuntu 14.04 with ROS Indigo and I need to use Geometry Tools Wild Magic 5 for developing a package.
I have exported the path to Wild Magic folder as an environment variable by modifying .bashrc as follows:
export WM5_PATH=/home/user/catkin_ws/src/GeometricTools/WildMagic5/SDK
This is done to specify locations of header files in the CMakeLists.txt file of the package I'm coding:
include_directories(
include
$ENV{WM5_PATH}/Include/
)
Previously, in the same cmake file I check if the environmental variable is correctly set:
if (NOT DEFINED ENV{WM5_PATH})
MESSAGE (FATAL_ERROR "Wild Magic Engine 5.14 missing")
endif()
Now, while building the package using catkin build the environment variable is not found (the if above is entered). But by using printenv in the terminal I can see that the environment variable WM5_PATH is actually there.
How could I solve this problem?
I've just given your example a try and it works fine in my Ubuntu bash shell.
# export WM5_PATH=/home/user/catkin_ws/src/GeometricTools/WildMagic5/SDK
# cmake ..
-- Configuring done
-- Generating done
-- Build files have been written to: ...
So I suspect your cmake executable runs in another environment (e.g. an IDE).
To check what your CMake does see as an environment you could add the following to your CMakeLists.txt:
execute_process(
COMMAND ${CMAKE_COMMAND} -E environment
)
Reference
How to retrieve a user environment variable in CMake (Windows)
I am using Centos 5.x. I have set the system-config-language in /etc/sysconfig/i18n file as
LANG="en_US.UTF-8"
SYSFONT="latarcyrheb-sun16"
But when i type echo $LANG it shows as :
fr_FR.UTF_8
Please let me know where can i change the settings so that i will get English language as default.
Thanks
Rajasekhar
Try running the source command on the file:
source /etc/sysconfig/i18n
My operating system is linux mint 15, and I recently installed the texlive 2013. After installation, I appended the search path for texlive to ~/.bashrc
# set PATH
PATH=/usr/local/texlive/2013/bin/x86_64-linux:$PATH; export PATH
# set MANPATH
MANPATH=/usr/local/texlive/2013/texmf/doc/man:$MANPATH; export MANPATH
# set INFOPATH
INFOPATH=/usr/local/texlive/2013/texmf/doc/info:$INFOPATH; export INFOPATH
Then I could locate cmds such as pdflatex on xterm. However, when I wanted to use the pkg Sweave in rstudio, it always prompted that No Tex installation detected. I examined the $PATH in rstudio by Sys.getenv("PATH") and found out that the texlive/ directory was not appended to $PATH. So I guessed the problem was that the environment of Xsession doesn't take ~/.bashrc into considration. How to address this issue. Any help would be appreciated.
I have recently set up a configuration like yours.
The most correct solution is to put those lines into ~/.profile (or /etc/profile, for all users, as I did); this way all processes will inherit that PATH, not only those derived from bash.
You are right. R Studio runs in a shell that doesn't pay attention to the usual startup scripts. As far as I can tell, the appropriate place to change them globally (for all users) is R_HOME/etc/Renviron.site and for individual users, $HOME/.Renviron. (On my system, R_HOME is /usr/lib/R.)
Run ?Startup in the R Studio console for more details.