Trying to install pycaret on anaconda - python

I am trying to install pycaret on anaconda but I keep getting this error.
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> numpy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> See above for output.
Can someone please help me with that?
I tried using multiple prompts:
conda install -c conda-forge pycaret
pip install pycaret
I tried to install numpy seperately and got was able to do that sucessfuly but I got this message:
Collecting numpy
Using cached numpy-1.24.1-cp39-cp39-macosx_10_9_x86_64.whl (19.8 MB)
Installing collected packages: numpy
ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts.
smop 0.41b0 requires networkx, which is not installed.
smop 0.41b0 requires ply, which is not installed.
smop 0.41b0 requires pytest, which is not installed.
smop 0.41b0 requires scipy, which is not installed.
Successfully installed numpy-1.24.1
and so I installed all these packages and reinstalled numpy again. Afterwards, I tried to install pycaret again but the same error appeared. Keeping in mind that I have a mac laptop.

Related

Unable to install Flask - SQLAlchemy with pip (greenlet build error) - Windows, Venv

I am trying to install Flask-SQLAlchemy with pip install -U Flask-SQLAlchemy and I'm getting this error during greenlet's build, I put a "..." to skip all of the copying files etc:
× Running setup.py install for greenlet did not run successfully.
│ exit code: 1
╰─> [92 lines of output]
running install
D:\test\server\.venv\lib\python3.10\site-packages\setuptools\command\install.py:34: SetuptoolsDeprecationWarning: setup.py install is deprecated. Use build and pip and other standards-based tools.
warnings.warn(
running build
...
copying src\greenlet\tests\_test_extension_cpp.cpp -> build\lib.mingw_x86_64-cpython-310\greenlet\tests
running build_ext
building 'greenlet._greenlet' extension
error: --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64')
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> greenlet
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I'm on Windows 10, AMD processor, pip version 23.0, python3 version 3.10.7. The package installs fine globally and in WSL, but fails every time with this error within the virtual environment which I run with ..venv\bin\Activate.ps1. Any ideas on how to fix this, maybe this isn't on my end?
This error is indicating that the greenlet package is failing to build during the installation of Flask-SQLAlchemy. The error message mentions that the --plat-name must be one of ('win32', 'win-amd64', 'win-arm32', 'win-arm64'). This means that the platform you are building the greenlet package for must be specified.
One solution could be to try to install the package using a specific platform name, such as:
pip install --no-use-pep517 -U --plat-name=win-amd64 Flask-SQLAlchemy
It is possible that the win-amd64 platform name is not correct for your system, in which case you can try one of the other platform names in the list.
If this doesn't work, it could be due to a compatibility issue between greenlet and the version of Python you are using (3.10.7). Try to upgrade or downgrade your Python version and see if that resolves the issue.

LightFM library install error on Sagemaker Notebook

I was using LightFM library on Sagemaker Notebook without any issue before.
However, from yesterday, I started seeing this error message and could no longer complete installation (pip install lightfm)
Building wheels for collected packages: lightfm
Building wheel for lightfm (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [176 lines of output]
/home/ec2-user/anaconda3/envs/python3/lib/python3.10/site-packages/setuptools/dist.py:775: UserWarning: Usage of dash-separated 'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead
...
...
...
...
In file included from /home/ec2-user/anaconda3/envs/python3/include/python3.10/unicodeobject.h:1046:0,
from /home/ec2-user/anaconda3/envs/python3/include/python3.10/Python.h:83,
from lightfm/_lightfm_fast_openmp.c:20:
/home/ec2-user/anaconda3/envs/python3/include/python3.10/cpython/unicodeobject.h:551:42: note: declared here
Py_DEPRECATED(3.3) PyAPI_FUNC(PyObject*) PyUnicode_FromUnicode(
^~~~~~~~~~~~~~~~~~~~~
error: command '/usr/bin/gcc' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> lightfm
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I tried several suggestions I found from web, such as
pip install --upgrade pip
pip install --upgrade wheel
pip install --upgrade setuptools
pip install Cmake
pip install requests --no-dependencies
but none of these worked - still getting same error message.
How should I mitigate from this error?
This seems to be an issue with the lightfm package installation. Have you tried installing this in another environment? This can also be dependent on the notebook kernel you are using. Can you try installing in a virtual environment as well?

Trying to install selectorlib package in Python

I am trying to install a selectorlib package using:
Importing:
import selectorlib
Installing in terminal:
pip install selectorlib
And i get this error:
...
Building wheel for lxml (setup.py)
error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
[115 lines of output]
...
error: command '/usr/bin/clang' failed with exit code 1
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for lxml
Running setup.py clean for lxml
Failed to build lxml
Installing collected packages: lxml, cssselect, Click, parsel, selectorlib
Running setup.py install for lxml ... error
error: subprocess-exited-with-error
× Running setup.py install for lxml did not run successfully.
│ exit code: 1
...
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> lxml
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
...
Y tried different methods in order to install it:
Using different interpreters (Python 3.9.6; Python 3.10.9; Python 3.11.1)
Tried to install in VS Code and PyCharm CE
Tried to install different selectorlib versions. (Last 3)
Assuming you are working on a unix platform, lxml requires some C dependencies before it can be installed with pip.
You can check the official installation instructions.
Unless you are using a static binary distribution (e.g. from a Windows
binary installer), lxml requires libxml2 and libxslt to be installed,
in particular:
libxml2 version 2.9.2 or later.
libxslt version 1.1.27 or later.
We recommend libxslt 1.1.28 or later.
According to these instructions, you have to install the dependencies via
sudo apt-get install libxml2-dev libxslt-dev python-dev

I am running into errors installing a requirements.txt. The issue I am having is with pillow

I am relatively new to the world of coding and am mostly self taught. Currently I am working on a project via a repository from GitHub. One of the steps in working with the code is to install python dependencies via a requirements.txt
I am currently running into errors with pillow. I am working in windows, and currently have python 3.9.7 and conda 4.13.0. When I run the python -m pip install --upgrade -r requirements.txt i get errors as follows:
1) Building wheels for collected packages: pillow
Building wheel for pillow (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [189 lines of output]
C:\Users\kj\AppData\Local\Temp\pip-install-hsdc08bl\pillow_07ce73d2c2484297acb81cb082ed4b48\setup.py:29: RuntimeWarning: Pillow does not yet support Python 3.9 and does not yet provide prebuilt Windows binaries. We do not recommend building from source on Windows.
2) During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<string>", line 2, in <module>
File "<pip-setuptools-caller>", line 34, in <module>
File "C:\Users\kj\AppData\Local\Temp\pip-install-hsdc08bl\pillow_07ce73d2c2484297acb81cb082ed4b48\setup.py", line 888, in <module>
raise RequiredDependencyException(msg)
__main__.RequiredDependencyException:
The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pillow
3) Running setup.py clean for pillow
Failed to build pillow
Installing collected packages: pillow, h5py, pandas, matplotlib, sklearn, scikit-image
Attempting uninstall: pillow
Found existing installation: Pillow 9.1.1
Uninstalling Pillow-9.1.1:
Successfully uninstalled Pillow-9.1.1
Running setup.py install for pillow ... error
error: subprocess-exited-with-error
× Running setup.py install for pillow did not run successfully.
│ exit code: 1
╰─> [193 lines of output]
C:\Users\kj\AppData\Local\Temp\pip-install-hsdc08bl\pillow_07ce73d2c2484297acb81cb082ed4b48\setup.py:29: RuntimeWarning: Pillow does not yet support Python 3.9 and does not yet provide prebuilt Windows binaries. We do not recommend building from source on Windows.
4) The headers or library files could not be found for zlib,
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
WARNING: No metadata found in c:\programdata\anaconda3\lib\site-packages
Rolling back uninstall of pillow
Moving to c:\programdata\anaconda3\lib\site-packages\pil\
from C:\ProgramData\Anaconda3\Lib\site-packages\~il
Moving to c:\programdata\anaconda3\lib\site-packages\pillow-9.1.1.dist-info\
from C:\ProgramData\Anaconda3\Lib\site-packages\~illow-9.1.1.dist-info
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> pillow
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
These are all the errors I get when I run the install of requirements.txt. I have done some research on my own before looking for help as there are similar questions I have come across. One issue is that pillow does not yet support python 3.9. However, on pillows readthedoc it claims that python 3.9 is supported by pillow >=9.0, and I have pillow 9.1.1 installed. Another issue I see is the headers or library files could not be found for zlib, yet I have used conda install -c anaconda zlib.
To reiterate, I am relatively still a beginner with code. I would appreciate any friendly advice with my current issues.
Thank you
When installing this library, pip tried to find a pre-compiled binary (bdist_wheel) but couldn't find one that matches your python version and OS. So it tried to build it from source, but you don't have zlib installed on your machine. zlib is another program that is used in the python build process. You can install it for windows from here, or I think it is bundled with Python if you install Python using the "Full Installer" as described here: https://docs.python.org/3/using/windows.html

Getting install package leads to PyCrypto error while installing Python libraries?

I'm trying to install smartapi Python library
pip install smartapi
But it's throw error.....
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> PyCrypto
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
error image:
My Python version is 3.10.2 and my pip version is 22.0.3
PyCrypto is no longer supported. See https://stackoverflow.com/a/69516560/7976758 and https://stackoverflow.com/a/58077358/7976758 .
SmartAPI requires Python 2 (see the bottom of the left column). Try Python 2.7. Or find out a different package.

Categories