LightFM library install error on Sagemaker Notebook - python

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?

Related

Trying to install pycaret on anaconda

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.

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

why do I see this error when I try to install Openai Whisper

PS C:\> pip install git+https://github.com/openai/whisper.git
Collecting git+https://github.com/openai/whisper.git
Cloning https://github.com/openai/whisper.git to c:\users\minju\appdata\local\temp\pip-req-build-aaszmdk8
Running command git clone --filter=blob:none --quiet https://github.com/openai/whisper.git 'C:\Users\minju\AppData\Local\Temp\pip-req-build-aaszmdk8'
Resolved https://github.com/openai/whisper.git to commit 28769fcfe50755a817ab922a7bc83483159600a9
Preparing metadata (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py egg_info did not run successfully.
│ exit code: 1
╰─> [1 lines of output]
ERROR: Can not execute `setup.py` since setuptools is not available in the build environment.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.
note: This is an issue with the package mentioned above, not pip.
hint: See above for details.
It's via VS code, and I don't know what's the problem.
Both git and pip are operating fine.
How can I solve that?
You need setuptools installed in your environment. So try pip install setuptools in your terminal, and then retry your installation.

Unable to install pwn package for python

I am trying to install the pwn library on my MacBook Air (M2, 2022) but it's failing while building the wheel for unicorn. I'm using python version 3.10.6.
This is the command I'm using: python3 -m pip install --upgrade pwn
without the --upgrade part I still get the same error message.
If I replace pwn with pwntools I still get the same error message as well.
wtdcode stated in the GitHub issue:
"Due to the fact that GitHub doesn't provide an M1 CI (actions/runner-images#2187), there is no available PyPI release yet. You may build it by yourself."
So my question is, How do I build it myself?
error msg:
Building wheel for unicorn (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
running bdist_wheel
running build
Building C extensions
error: [Errno 2] No such file or directory: '/private/var/folders/6d/85dtjcrj57173csw50tk8r300000gn/T/pip-install-o33_11sd/unicorn_530dd415f77a40418edfdec7c2d599f2/../../include/unicorn'
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for unicorn
Running setup.py clean for unicorn
Successfully built psutil
Failed to build unicorn
Installing collected packages: unicorn, pyserial, pyelftools, rpyc, ropgadget, requests, python-dateutil, pysocks, psutil, pathlib2, packaging, mako, intervaltree, colored-traceback, paramiko, pwntools, pwn
Running setup.py install for unicorn ... error
error: subprocess-exited-with-error
× Running setup.py install for unicorn did not run successfully.
│ exit code: 1
╰─> [4 lines of output]
running install
running build
Building C extensions
error: [Errno 2] No such file or directory: '/private/var/folders/6d/85dtjcrj57173csw50tk8r300000gn/T/pip-install-o33_11sd/unicorn_530dd415f77a40418edfdec7c2d599f2/../../include/unicorn'
[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.
╰─> unicorn
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
Thank you for your help.
I have an M1 mac and had the same issue—nothing worked for me either, so I eventually just tried installing an older version of unicorn (if you do pip install unicorn== without specifying the version, you can list all of them), and tried different ones until one worked.
(For me, this was just downgrading to 2.0.0)
According to official pwntools documentation, you need building binutils from source. They did make things easy with homebrew:
brew install https://raw.githubusercontent.com/Gallopsled/pwntools-binutils/master/macos/binutils-$ARCH.rb
In order to be able to call the library from Python interpreter, an extra step for me was to use the virtualenv:
source /opt/homebrew/Cellar/pwntools/{PWNTOOLS_VERSION}/libexec/bin/activate

Issues installing python typedb-client on macOs m1 architecture

When I try to install the python typedb-client using pip, I get several errors concerning grpcio:
Building wheels for collected packages: grpcio
Building wheel for grpcio (setup.py) ... error
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> [21870 lines of output]
ASM Builds for BoringSSL currently not supported on: macosx-11.1-arm64
as well as many lines of:
...
distutils.errors.CompileError: command '/usr/bin/gcc' failed with exit code 1
...
This happens both on global installation and in conda environments...
After searching for grpcio installation issues on the M1 architecture, the solution for me was to prepend the following to the pip command:
export GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 export GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install typedb-client==2.9.0
in some cases, should you see ssl errors, you can extend that command to:
CFLAGS="-I /opt/homebrew/opt/openssl/include" LDFLAGS="-L /opt/homebrew/opt/openssl/lib" GRPC_PYTHON_BUILD_SYSTEM_OPENSSL=1 GRPC_PYTHON_BUILD_SYSTEM_ZLIB=1 pip install typedb-client==2.9.0
assuming that you have openssl install via homebrew. This tells pip where to look for appropriate headers and code to build the grpcio pip package.

Categories