I have been trying to install Python 2.7 XGBoost on my mac. I am running a framework build of python via brew and trying to install into a virtualenv. I have tried the following methods:
Manual build found here: https://github.com/dmlc/xgboost/blob/master/doc/build.md#python-package-installation
This results in this error:
error: Error: setup script specifies an absolute path:
/Users/username/git/xgboost/python-package/xgboost/../../lib/libxgboost.so
setup() arguments must *always* be /-separated paths relative to the
setup.py directory, *never* absolute paths.
I was able to build xgboost, but I cant install the package. The docs discuss needing disutils, but I can't find it anywhere. I tried running on disutils2, but that didn't work.
pip install found here: https://pypi.python.org/pypi/xgboost/
This results in this error:
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/jj/7r79983d7jvcz_1y6w2n5v2m0000gn/T/pip-build-l4ak5P/xgboost/
Removing "include_package_data=True" from setup.py helps.
See: https://github.com/django-salesforce/django-salesforce/issues/19
In python-package folder,
modify include_package_data=False in setup.py, and python setup.py install;
run: sudo cp ./xgboost/VERSION you_python_lib_location/site-packages/you_xgboost_version.egg/xgboost/
In my computer, you_python_lib_location is /Users/LeonTao/anaconda2/lib/python2.7 and you_xgboost_version.egg is xgboost-0.6-py2.7.egg. So I run:
sudo cp ./xgboost/VERSION /Users/LeonTao/anaconda2/lib/python2.7/site-packages/xgboost-0.6-py2.7.egg/xgboost/
Related
Issue:
#python3 setup.py install
is failing
Environment: RHEL 8 UBI container
I have a setup.py that looks like this: (any pointers or updates on this setup.py would be appreciated)
import setuptools
print('python/setup.py')
setuptools.setup(
name="process_data",
version="1.0",
description="desc",
author="FirstName LastName",
author_email="dude#abides.abide",
url="https://some.com",
packages=setuptools.find_packages(),
)
I have a directory structure like so (<some>.py in every directory, along with __init__.py):
python/
setup.py
<dir>/__init__.py
<dir>/__init__.py
<dir4>/__init__.py
<dir4>/<sub-dir1>/__init__.py
<dir4>/<sub-dir1>/<sub-dir>__init__.py
I want code in each of these directories to be part of a module package so I can import, nested however deep.
I'm doing this:
#cd python
#python3 setup.py install
I get this error:
python/setup.py
running install
error: can't create or remove files in install directory
The following error occurred while trying to add or remove files in the
installation directory:
/usr/local/lib/python3.6/site-packages/test-easy-install-1625.write-test
[Errno 2] No such file or directory: '/usr/local/lib/python3.6/site-packages/test-easy-install-1625.write-test'
The installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/usr/local/lib/python3.6/site-packages/
This directory does not currently exist. Please create it and try again, or
choose a different installation directory (using the -d or --install-dir
option).
Questions:
Where is this coming from: test-easy-install-1625.write-test ? (so confused as to what this is)
On my system, indeed this directory does not exist (why is python3 setup.py install looking there? what told it to look there?):
/usr/local/lib/python3.6
There is nothing in my setup.py to indicate to look there.
I looked all over, and it looks like my /site-packages/ directory is here (where other modules are installed, when I ran pip)
`/usr/local/lib64/python3.6/site-packages/`
How do I fix this?
Thank you, I so badly need to get this working right away. I have been working on Windows, and >python setup.py install simply works there.
Are there any env variables I should have setup?
I simply installed python with: dnf -y install python36 that's it. (the latest version available in any RHEL 8 package repo for installation).
I ran into this same error and I was able to fix it by creating a symbolic link. I accept someone else maybe able to offer a more elegant solution and I welcome it.
sudo mkdir /usr/local/lib/python3.6
sudo ln -s /usr/lib/python3.6/site-packages /usr/local/lib/python3.6/
I assume you had enter python command mode, if you don't, the following commands are needed, notice to set variable Path and PythonPath of yours:
setlocal
set env_name=python3.6
set Path=C:\Users\s41167\Miniconda3\envs\%env_name%;C:\Users\s41167\Miniconda3\envs\%env_name%\Scripts;%Path%
set PythonPath=C:\Users\s41167\Miniconda3\envs\%env_name%\Lib\site-packages
cd C:\Users\s41167\Documents\%env_name%
cmd.exe /K activate %env_name%
if you enter python command mode, you can use pip to insall the package:
pip install <package location> --target <install location> --upgrade
below is my install command and result:
(python3.6) C:\Users\s41167\Documents\python3.6>pip install ./python_package --t
arget ./target --upgrade
Processing c:\users\s41167\documents\python3.6\python_package
Building wheels for collected packages: process-data
Building wheel for process-data (setup.py) ... done
Created wheel for process-data: filename=process_data-1.0-cp36-none-any.whl si
ze=1721 sha256=ef5eaf061000f30d472e5dde268694733e40a3f8a4a29fa78faec69f125443c9
Stored in directory: C:\Users\s41167\AppData\Local\Temp\pip-ephem-wheel-cache-
v6lt_ndp\wheels\61\01\f5\07e0760baa10d63e1c43b37eadbb55b79828f4fe337209026a
Successfully built process-data
Installing collected packages: process-data
Successfully installed process-data-1.0
(python3.6) C:\Users\s41167\Documents\python3.6>
and the file arrangement:
.\python_package
__init__.py
setup.py
\directory
__init__.py
\directory4
__init__.py
\sub_dirctory1
__init__.py
in Linux use
sudo python3 setup.py install
in windows use
python setup.py install
or
python3 setup.py install
I tried installing Jupyter through pip and it failed showing this.
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been
aborted.
This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please, inform the package's author and the
EasyInstall maintainers to find out if a fix or workaround is
available.
Try to upgrade your packages:
pip install --upgrade setuptools
pip install --upgrade pip
its seems like missmatch in your versions
simply follow this to install jupyter in windows :-
1nd - Go to file manager and find python folder (like:-python,python37,python39 etc...) may be it's in (C:\Python39) or (C:\Users\prade\AppData\Local\Programs\python39) .
2rd - in python folder open Scripts folder (Ex:- C:\......\python39\Scripts) and copy this path.
3rd - run cmd as administrator and past above path using cd (like:- cd C:\.....\python39\Scripts)
4th - now simply use jupyter install command (like:- pip install jupyterlab)
New to python, but I have v. 3.6.3 installed and I'm trying to install an api from github. I type "pip install lendingclub" into the command line and get the error msg:
"Command "python setup.py egg_info" failed with error code 1 in
C:\Users\REDPOI~1\AppData\Local\Temp\pip-build-adfw3v8o\pybars\"
I have tried updating pip with the commands :
"pip install --upgrade setuptools"
And
"easy_install -U setuptools"
The "pip3 install" gives the same error; I tried that in case the syntax was different for the newer python version. I have the Environment variables set to be able to access python from the command line rather than the anaconda environment. Any help would be greatly appreciated. I am at a loss :/
Read these methods :
Try to clean your pip and modules caches first, see :
Removing pip's cache?
Try to intall it that current module witthout any caches by this
command : "pip --no-cache-dir install setuptools"
Or try to install it offline, first you need to download that module
package from github ( prees that "clone or download" green button )
then extarct that package to some folder, in terminal or cmd try to cd to that
folder, then use this command : "python setup.py install"
Good Luck ...
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.
I'm trying to use the gfx module for python (from here: http://www.swftools.org/gfx_tutorial.html). But when I do python setup.py build I get an error:
ImportError: cannot import name CompileError
I just need to open a gfx file.. (Its part of the pythonchallenge.com)
How can I do it?
I'm working on linux mint 64bit
enter code here Not sure how stable this is but there seems to be a lot of issues installing 0.9.2 on ubuntu:
wget http://www.swftools.org/swftools-2013-04-09-1007.tar.gz
tar -xzvf swftools-2013-04-09-1007.tar.gz
cd swftools-2013-04-09-1007/
./configure
make
sudo make install
sudo cp lib/python/*.so /usr/lib/python2.7/site-packages/
That should compile and install on ubuntu.
Then python -c 'import gfx' should work.
I had a look at the setup.py script and it seems it is using CompileError from distutils which is now depreciated, I replaced it with from distutils.core import CCompilerError
Running python setup.py runs after changing but complains about various errors in relation to jpeg and PIL._imaging.so so I have included an instuctions.txt in the file which has instructions on how to setup the required packages and symlinks etc...
I also had to add the lib/art directory from swftools on github and add it to the lib directory.
It runs and installs on ubuntu 14.04 but should work on mint also.
The updated package is here
download
http://www.swftools.org/download.html
You can build the Python module using setup.py
You can build it "manually" by using make
To do the former, all that should be required is
python setup.py build
python setup.py install
This is the preferred way. If the above gives you any trouble or you prefer make, the following will also create the Python module:
./configure
make
# substitute the following path with your correct python
installation:
cp lib/python/*.so /usr/lib/python2.4/site-packages/
You can test whether the python module was properly installed by doing
python -c 'import gfx'