Problem in installing cartopy package via pip - python

I tried to install cartopy with pip but it gives me the below error.Also I'm on Ubuntu 22.04.1 LTS.
...
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for cartopy
Failed to build cartopy
ERROR: Could not build wheels for cartopy, which is required to install pyproject.toml-based projects
I tried to install other versions but still get the same issue.

Related

Unable to install snowflake-sqlalchemy because of pyarrow and cmake

I am trying to install Snowflake SQLAlchemy with the command pip install snowflake-sqlalchemy but it fails to install because pyarrow wheels cannot be built (because cmake cannot be found).
error: command 'cmake' failed: No such file or directory
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for pyarrow
Failed to build pyarrow
ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects
I have tried installing cmake with pip install cmake and installing pyarrow with pip install pyarrow and neither have worked. I already installed the python connector with pip install snowflake-connector-python. I am using Python 3.11.1 on a Mac.
Seems like pyarrow is not compatible (even though the website says it is) with Python 3.11. Downgrading to Python 3.9 worked.

Struggling to Install Cartopy

I'm struggling to Install Cartopy from the Terminal and from Pycharm.
This is what I get as error message:
1 error generated.
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 Cartopy
ERROR: Could not build wheels for Cartopy, which is required to install pyproject.toml-based projects
Can someone please help with the problem. Thanks
I tried to Update the Pip Install
Here are two solutions since you didn't specify the OS you are using or the full error log.
If on a Linux and the error log is due to geos_c.h is not found.
Install the developer version of the geos library
sudo apt install libgeos-dev
as can be seen from here.
If you are on a mac or windows, you may use conda to install it. find the installation instruction miniconda here then
conda install -c conda-forge cartopy

Failed building wheel for psycopg2 (Windows 11)

I am building a Django project, and as I was installing the psycopg2(using virtual env), I kept getting an error.
Versions:
Django==4.1.2
Python==3.11.0
PIP==22.3
OS==Win11
Code:
(env) PS C:\Users\keiko\Desktop\project> pip install psycopg2
Error:
ERROR: Failed building wheel for psycopg2
Running setup.py clean for psycopg2
Failed to build psycopg2
Installing collected packages: psycopg2
Running setup.py install for psycopg2 ... error
note: This error originates from a subprocess, and is likely not a problem with pip.
error: legacy-install-failure
I have already tried the solutions I found on the internet like:
Install psycopg2-binary instead.
Code: pip install psycopg2-binary
Error: Failed building wheel for psycopg2-binary
Upgrade the wheel and setup tools
Code:
pip install --upgrade wheel
pip install --upgrade setuptools
pip install psycopg2
Install it with python
Code: python -m pip install psycopg2
ERROR: Failed building wheel for psycopg2
Install the Microsoft C++ Build Tools
... but still none of these solutions helped me. I'm really hoping to install the package(psycopg2) on my project, I've been stuck with this error for so long and I can't really find any solution to this. I hope someone can help me with this.

Installation error streamlit: Building wheel for pyarrow (pyproject.toml) ... error

I try to install metaploit, but every time I get errors and I can't get it to work.
During installation I get the following error code:
pip install --upgrade streamlit
(Deleted a lot of irrelevant information)
Building wheels for collected packages: pyarrow
Building wheel for pyarrow (pyproject.toml) ... error
error: subprocess-exited-with-error
× Building wheel for pyarrow (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [291 lines of output]
ModuleNotFoundError: No module named 'cmake'
error: command 'D:\\Eind Project Programming Final\\venv\\Scripts\\cmake.exe' 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 pyarrow
Failed to build pyarrow
ERROR: Could not build wheels for pyarrow, which is required to install pyproject.toml-based projects
I have already tried the following:
Re-install Pycharm and Python and install the 64 bit version. (Running no other python or program)
Tried different versions of the packages.
Deleted & Re-installed packages.
Finding a solution on google.
(Latest python, pycharm version and all the packages I updated to the lastest versions.)
Tried these commands:
pip uninstall streamlit
pip uninstall wheel
pip uninstall setuptools
pip uninstall pip
pip install --upgrade streamlit
pip install --upgrade matplotlib
pip install --upgrade setuptools
pip install --upgrade wheel
pip install --upgrade pyarrow
pip install --upgrade cmake
Are you using Python 3.11? Because in that case, it's described in this issue: pyarrow doesn't support Python 3.11 yet (here is the PR in pyarrow's github, it'll arrive in the next release). So either you simply wait until that is released, or you install Python 3.10 until then.
As of today, there is not pyarrow for Python 3.11 on wheel with precompiled binaries. That means you have two options:
Build it yourself which is quite a ride [pyarrow documentation]
Use pip with the nightly build [pyarrow documentation] which is reasonable:
pip install --extra-index-url https://pypi.fury.io/arrow-nightlies/ \
--prefer-binary --pre pyarrow
The main error here you are getting is,
No module named 'cmake'
While you have gotten to the depths of the problem and tried a few other solutions I wonder what this one returned as a result.
pip install --upgrade cmake
I tried to download cmake into a new virtualenvironment and it worked just fine. I would also suggest that you start a new environment start by building cmake and go along with whatever you are gonna install next.

Failed to install optbinning in python: ERROR: Could not build wheels for scs, which is required to install pyproject.toml-based projects

I've tried to install optbinning package in python using Jupyter Notebook, but got an error.
!pip install optbinning
ERROR: Could not build wheels for scs, which is required to install pyproject.toml-based projects
How to solve this issue?
This is due to the CVXPY dependency. On Windows, you might need Microsoft Build Tools and Cython. On Linux, Mac you should not encounter any issue if a C++ compiler is installed.

Categories

Resources