Error when trying to install Lazypredict, problem with lightgbm - python

I'm trying to install Lazypredict, an autoML python library, on macOS 10.14.6.
Thus, I simply run
"pip install lazypredict" in the terminal , it wants to install lightgbm, but always fails to do so. I think it tries to install lightgbm through pip although I have already installed it with brew (as recommendend).
Hence i get such errors and really don't know what to do. I already have CMake installed too
Do you have ideas of what could enable me to install lazypredict ?
PS: Same happenned with other auto ML packages such as PyCaret
The errors I get are the following:
ERROR: Failed building wheel for lightgbm
Running setup.py clean for lightgbm
Failed to build lightgbm
Installing collected packages: lightgbm
Running setup.py install for lightgbm ... error
ERROR: Command errored out with exit status 1:
Exception: Please install CMake and all required dependencies first

SOLUTION 1 (Recommended)
LazyPredict works with specific versions of other libraries, I recommend you to work with Google Colab or Kaggle Notebook. They create a separate environment having multiple versions of other libraries, when you install lazypredict on colad or kaggle you won't face any issues.
One more reason to use lazypredict on Colab or Kaggle is that this library is just for testing purposes you cannot use this library for deployment, and it won't work on large datasets.
SOLUTION 2
As I mentioned lazypredict depends on specific versions of other libraries, you can search on google and will find a list of those libraries along with their version, try to manually install those versions but it is a time-consuming step, the other way is to install a new python version within which you can create a Virtual Environment and then try to install lazypredict in it.
SOLUTION 3 (only perform if you know docker)
If you are aware of Docker you can install a python image in it, a fresh install that does not contain any libraries, so you can install lazypredict in it.

Related

EnvironmentError when trying to install tensorflow-nightly in venv in PyCharm

My problem is already mentioned here, however I don't know how to do it in my venv using PyCharm. I set up a venv in PyCharm as follows:
Normally if I want to install a package I click on + search for it and install it. So tried for tensorflow-nightly. However, when trying to do so, I get the following error:
Now I don't know what to do. I want to install this version into my venv. How to do that? Where should I run pip install tf-nightly --user to make it available in my venv? When I try to run this in PyCharm I get an error: SyntaxError: invalid syntax.
When installing it, does this change my Python version?
Do you have any Python processes running in PyCharm (debugger?) or outside of it which are using this specific venv? Looks like you do and this process is using numpy.
When you are trying to install tensorflow pip attempts to uninstall numpy first as the current version is not compatible with the desired tf version. Uninstallation clashes with the Python process which is holding some numpy files resulting in permission error and half working numpy as a result.
Check the package list, is there ~umpy package? I remember seeing a similar issue with matplotlib and it manifested itself in ~atplotlib package after a failed uninstallation attempt.
Long story short - stop all Python process running and:
either manually remove d:\tfexam\venv\lib\site-packages\~umpy and install tf again
or recreate the venv from the scratch
Where should I run pip install tf-nightly --user to make it available in my venv?
You are supposed to run it in the terminal with the activated venv. Though, it is a non-relevant suggestion in this specific case. Anyway, I would suggest reading some docs about pip and virtualenv management if you are not familiar with them, as these topics are essential and will save you the trouble later.
tf-nightly is an unstable version.
Use this:
pip install --upgrade tensorflow
And verify install
python -c "import tensorflow as tf;print(tf.reduce_sum(tf.random.normal([1000, 1000])))"

Slow xmlsec package build with pip install

I'm using xmlsec 1.3.3 in my python web application.
Every time I run a clean pip install, this is the package it hangs on, for about 5 minutes.
The package size is 15KB and pip show a using cached... message, so I guess the time is taken by building some specific security libraries.
Is there a way to do a clean pip install, but without rebuilding the xmlsec related libraries?
xmlsec is distributed in source code only but it's written in C so pip needs to compile it on every fresh installation. It's not possible to not compile it.
You can pre-compile it yourself if you use one specific platform and always install from your package instead of PyPI.

Pip installing wrong version on win7,

