I would like to compile xgboost for Anaconda Python 3.x in 64-bit Windows 10, so I followed the steps here - https://xgboost.readthedocs.org/en/latest/build.html#building-on-windows and here - Install xgboost under python with 64-bit msys failing. Using the 64-bit mingw g++, I got the following error message when "make -j4" using mingw64.mk:
g++: error: dmlc-core/libdmlc.a: No such file or directory
g++: error: rabit/lib/librabit_empty.a: No such file or directory
Makefile:120: recipe for target 'lib/libxgboost.dll' failed
mingw32-make: *** [lib/libxgboost.dll] Error 1
Can you please let me know what's going on and how I can resolve this?
Thanks a lot.
You have to first go to the dmlc-core and rabit sub directories and execute make there. Then come to the xgboost library and execute build.sh.
Maybe you were not in the right folder when running install. Try the following.
Pull up Anaconda prompt, run:
cd xgboost\python-package
python setup.py install
If this still fails, try the process in this link from scratch and it should work. Quote from the link:
First follow the official guide with the following procedure (in Git
Bash on Windows):
git clone --recursive https://github.com/dmlc/xgboost
git submodule init
git submodule update
then install TDM-GCC here and do the following in Git Bash:
alias make='mingw32-make'
cp make/mingw64.mk config.mk; make -j4
Last, do the following using anaconda prompt or Git Bash:
cd xgboost\python-package
python setup.py install
You are missing those libraries in your directory. You have to clone xgboost recursively to include them as well. Just follow the clone process as mentioned in the installation guide and you should be fine!
Related
i have some problem when i want to transfer my model using bazel to convert it.
i try this cmd:
$ bazel build tensorflow/tools/graph_transforms:transform_graph
here are the error:
ERROR: Skipping 'tensorflow/tools/graph_transforms:transform_graph': no such package 'tensorflow/tools/graph_transforms': BUILD file not found on package path
can any body tell me how to use it?
thanks a lot
then i try this cmd:
$ bazel build tensorflow/tools/graph_transforms:vgg_16_10000.pb
i put have graph_transforms in tools directory and vgg_16_10000.pb in graph_transforms.
and i still get the same problem.
In order to run that first command (bazel build) you must have a BUILD file at the specified directory, which in this case is tensorflow/tools/graph_transforms. Based on only the info you've provided, chances are you haven't actually cloned or downloaded the Tensorflow repository. You cannot simply run that command if you only have installed Tensorflow using pip or conda install, since those do not include the source code.
That should be enough information for you to decide whether you actually want to build sources or use the python API, as shown here.
Navigate to the root of the tensorflow source directory run ./configure first:
$ ./configure
$ bazel build tensorflow/tools/graph_transforms:summarize_graph
I tried to install xgboost on python thanks to the following instruction:
I – Install MinGW Get the installer online :
https://sourceforge.net/projects/mingw-w64/
When installing, select 'Architecture' x86_64.
After the install procedure is completed, add the binaries path to your PATH
environment variable: directory can be something like
C:\Users\username\mingw-w64\x86_64-5.3.0-posix-seh-rt_v4-rev0\mingw64\bin
How to: change PATH variable on windows:
https://www.java.com/fr/download/help/path.xml
Help on errors: If you have another error in the install procedure,
get it from here
https://sourceforge.net/projects/mingw-w64/files/Toolchains%20targetting%20Win64/Personal%20Builds/mingw-builds/5.3.0/threads-posix/seh
Extract the file with 7zip in the directory of your choice (preferably
C:\Users\username\mingw64). Add the binaries path to your PATH
environment variable: C:\Users\username\mingw64\bin
II – Install Git https://git-scm.com/download/win and run the
installer
III – Install XGBoost on your computer open git bash shell in Windows,
and execute the following commands one by one:
cd your_folder_for_xgboost https://github.com/dmlc/xgboost
cd xgboost git checkout 9a48a40 # This line is based on https://github.com/dmlc/xgboost/issues/1267
git submodule init
git submodule update alias
make='mingw32-make'
cp make/mingw64.mk config.mk
make -j4
IV – Install XGBoost on python In the anaconda command prompt:
cd your_folder_for_xgboost/xgboost/python-package python setup.py install
All works well until the last command, there was an error that I don't understand how to resolve it. I tried to do it the second time but I still have the same error. I also tried to do the same thing on 2 different PCs and I had the same error message.
Possible issues and solutions:
The name of the MinGW64 installation folder shouldn`t have space. Therefore I do not recommend to install it by default in "Program Files".
You should restart your session (or even PC) after PATH editing.
Find mingw32-make.exe in MinGW64 folder and copy it again to this folder with renaming to make.exe. You can use make='mingw32-make' but I do not recommend it.
~Install GIT and XGBoost~
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost
git submodule init
git submodule update
cp make/mingw64.mk ./config.mk
Exec make -j4. If you can find xgboost.exe in XGBoost folder, then you did all right. If you get an error unrecognized option '-pthread', open (for editing) file Makefile in XGBoost directory, find -pthread in it and add L letter before (-lpthread)
After that you can execute:
cd python-package
python setup.py install
Do not forget that your Python should have installed 'setuptools'. Or you can just install Anaconda package with all utils (I recommend this way).
I have installed XGBoost using sudo pip install. When I attempt to lmport I receive an OSError library not loaded, image not found. I have installed Xcode and my compiler is clack. When I enter clack at the command line I receive another error: no input files possibly suggesting $PATH may need to be modified. How can $PATH be modified and will this allow XGBoost to be loaded properly?
The error saying no input files means you haven't given it any input files to compile. This is an expected error which even gcc, clang, etc. give. So, I do not think this is the correct debug step for your problem.
With pypi
When installing xgboost using pip on OSX, I receive an error saying clang-omp++ was not found. And eventually gives an error __builtin__.XGBoostLibraryNotFound: Cannot find XGBoost Libarary in the candicate path, did you install compilers and run build.sh in root path?. So, it has some bug and can't be installed it seems.
And this seems to be a known issue: https://github.com/dmlc/xgboost/issues/1446#issuecomment-239655078
Working method
This is how I got xgboost to be installed:
git clone --recursive https://github.com/dmlc/xgboost.git
cd xgboost
cp make/minimum.mk config.mk
make -j
This works using the builtin clang compiler as well as gcc from brew. For more info read https://xgboost.readthedocs.io/en/latest/build.html#building-on-osx
Now to install the python package:
cd python-package
python setup.py install
Read more at https://xgboost.readthedocs.io/en/latest/build.html#python-package-installation . Note that the python setup.py install may need sudo if you aren't using a virtualenv.
As the question says, I compiled grpc from source and also did sudo pip install grpcio, however, the which grpc_python_plugin doesn't return anything. This is a problem because the grpc python example for route_guide requires me to run protoc -I . --python_out=. --grpc_out=. --plugin=protoc-gen-grpc='which grpc_python_plugin' ./route_guide.proto
in order to generate the python stubs. Since, which grpc_python_plugin doesn't return anything, I get the following error:
: program not found or is not executable
--grpc_out: protoc-gen-grpc: Plugin failed with status code 1.
If I shorten the command I'm trying to run to:protoc -I . --python_out=. ./route_guide.proto, it generates the route_guide_pb2.py file but without the Servicer and Stub classes, and server and stub methods. Ofc, these methods are necessary if one wants to use grpc for any purpose. Any help would be appreciated.
python -m grpc_tools.protoc --proto_path=. --python_out=. --grpc_python_out=. my_proto.proto
Edited:
Apparently, there is open Issue on gRPC github site regarding this problem. Protoc seems to have a compatibility issue with grpc_python_plugin? I solved this problem by installing grpc_tools, then used grpc_tools.protoc instead of protoc.
$ pip install grpcio-tools
$ pip install googleapis-common-protos
Useful python tutorial: https://grpc.io/docs/tutorials/basic/python.html
See Protoc Issues [791 and 4961]:
https://github.com/google/protobuf/issues/791
https://github.com/grpc/grpc/issues/4961
To resolve this error make sure you have grpc_python_plugin installed on your system.
On python platforms pip install grpcio doesn't install platform specific plugins, so you have to install them separately by taking following steps
a) cd grpc (grpc repository)
b) git submodule update --init
c) make grpc_python_plugin
This will build the grpc python plugin for you. Now, find out the location of grpc_python_plugin on your system, lets call it binary_path
If binary_path is under $PATH environment variable (echo $PATH), you are good to go. However, if it is not under $PATH variable, you have two options
Update run_codegen.sh to --plugin=protoc-gen-grpc=binary_path
or, copy the binary to one of the locations tracked by $PATH environment variable
It sounds like you don't have /usr/local/bin in your PATH; make install uses a prefix of /usr/local by default. Alternatively, after compilation grpc_python_plugin should be in bins/opt/.
the python's gRPC plugin for protoc is not installed by default
$ protoc -I=grpc/protos helloworld.proto --plugin=grpc_python_plugin --python_out=grpc/helloworld --grpc_python_out=grpc/helloworld
protoc-gen-grpc_pythong is not recognized as an internal or external command,
operable program or batch file.
--grpc_python_out: protoc-gen-grpc_python: Plugin failed with status code 1.
install protoc-gen-grpclib_python and protoc-gen-python_grpc
$ pip install grpclib protobuf
generate your python gRPC stubs (replace --grpc_python_out with --grpclib_python_out)
$ protoc -I=grpc/protos helloworld.proto --plugin=grpc_python_plugin --python_out=grpc/helloworld --grpclib_python_out=grpc/helloworld
https://github.com/grpc/grpc/issues/15675
I got a similar problem (which grpc_cpp_plugin was empty). In my case the problem was that I didn't have installed grpc and I solved this for my OS X with brew install grpc.
Over the past few weeks I started programming in Python and have been using Enthought Canopy's python environment (using Mac OS X). I'm interested in modeling incompressible Navier-Stokes equation using the python module FEniCS/DOLFIN, but I have been having problems trying to install it.
Initially, I downloaded DOLFIN for python at: https://pypi.python.org/pypi/DOLFIN/1.2.0 . Inside the DOLFIN folder's Install file, there are steps for a 'Simple build and install' and it says to issue the commands:
cmake .
make install
So, I downloaded Cmake from: www. cmake .org (assuming all I have to do is download and install it, then I'll be able to reference cmake in the terminal).
Then I went into the Mac terminal, went to the location of the DOLFIN folder, and tried the above commands...
(Canopy 64bit) Ryans-MacBook-Pro:~ rms1000watt$ cd
/Users/rms1000watt/Documents/Programs/dolfin-1.2.0
(Canopy 64bit) Ryans-MacBook-Pro:dolfin-1.2.0 rms1000watt$ cmake .
-bash: cmake: command not found
(Canopy 64bit) Ryans-MacBook-Pro:dolfin-1.2.0 rms1000watt$ make install
make: Nothing to be done for `install'.
... which clearly didn't work.
So, I thought I would try to just install FEniCS in its entirety from: fenicsproject.org/download/osx_details.html
However, FEniCS is built against system Python and will not work with other Python packages.
(Enthought Canopy provided information to install external packages: https://support.enthought.com/entries/23389761-Installing-external-packages-into-Canopy-Python . But, I figured I was following step 2 by the 'Follow standard python installation procedures from the command line'.)
So, in short, I'm at a loss for how to install DOLFIN into Enthought Canopy.
Clearly the cmake executable is not in your PATH; that's why you get the cmake: command not found message. Locate your cmake executable with
find / -name 'cmake' -perm -111 -type file
(on my system the result is /Applications/CMake 2.8-9.app/Contents/bin/cmake, for instance; it's likely to be similar on yours). Then run cmake using the full path, e.g.
/Applications/CMake\ 2.8-9.app/Contents/bin/cmake .
(note the backslash before the space in the directory name). Of course you can also add CMake's bin directory to your PATH instead.