Error when trying to install cartopy python Anaconda - python

I am trying to install cartopy in my Anaconda installation, but it won't work. Here are the error messages. How do I get this package to install? I tried installing using
pip install cartopy
and
conda install -c conda-forge cartopy
Both give these errors:
Building wheels for collected packages: cartopy
Building wheel for cartopy (PEP 517): started
Building wheel for cartopy (PEP 517): finished with status 'error'
Failed to build cartopy
ERROR: Command errored out with exit status 1:
command: 'C:\Users\ruben\anaconda3\python.exe' 'C:\Users\ruben\anaconda3\lib\site-
packages\pip\_vendor\pep517\in_process\_in_process.py' build_wheel 'C
<string>:117: UserWarning: Unable to determine GEOS version. Ensure you have 3.7.2 or
later installed, or installation may fail.
Fobuild\temp.win-amd64-cpython-39\Release\lib/cartopy/trace.obj
trace.cpp
lib/cartopy/trace.cpp(719): fatal error C1083: Cannot open include file: 'geos_c.h': No
such file or directory
error: command 'C:\\Program Files\\Microsoft Visual
Studio\\2022\\Community\\VC\\Tools\\MSVC\\14.31.31103\\bin\\HostX86\\x64\\cl.exe' failed
with exit code 2
----------------------------------------
ERROR: Failed building wheel for cartopy
ERROR: Could not build wheels for cartopy which use PEP 517 and cannot be installed
directly
Anaconda gives me these errors:
conda install cartopy
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: |
Now it just sits there are spins.
I have the geos package installed. I don't knw why it can't find the installation.

This solved it for me in a Linux Mint system. I can see that OP's system is Windows, so not sure if it'll work for them also. But for folks on ubuntu/linux landing here,
We need to have libgeos-dev installed first:
sudo apt install libgeos-dev
got this from https://techoverflow.net/2021/08/13/6348/ .
This seems to provide the 'geos_c.h' file mentioned.
After this, pip install cartopy worked properly for me.

Related

Failed to build scikit-image==0.16.2 on virtualenv

pip3.9 install scikit-image==0.16.2 , building wheel for scikit-image (setup.py) face an error :
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed building wheel for scikit-image
Running setup.py clean for scikit-image
Failed to build scikit-image
Installing collected packages: scikit-image
Running setup.py install for scikit-image ... |.
** error:** legacy-install-failure
× Encountered error while trying to install package.
╰─> scikit-image
I am trying to install package 'PREDICT' that 'scikit-image' is considered as one of it's requirements.
This packages are installed on .venv

How to solve setup.py error during install dlib in Python

