-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pip install failure #463
Comments
Does not seem to work for me ubuntu@ip-172-31-11-169: |
The stackoverflow suggestion of --pre produced this: ubuntu@ip-172-31-11-169:~$ sudo pip install --pre xgboost make: *** No rule to make target `python'. Stop. Building multi-thread xgboost failed Start to build single-thread xgboost make: *** No rule to make target `clean'. Stop. make: *** No rule to make target `python'. Stop. Successfully build single-thread xgboost If you want multi-threaded version See additional instructions in doc/build.md xgboost/build-python.sh: 26: xgboost/build-python.sh: popd: not found (None, None) Traceback (most recent call last): File "", line 17, in File "/tmp/pip_build_root/xgboost/setup.py", line 20, in
File "./xgboost/init.py", line 8, in
File "./xgboost/core.py", line 78, in
File "./xgboost/core.py", line 72, in _load_lib
File "/usr/lib/python2.7/ctypes/init.py", line 443, in LoadLibrary
File "/usr/lib/python2.7/ctypes/init.py", line 365, in init
OSError: /tmp/pip_build_root/xgboost/xgboost/./wrapper/libxgboostwrapper.so: invalid ELF header Cleaning up... |
@cliveseldon @grfiv the versioning of pip installation has some confusions, since the official version 0.4 has been there for a long time, and the pip installation contains some recent update from the source code, so I have named the version with 0.4a12 0.4a13 something. It will be corrected later from the next official release. A good solution for updating pip installation can be, deleting the xgboost directory and the xgboost-0.4a13.dist-info directory both from the site package directory, e.g. |
Hello, To run :
Fails as follows:
I've also tried without --pre, it fails identically. Any clue ? |
I used pip install xgboost to install xgboost-0.4a14 on a mac OSX. When I tried loading it I got this error. OSError Traceback (most recent call last) /Users/azaitzeff/anaconda/lib/python2.7/site-packages/xgboost/init.py in () /Users/azaitzeff/anaconda/lib/python2.7/site-packages/xgboost/core.py in () /Users/azaitzeff/anaconda/lib/python2.7/site-packages/xgboost/core.py in _load_lib() /Users/azaitzeff/anaconda/lib/python2.7/ctypes/init.pyc in LoadLibrary(self, name) /Users/azaitzeff/anaconda/lib/python2.7/ctypes/init.pyc in init(self, name, mode, handle, use_errno, use_last_error) OSError: dlopen(/Users/azaitzeff/anaconda/lib/python2.7/site-packages/xgboost/./wrapper/libxgboostwrapper.so, 6): Library not loaded: /usr/local/lib/gcc/4.9/libgomp.1.dylib Any help. Thanks |
@AZaitzeff @Fkawala Thanks. Can you confirm if you have gcc installed on your ubuntu or Mac? With your information, I see the problem of precompiled lib: if there is no gcc installed on the system, the build script in pip would fail. However, in the pip installation package, I included a precompiled lib libxgboostwrapper.so using gcc 4.9 from brew in Mac, so if the build script failed, xgboost will search for this precompiled lib. Linux doesn't recognize this Mac lib, so it has ELF code error; For mac with no OpenMP, it will trigger the link error. Now I see it causes some confusions and it might not be a good idea. I will update the pip installation, and display the message if there is no gcc. P.S. We will have precompiled and static linked lib in the next official release, which is a better solution of shipping precompiled code. |
@phunterlau Thanks. I do not have OpenMP on my Mac. So that is what was causing the error. |
@phunterlau ok, I'll set up a proper compilation environment and test the pip installation again. Thanks for the quick reply. |
So I ran brew install clang-omp and it installed. Deleted the xgboost directory and the xgboost-0.4a13.dist-info and reran pip install xgboost. Closed my terminal windows and reopened them. But I am still getting the same error when trying to import xgboost. Any thoughts? |
@AZaitzeff actually clang-omp is not recommended, since clang from Xcode doesn't support it so clang-omp may give some strange result. The mac pip installation package was created and tested on gcc 4.9 from brew with OpenMP. Do you want to try with |
Thanks that worked great. |
@phunterlau the build (using
gives:
|
According to http://stackoverflow.com/questions/9959279/detect-pip-in-setup-py [1] the |
@Fkawala Thanks. |
@phunterlau I have similar problem, didn't understand how to fix this ELF error. I'm working on ubuntu and can't import xgboost package after installing it with pip. You wrote about gcc, I installed gcc-4.9, but still don't work, what I'm missing? Here is my error: import xgboostOSError Traceback (most recent call last) |
@antklen in windows you need to install setuptools first. i'm not sure if that's the case for ubuntu, but maybe worth trying? |
@antklen it is because the current pip installation is a on-the-fly compiler script and it ships with a Mac version of .so file, in case some mac users didn't install g++ for compilation. It turned out not a good idea and caused some confusions for Linux users. The solution is that, please install gcc and g++ And, if your pip is newer than 0.7.1.2, it may have another problem of checking if pip is running. I will fix and ship it in the next release. If you have g++ but still the same error, please install from setup.py manually by following the installation document. |
@smargsongithub @phunterlau Thank you for replies! sudo apt-get install make |
@antklen oh, you need sudo when install g++ :-) |
@Fkawala I am trying |
@phunterlau I am getting the following traceback from pip install xgboost, any thoughts? (running a Mac) Traceback (most recent call last):
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/7g/thc6mmqd2nb55r21htwx2slr0000gp/T/pip-build-0BlCW9/xgboost |
@pcohen89 this python package ships with C++ code and compiles on-the-fly, so you might need a complier. Do you have your compiler installed, e.g. gcc-5 or clang LLVM from Xcode? Mac doesn't install xcode command line tools by default and you can follow this instruction http://railsapps.github.io/xcode-command-line-tools.html or, another better choice is installing After installing compilers, please remove the old xgboost installation, and redo |
Fix data file shipping confusions on pip install for #463
@antklen @phunterlau Tried following the steps mentioned by @antklen . Now, I am able to run import xgboost on terminal. However on anacondas ipython notebook it gives me the below error. Any help please. I am using ubuntu.
|
@jeechu that means xgboost was not compiled, have you:
|
@phunterlau me and @jeechu we have removed the old xgboost installation and installed gcc,g++. XGBoost is running fine via terminal, but using anaconda ipython notebook it is giving that error. Is there something wrong with the installation path? |
@rajdeltarobo @jeechu what is the python version of your ipython notebook? and, what is your Seems like your xgboost is search for |
@phunterlau
The python path is
The python version of ipython notebook is 2.7 |
How about adding something like this to your PYTHONPATH: if you want to use anaconda's python, just stay with it for everything, otherwise use |
please change the default compiler in config.mk to clang-omp. Please follow the build instruction Mac OS X part. |
Thx for ur instruction. And I changed the default compiler in config.mk to clang-omp like this export CXX = /usr/local/bin/clang-omp++ ADD_CFLAGS = -fopenmp` Then I compile by However, error appears again: make: *** [lib/libxgboost.so] Error 1 Is there anything wrong for me? |
And I run
|
please try reinstalling
and run |
Using Windows 7. Anaconda from yhat Rodeo. Trying to install xgboost and getting the following error. Please help. `! pip install xgboost Collecting xgboost |
@phunterlau Thx for your suggestion. I tried your instruction and getting the following error. Please give some suggestion.
Then I run
Then I run
|
Hi everyone, |
@boral yep, the current pip install doesn't support window platform. glad that you have figured out |
@LiyanJin you can just do 'make xgboost' for the core part. to have ar, you might need to install ar for mac |
I am facing similar issue. My error is quite
I checked I have gcc installed. I am on mac os I installed xgboost through anaconda |
@lalmanisha I believe you are using Mac. The current best practice on Mac is using |
Thanks for your reply. I still get the same error message. Here is the /Users/mlal/anaconda/lib/python2.7/site-packages/xgboost.py in () /Users/mlal/anaconda/lib/python2.7/site-packages/xgboost.py in load_xglib() /Users/mlal/anaconda/lib/python2.7/ctypes/init.pyc in LoadLibrary(self, name) /Users/mlal/anaconda/lib/python2.7/ctypes/init.pyc in init(self, name, mode, handle, use_errno, use_last_error) OSError: dlopen(/Users/mlal/anaconda/lib/python2.7/site-packages/libxgboostwrapper.so, 6): Library not loaded: @rpath/./libgomp.1.dylib choice of compiler |
sudo make -j4 make: *** [lib/libxgboost.so] Error 1 maker.o build/tree/updater_sync.o dmlc-core/libdmlc.a rabit/lib/librabit_empty.a -pthread -lm I still get same error |
ok, I guess combination of above some help and build.md helped me make xgboost work. Thank you all ! |
@lalmanisha since you only need the python package, you can just |
Try to install Xgboost with
Some tips ? Edit : Find the solution. Just |
@armgilles that is right: by default mac hasn't install the compilers with headers while |
I had to build it from scratch:
|
hnykda suggestion worked for me on Ubuntu 16.0.4 |
@phunterlau i have installed ar. i am wondering what the "ar crv" do,if i can use other command to replace. |
I have installed the package on my MAC (macOS 10.12.3) successfully by: brew install --with-clang llvm
brew install cmake
brew install gcc --without-multilib
git clone --recursive https://github.com/dmlc/xgboost
cd xgboost; cp make/config.mk ./config.mk; make -j4
cd python-package/ ; python setup.py install |
@hnykda Many times, the working solution is the seemingly simple one. Thanks, man. |
The solution that I found worked for me was navigating to |
It seems there are a lot of issues when installing xgboost. i tried to install onto Mac, and failed too. Could osmeone tell me what is the final solution ? |
what worked for me was adding the following on linux ... credit (everyone above)
|
For me worked on MacOS Sierra after: executing this commands:
|
@philipshurpik Thanks a ton! |
@philipshurpik That worked pretty great for me, thanks! |
root@0c6c17725a7b:/# pip install xgboost
Downloading/unpacking xgboost
Could not find a version that satisfies the requirement xgboost (from versions: 0.4a12, 0.4a13)
Cleaning up...
No distributions matching the version for xgboost
Storing debug log for failure in /root/.pip/pip.log
You can repeat in docker with:
docker run -it --rm ubuntu:trusty
see this also:
http://stackoverflow.com/questions/32258463/install-xgboost-under-python-failing
The text was updated successfully, but these errors were encountered: