Unable to install XGBOOST on MAC using Anaconda - xgboost

I am using the Graphical Interface of Anaconda. I tried to install py-xgboost but it gave me the following error-
*UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
py-xgboost -> python[version='>=2.7,<2.8.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|>=3.5,<3.6.0a0']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.*
It says I have python 3.8 installed in my system but when I checked the python version on my system using the command python2 --version & python3 --version it says I have python 2.7.16 & python 3.7.3
I dont have python 3.8
What shall I do now? The above python version were there already. I never installed and someone told me not to remove those versions as some of the MAC applications are dependent on them. Its a MAC BOOK PRO 15 ( 2019 )

After some research I found a solution. I had to downgrade my python version.
But as explained above when I tried to check the version of python I am using I was getting 2.7 & 3.7.3 but my ANACONDA gives an error that I have version 3.8
That was because Anaconda uses the python which is installed in a separate directory, it was not using the python installed at the PATH directory. So I had to downgrade python which the ANACONDA was using by using the command -
conda search python
BTW if your terminal says conda command not found, then you need to edit your PATH first.
Then it gives a list of python version, you can then see which version is right for your XGboost version and then use the command-
conda install python=3.7.7
or whatever version you wanted to use.
After the downgrade of python, anaconda will ask you to downgrade other libraries as well, so go ahead and do that too unless you are using some command which was not there in the older version.
Now install py-xgboost from ANACONDA Graphical interface or by using conda method
conda install -c anaconda py-xgboost

Related

Installing tensorflow 1.9 on raspberry pi*addressed by modifying code to work with tf 2

updated code to work with tensorflow 2.4 to get around issue
I'm trying to install Tensorflow 1.9 on a Raspberry Pi as it is a requirement of the code I want to run. It installs fine on my Macbook using pip install tensorflow==1.9.0, but on the Pi I get the error:
Could not find a version that satisfies the requirement tensorflow==1.9.0 (from versions: 0.11.0, 1.11.0, 1.12.0, 1.13.1, 1.14.0)
No matching distribution found for tensorflow==1.9.0
I'm using a Conda (miniconda3) environment with Python 3.6.
Would using Ubuntu Desktop instead of Raspberry Pi OS work maybe? Or is there perhaps a way to build it from https://github.com/tensorflow/tensorflow/tree/r1.9?
You need to install python version 3.6 or other compatible versions in conda. Tensorflow does not work on versions higher than 3.8 and has identified issues with some other versions. I recommend using python 3.6 through conda. You will also probably need to move the
libcrypto-1_1-x64.dll
libssl-1_1-x64.dll
files from anaconda3\Library\bin to anaconda3/DLLs. You can find more details about this issue if you run into it here.
Hope this answers your question!
To install Tensorflow on Raspberry Pi run:
sudo apt install libatlas-base-dev
and then
pip3 install tensorflow
You can also compilte TensorflowLite and use if you wish. The compile TensorflowLite on RPi refer this link

Can't install tensorflow on python 3.9

When I try to install tensorflow on python 3.9 I get following error:
ERROR: Could not find a version that satisfies the requirement tensorflow (from versions: none)
ERROR: No matching distribution found for tensorflow
Is not there any tensorflow for 3.9?
What do you guys recommend?
Can I install other version of python beside the existing version?
Right now tensorflow does not have a build for python3.9
The latest one is for python3.8
You can check the build files at PyPI
https://pypi.org/project/tensorflow/#files
yes, you can install another version of python.
The original poster did not mention what type of computer or operating system he was using while attempting to install TensorFlow alongside Python 3.9. The error could be linked to working on a 64-bit Mac with the M1 chip (I recently experienced the same error described above while working on a Mac M1 in a Miniconda environment with Python 3.9.13). I solved the error by running
python3 -m pip install tensorflow-macos
from Terminal (in the Miniconda environment). TensorFlow installed normally alongside Python 3.9.13.
I do recommend installing Miniconda (or Anaconda as others have suggested), because it will allow you to easily create development environments with whatever version of Python modules or dependencies you require at the moment. See https://docs.conda.io/en/latest/miniconda.html. The larger Anaconda comes with a user-friendly 'Navigator' GUI which enables you to choose which environment is used to open a Jupyter notebook or other development environment, several of which come with Anaconda. See https://docs.anaconda.com/anaconda/install/
This is terrible with newer versions of Python that are not compatible with the machine learning module package.
So my approach is to keep the existing version 3.9 and the computer is using Anaconda to install a virtual environment with 3.7. When using vscode or pycharm, just remember to set it to that 3.7 Python environment.

Python 3.8.3 incompatible with tensorflow

I recently installed python with the version 3.8.3 and upgraded pip to 20.1.1. According to enter link description here, conda install -c conda-forge tensorflow should work. However, I get this result
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: -
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- tensorflow -> python[version='3.5.*|3.6.*|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0|3.7.*']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
since I use
(base) C:\Users\ivan>python --version
Python 3.8.3
(base) C:\Users\ivan>pip --version
pip 20.1.1 from C:\Users\ivan\anaconda3\lib\site-packages\pip (python 3.8)
I wonder if it is possible to solve this issue without downgrading. For users of anaconda 2020.07, python 3.8 is used by default. Downgrading it will break anaconda.
People have reported problems using tensorflow with python 3.8, it is best to use 3.7. You are incorrect about breaking Anaconda. Here is what to do.
In Anaconda home page click on environments. At the bottom left of the page click on create. A window will appear. Give the new environment a name (say python3.7). In the drop down menu select 3.7. Now a new environment is created using python 3.7. Now in the conda terminal type conda activate python3.7. Then use conda to install tensorflow. It will install version 2.1.1, the cuda toolkit version 10.1.243 and cudnn version 7.6.5. Note conda can only install tensorflow up to version 2.1.1. If you want tensorflow 2.2 install it with pip using pip install tensorflow ==2.2.0. after you have installed 2.1. The cuda toolkit and cudnn work with version 2.2. Now use pip or conda to install any other packages you need in your python3.7 environment and you should be good to go!

TensorFlow on Windows: "not a supported wheel on this platform" error

Was happy to know Tensorflow is made available for Windows and we don't have to use Docker.
I tried to install as per instructions but I get this error.
pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl
tensorflow-0.12.0rc0-cp35-cp35m-win_amd64.whl is not a supported wheel on this platform.
What does that error mean?
I am running latest version of Python.
python --version
Python 3.5.2
This is most likely to be a 64-bit versus 32-bit issue. The pre-built TensorFlow pip package is 64-bit only, but the default version of Python 3.5.2 on Python.org is 32-bit. You can download the 64-bit release from here (select one of the "Windows x86-64" options).
It's only available for Python 3.5.x not 3.6.
You can quickly create a 3.5 environment with:
conda create -n tensorflow python=3.5
You must have a 3.5.x version of Python. The 3.6 version won't work.
If you have installed an Anaconda that contains Python 3.6, you need to downgrade its Python to 3.5.2.
Open the Anaconda Prompt as administrator, and run:
conda install python=3.5.2
After the installation is finished, you can follow the rest of the steps on tensorflow website.
Do you have Python and Anaconda installed? I had a similar issue until I uninstalled Anaconda and then the setup was fine.
I did the following steps and it worked.(Anaconda 4.4 x64)
1- Go to Windows 10 command prompt (right click and Run as admin)
2- if activated the path, you can run conda anywhere, if not, should go to .../anaconda3/scripts and run conda command from there and do the following (the main trick was to change 35 to 36)
1- conda -n tensorflow python=3.5
2- activate tensorflow
3- pip install --upgrade https://storage.googleapis.com/tensorflow/windows/cpu/tensorflow-0.12.0rc0-cp36-cp36m-win_amd64.whl
issues fixed when i did the downgrading from 3.6 to 3.5 using the below
conda install python=3.5.2
There can be two reasons:
1) You are using 32-Bit python package. Tensorflow does not support 32 bit, only 64 fit.
Check in your system settings for this. If this is fine refer to second point..
2)You are using Python 3.7.
Python 3.7 isn't eventually officially supported by Python. It's still in beta testing,
and very much under active development.
Consider downgrading to a lower version of python. For now, stick with Python 3.6 or 3.5.

How to install lxml on Windows 8 64-bit with Python 3.4

Related Question 1
Related Question 2
[Error Log]
C:\Users\Hima\Documents\Installers\python\packages>python -m pip install lxml-3.4.4-cp34-none-win_amd64.whl
lxml-3.4.4-cp34-none-win_amd64.whl is not a supported wheel on this platform.
[Environment]
Windows x86 (64-bit)
Installed Visual Studio C++ 2014
Python 3.4
I use pip (or pip3.4.exe; built-in to Python 3.4) to pip install lxml
[Issues]
1. The lxml file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml shows as not supported.
2. In the following Package Index for lxml, there isn't a suitable lxml file for 64 bit and Python 3.4.
https://pypi.python.org/pypi/lxml/3.4.4
I have been struggling with this today. I found, elsewhere on stackoverflow.com, this two-part and quick solution, which resulted in python no longer complaining when I tried to use lxml:
Go to this repository and download a version which matches your Python installation (the version number, and 32- vs 64-bit. I use Python 3.5.1 64-bit, installed on Windows 10, so on that page, I chose lxml-3.6.0-cp35-cp35m-win_amd64.whl.
You say you use Python 3.4, so use a version that matches that (or maybe the one you already have).
There is some helpful information at the top of the page about which version of CPython the files are built against.
The output of python -v will also tell you which version of MSVC++ was used to build your version of the python executable.
This answer is useful for determining MSVC versions from the output of python -v (which contains a build number instead of a version number).
My download directory is d:\Downloads. Python must be in your PATH environment variable for the next step to work. Use a command like the following, changing "D:\Downloads" to the pathname to your download directory. Then, at a DOS prompt, type:
python -m pip install "D:\Downloads\lxml-3.6.0-cp35-cp35m-win_amd64.whl" lxml-3.6.0-cp35-cp35m-win_amd64.whl
My config:
Python 3.5
Windows 10
Downloaded lxml-3.6.0-cp35-cp35m-win_amd64.whl from http://www.lfd.uci.edu/~gohlke/pythonlibs/#lxml
Copy this file to: c:\Program Files\Python35\
first in cmd line:
c:\Program Files\Python35>py -m pip install --upgrade pip
Then in cmd line:
c:\Program Files\Python35>py -m pip install lxml-3.6.0-cp35-cp35m-win_amd64.whl
And it's done