I have a package that I am trying to install via pip install allen-bradley-toolkit. The package is failing with the following reason.
The problem seems to related to the fact that pip is trying to install 1.0a1.post0 instead of the latest release version 2.0.0. Does anyone have any ideas on what to do about this. Perhaps there is something wrong in my deployment script. You can view the Github Library here to see how I am deploying to PyPi.
There is an issue opened on the GitHub Tracker #2 that you can also reference for more info.
NOTE: The package seems to install fine on my win10 machine. But I am unable to get it to install on a win7 VM.
Ive also tried installing with the following commands:
pip install --no-cache-dir allen-bradley-toolkit
pip install allen-bradley-toolkit==2.0.0 -> this ones throws a 'doesnt exist error`
At https://pypi.python.org/pypi/allen-bradley-toolkit/2.0.0 I see that the wheel is only available for Python 3. You're trying to install it with Python 2.7.
To publish a universal wheel (suitable for both Py2 and Py3) you need to set
[bdist_wheel]
universal = 1
in setup.cfg or run
python setup.py bdist_wheel --universal
The 2nd line of the output has a clue to the problem - "Using cached ..."
You can skip the cache using the --skip-cache --no-cache-dir option to pip install or request an upgrade using the -U option
edit: updated comment with the correct option (although, seems like that wasn't the problem in this specific case).

Installing Cython/Statsmodels

I can not for the life of me figure out how to install the package statsmodels for Python 3. It feels like I've tried everything, but nothing is working.
Goal: import statsmodels in python
I start with:
pip install statsmodels
Main error messages:
Failed bulding wheel for statsmodels.
Cython is required to compile statsmodels from a development branch.
Please install Cython or download a source release of statsmodels.
So I try:
pip install cython
Gives:
Requirement already satisfied: cython in c:users\XXX\appdata\roaming\python\python36\site-packages
I installed cython by installing anaconda. I have tried almost all answers I could find by basic googling. But things just don't seem to be working.
Instead of listing the input\output of what I have tried I now only show the first steps, but let me know if you want to see the output of any commands.
How do I continue from here? Any help is appreciated, I've been trying to fix this for several days now and I'm only getting frustrated.
Right now I'm trying:
easy_install cython
This seemed to work, but afterwards pip install statsmodels didn't work.
Command ... failed with error code 1.
I tried:
git clone https://github.com/statsmodels/statsmodels
cd statsmodels
pip install .
And failed with a bunch of errors.
I ran into this same problem lastnight trying to install statsmodels. Finally what worked was installing the Microsoft Visual C++ compiler for Python found here: https://www.microsoft.com/en-gb/download/details.aspx?id=44266 then installing statsmodels by doing pip install statsmodels. I had already installed Cython by using pip. Though I do realize that was for Python 2.7. There doesn't seem to be this compiler available for Python 3.
The main statsmodels on PyPI is very old and uses a nonstandard setup. The release candidate for 0.10.0 is out now, and I would strongly recommend you use this one. You can install it using
pip install statsmodels=0.10.0rc2 --pre
It has wheels for all of the major platforms (Win/OSX/Linux), so you shouldn't see issues related to Cython.
To install statsmodels under anaconda, use
conda install statsmodels
The package is available in the repository of anacondata in version 0.8.0 which is the latest on pip as of now.
anaconda is not "just" a Python installation, it also contains the conda package manager that can install pre-built packages from the main repository of anaconda or from other "channels". It is not advisable to install packages that are available from the anaconda channel with pip, in general.
A comment on the issue of Cython here: to use Cython, your computer needs also a "development environment", that is the availability of a C compiler, of the Python development headers, among others. The C compiler must be compatible with the version of Python for which Cython is installed.

Python 2.7 easy_install - the process cannot access the file because it is being used by another process error

Using Python I am trying to install a library called yappi through easy_install. However I am getting this error below on Windows 7 Command Shell:
I explored alternative installations. I tried previously 'pip install yappi' but this didn't work due to a separate error (can't build wheel) which is a separate question.
Try downloading the appropriate wheel from here.
Then use pip install [package].

Categories

Resources