Gettingerror: legacy-install-failure, while installing basemap - python

I am trying to install Basemap using pip, however at some point it reaches the 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
I do not really know what to do here, and I could not find anyone who encountered the same error. I have tried upgrading pip and setuptools, but they did not seem to help. What should I do?
P.S. I have been trying to install basemap for the past 4 days and I was not very sucessfull. If you know how to install it on MacOS, please hit me up! Thank you!

For Windows:
To install basemap you need to download the wheel file from this path:
https://www.lfd.uci.edu/~gohlke/pythonlibs/#basemap
for python 3.10 this will be the file:
basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl
Then you have to go to the folder where the above mentioned .whl file is saved and run this command from there:
pip install basemap‑1.3.2‑cp310‑cp310‑win_amd64.whl
For Mac OS please refer:
https://github.com/matplotlib/basemap/releases:
Make sure you have:
brew install geos
brew install matplotlib
brew install numpy
brew install proj
Add export GEOS_DIR="/user/local/Cellar/geos/3.10.2/" to your .bash profile and reload it via:
source ~/.bash_profile
git clone --depth 1 https://github.com/matplotlib/basemap.git
then in the basemap/packages/basemap directory
pip3 install
For Google Colab:
!sudo apt-get install libgeos-3.6.2
!sudo apt-get install libgeos-dev
!pip install git+https://github.com/matplotlib/basemap#subdirectory=packages/basemap

Related

How do I fix this error when trying to install pygraphviz

I am trying to install pygraphviz with these commands on Mac m1 Ventura 13.1:
conda install -c anaconda graphviz
brew install gmp
env "CFLAGS=-I/usr/local/include -L/usr/local/lib" pip install pycddlib
I get this error after running the last line:
In file included from pygraphviz/graphviz_wrap.c:154:
/Users/ismaeelbashir/miniforge3/envs/lnn/include/python3.9/Python.h:25:10: fatal error: 'stdio.h' file not found
#include <stdio.h>
^~~~~~~~~
1 error generated.
error: command '/opt/homebrew/opt/llvm/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: legacy-install-failure
× Encountered error while trying to install package.
╰─> pygraphviz
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
I am trying to install a python library inn https://github.com/IBM/LNN/#quickstart. and this commands were on the installation guide.
This error message suggests that there is a problem with the compiler finding the standard C library header file 'stdio.h'.
It seems to be an issue with the python installation environment and the package dependencies. Here are a few steps that you can try to resolve the issue:
Try updating the compiler
conda update clang
Try installing pygraphviz with a different version of Python:
conda create -n newenv python=3.8
conda activate newenv
pip install pygraphviz
3.Try installing pygraphviz without the "CFLAGS" environment variable:
pip install pygraphviz --no-use-pep517
If none of these solutions work, you might want to look into other potential solutions or raise an issue with the library's repository.

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

installing pandas-profiling error in python 3.10

I am trying to install pandas-profiling in python 3.10 using pychan installation package option. It is giving error. I tried the same using command prompt. Giviing the same error.
Few last lines of error are as below:
'-DCMAKE_LIBRARY_OUTPUT_DIRECTORY_RELEASE=C:\Users\admin\AppData\Local\Temp\pip-install-j19ut5x7\phik_da8a6ed5567b4ca3b73ac99e2a8c743e\build\lib.win-amd64-3.10\phik\lib']' returned non-zero exit status 1.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for phik
ERROR: Could not build wheels for phik, which is required to install pyproject.toml-based projects
Any suggestion to fix this issue.
I have previously encountered the same challenge and I could resolve it by doing the following two steps in exactly this order:
Update setuptools: based on your information provided you are using pip, therefore the command is the following one: pip install --upgrade setuptools
Now run the installation command (as provided by the official documentation: https://pypi.org/project/pandas-profiling/): pip install pandas-profiling
As an alternative, in case you are using Anaconda these two steps will be as follows:
Update setuptools: conda upgrade setuptools
Install pandas-profiling from Anaconda: conda install -c conda-forge pandas-profiling
Hope this helps!

Problem installing scikit-survival in Google Colab

I am facing a problem to install scikit-survival in Google Colaboratory. Everytime it says:
pip install scikit-survival
Collecting scikit-survival
Using cached https://files.pythonhosted.org/packages/91/f0/047ce90bb831ab34ca287d1d23f0c61b6546cd89494566898c0e17516990/scikit-survival-0.15.0.post0.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Command errored out with exit status 1: /usr/bin/python3 /usr/local/lib/python3.7/dist-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /tmp/tmpncdknf_f Check the logs for full command output.
However, I don't get the Error. I've installed the newest Python version and any other pip install command works. Does anyone has an idea?
Kind regards,
Hashriama
The error is with different versioning and something related to it. Try the following in Colab.
!pip install --upgrade pip
!pip uninstall --yes --quiet osqp
!pip install -U scikit-survival
This should do the job.

scikit_image library is not installing

I am trying to install scikit-image library in python 3.4.4on windows. I am using the following command:
pip install scikit-image
I am installing it in the following path
C:\Python34\Scripts
It's not working showing the following error:
Command "python setup.py egg_info" failed with error code 1 in C:\Users\Usman\AppData\Local\Temp\pip-build-utv6_a2u\scikit-image\
I tried also installing it through the .whl file,, but still it's not working.
Pip version is
pip 9.0.1
Please tell me what should I do?
Try to run one of the following and than try to install again the requested library.
pip install --upgrade setuptools or easy_install -U setuptools
As setuptools contains a lot of important files including egg files, it can cause problems when it's not updated\installed.

Categories

Resources