How could i solve this error i tried many ways to instal cmake installed succesfully but the dlib getting error everytime to install
c++ and visiual studio also installed
C:\Users\Admin>pip install dlib
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'ReadTimeoutError("HTTPSConnectionPool(host='pypi.org', port=443): Read timed out. (read timeout=15)")': /simple/dlib/
Collecting dlib
Using cached dlib-19.24.0.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... done
Using legacy 'setup.py install' for dlib, since package 'wheel' is not installed.
Installing collected packages: dlib
Running setup.py install for dlib ... error
error: subprocess-exited-with-error
× Running setup.py install for dlib did not run successfully.
│ exit code: 1
╰─> [8 lines of output]
running install
running build
running build_py
package init file 'tools\python\dlib_init_.py' not found (or not a regular file)
running build_ext
ERROR: CMake must be installed to build dlib
[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.
╰─> dlib
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
C:\Users\Admin>install wheel
'install' is not recognized as an internal or external command,
operable program or batch file.
Sometimes we need to manage the Windows PATH environment for CMake.
For checking whether the PATH has already been added or not, you can go to Environment Variables on Windows by going to This PC > Properties > Advance system settings. Then, go to Tab Advanced and click on Environment Variables.
And then click Edit, if there is no CMake path. You must make a new one.
For a more detailed answer refer: Installing Cmake in Windows
Thanks.

How can I solve problems installing packages in python (Failed building wheels)?

I'm trying to install several packages in Google Colab (python 3.7) and I find some errors.
The packages I'm installing are:
pillow==4.2.1
numpy==1.16.1
pandas==0.20.3
scipy==0.19.1
scikit-image==0.13.0
scikit-learn==0.19.1
matplotlib==2.2.2
tensorflow==1.2.1
concurrent-iterator==0.2.6
At first, I do:
!pip install --upgrade pip setuptools wheel
Then, I do the next (it is an example of one package):
!pip install pillow==4.2.1
But whit packages 4, 5 and 6 I found the next error:
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting scipy==0.19.1
Using cached scipy-0.19.1.tar.gz (14.1 MB)
Preparing metadata (setup.py) ... done
Building wheels for collected packages: scipy
error: subprocess-exited-with-error
× python setup.py bdist_wheel did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Building wheel for scipy (setup.py) ... error
ERROR: Failed building wheel for scipy
Running setup.py clean for scipy
error: subprocess-exited-with-error
× python setup.py clean did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
ERROR: Failed cleaning build dir for scipy
Failed to build scipy
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
Installing collected packages: scipy
Attempting uninstall: scipy
WARNING: Ignoring invalid distribution -andas (/usr/local/lib/python3.7/dist-packages)
Found existing installation: scipy 1.4.1
Uninstalling scipy-1.4.1:
Successfully uninstalled scipy-1.4.1
error: subprocess-exited-with-error
× Running setup.py install for scipy did not run successfully.
│ exit code: 1
╰─> See above for output.
note: This error originates from a subprocess, and is likely not a problem with pip.
Running setup.py install for scipy ... error
WARNING: No metadata found in /usr/local/lib/python3.7/dist-packages
Rolling back uninstall of scipy
Moving to /usr/local/lib/python3.7/dist-packages/scipy-1.4.1.dist-info/
from /usr/local/lib/python3.7/dist-packages/~cipy-1.4.1.dist-info
Moving to /usr/local/lib/python3.7/dist-packages/scipy/
from /usr/local/lib/python3.7/dist-packages/~cipy
error: legacy-install-failure
× Encountered error while trying to install package.
╰─> scipy
note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.
After that, the version installed is the default in Google Colab, not the one I want.
I found this error only with packages 4, 5 and 6 and, after looking for information on internet, i didn't find a solution. I can't install modern versions because I need those in particular.

Error in pip install transformers: Building wheel for tokenizers (pyproject.toml): finished with status 'error'

I'm building a docker image on cloud server via the following docker file:
# base image
FROM python:3
# add python file to working directory
ADD ./ /
# install and cache dependencies
RUN pip install --upgrade pip
RUN pip install RUST
RUN pip install transformers
RUN pip install torch
RUN pip install slack_sdk
RUN pip install slack_bolt
RUN pip install pandas
RUN pip install gensim
RUN pip install nltk
RUN pip install psycopg2
RUN pip install openpyxl
......
When installing the transformers package, the following error occurs:
STEP 5: RUN pip install transformers
Collecting transformers
Downloading transformers-4.15.0-py3-none-any.whl (3.4 MB)
Collecting filelock
......
Downloading click-8.0.3-py3-none-any.whl (97 kB)
Building wheels for collected packages: tokenizers
Building wheel for tokenizers (pyproject.toml): started
ERROR: Command errored out with exit status 1:
command: /usr/local/bin/python /usr/local/lib/python3.10/site-packages/pip/_vendor/pep517/in_process/_in_process.py build_wheel /tmp/tmp_3y7hw5q
cwd: /tmp/pip-install-bsy5f4da/tokenizers_e09b9f903acd40f0af4a997fe1d8fdb4
Complete output (50 lines):
running bdist_wheel
......
copying py_src/tokenizers/trainers/__init__.pyi -> build/lib.linux-x86_64-3.10/tokenizers/trainers
copying py_src/tokenizers/tools/visualizer-styles.css -> build/lib.linux-x86_64-3.10/tokenizers/tools
running build_ext
error: can't find Rust compiler
If you are using an outdated pip version, it is possible a prebuilt wheel is available for this package but pip is not able to install from it. Installing from the wheel would avoid the need for a Rust compiler.
To update pip, run:
pip install --upgrade pip
and then retry package installation.
If you did intend to build this package from source, try installing a Rust compiler from your system package manager and ensure it is on the PATH during installation. Alternatively, rustup (available at https://rustup.rs) is the recommended way to download and update the Rust compiler toolchain.
----------------------------------------
ERROR: Failed building wheel for tokenizers
ERROR: Could not build wheels for tokenizers, which is required to install pyproject.toml-based projects
Building wheel for tokenizers (pyproject.toml): finished with status 'error'
Failed to build tokenizers
subprocess exited with status 1
subprocess exited with status 1
error building at STEP "RUN pip install transformers": exit status 1
time="2022-01-18T07:24:56Z" level=error msg="exit status 1"
Dockerfile build failed - exit status 1exit status 1
I'm not very sure about what's happening here. Can anyone help me? Thanks in advance.
The logs say
error: can't find Rust compiler
You need to install a rust compiler. See https://www.rust-lang.org/tools/install. You can modify the installation instructions for a docker image like this (from https://stackoverflow.com/a/58169817/5666087):
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
Just use a clean python=3.8 environment and try again.

Flask-SimpleLDAP failing to install because of python-ldap prerequisite failure (Windows Active Directory)

I'm trying to install Flask-SimpleLDAP on a Windows machine so I can use Active Directory for authentication for a Dash app I have created.
I'm following this article - https://towardsdatascience.com/a-simple-way-to-integrate-dash-with-ldap-4d5d059ee3a6
The install is failing when it tries to build the wheel for "python-ldap", with the errors:
Building wheel for python-ldap (setup.py) ... error
ERROR: Command errored out with exit status 1:
C:\Users\canderson\AppData\Local\Temp\pip-install-zixltin3\python-ldap\Modules\common.h(15): fatal error C1083: Cannot open include file: 'lber.h': No such file or directory
error: command 'C:\\Program Files (x86)\\Microsoft Visual Studio\\2019\\Community\\VC\\Tools\\MSVC\\14.29.30133\\bin\\HostX86\\x64\\cl.exe' failed with exit status 2
----------------------------------------
ERROR: Failed building wheel for python-ldap
I tried installing with both pip and pip3 with the same result, using the commands:
pip3 install flask-simpleldap
pip install flask-simpleldap
As a workaround I tried installing python3-ldap which installed no problem though it didn't help with the install of Flask-SimpleLDAP as the original (python-ldp) package is bundled into the install.
Do any of you know of a workaround for this or if there is another more freidnly version of Flask-SimpleLDAP available?

Categories

Resources