Problems with Install of Cartopy on Python3 MacOS - python-3.x

I have installed the latest versions of Proj and GEOS but still get the following error when Installing Cartopy. Proj and Geos installed fine and I double checked their install.
pip install Cartopy
Collecting Cartopy
Using cached https://files.pythonhosted.org/packages/e5/92/fe8838fa8158931906dfc4f16c5c1436b3dd2daf83592645b179581403ad/Cartopy-0.17.0.tar.gz
Installing build dependencies ... done
Getting requirements to build wheel ... error
ERROR: Complete output from command /Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/hn/gs9rm9416l72qbz4bsqd0w5r0000gn/T/tmp9zqrg2u1:
ERROR: setup.py:171: UserWarning: Unable to determine GEOS version. Ensure you have 3.3.3 or later installed, or installation may fail.
'.'.join(str(v) for v in GEOS_MIN_VERSION), ))
setup.py:227: UserWarning: Unable to determine Proj version. Ensure you have 4.9.0 or later installed, or installation may fail.
'.'.join(str(v) for v in PROJ_MIN_VERSION), ))
Proj version 0.0.0 is installed, but cartopy requires at least version 4.9.0.
ERROR: Command "/Library/Frameworks/Python.framework/Versions/3.7/bin/python3.7 /Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/pip/_vendor/pep517/_in_process.py get_requires_for_build_wheel /var/folders/hn/gs9rm9416l72qbz4bsqd0w5r0000gn/T/tmp9zqrg2u1" failed with error code 1 in /private/var/folders/hn/gs9rm9416l72qbz4bsqd0w5r0000gn/T/pip-install-yh57wjuy/Cartopy

I had the same issue, and fixed it on my machine by installing using conda instead of pip, which is what the project reccomends https://scitools.org.uk/cartopy/docs/latest/installing.html

Related

Installing dlib in Python

I want to install face_recognition for a project that I am about to start. However, face_recognition has a dependency on dlib and I don't know how to install that.
I entered pip install dlib, however, an error was thrown since it said that I needed to install CMake. Here is the error:
Using cached dlib-19.24.0.tar.gz (3.2 MB)
Preparing metadata (setup.py) ... done
Installing collected packages: dlib
DEPRECATION: dlib is being installed using the legacy 'setup.py install' method, because it does not have a 'pyproject.toml' and the 'wheel' package is not installed. pip 23.1 will enforce this behaviour change. A possible replacement is to enable the '--use-pep517' option. Discussion can be found at https://github.com/pypa/pip/issues/8559
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
╰─> [9 lines of output]
running install
C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.10_3.10.2544.0_x64__qbz5n2kfra8p0\lib\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
running build_py
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.
Thus, I tried to install CMake:
Collecting CMake
Using cached cmake-3.25.0-py2.py3-none-win_amd64.whl (32.6 MB)
Installing collected packages: CMake
WARNING: The scripts cmake.exe, cpack.exe and ctest.exe are installed in 'C:\Users\Emma\AppData\Local\Packages\PythonSoftwareFoundation.Python.3.10_qbz5n2kfra8p0\LocalCache\local-packages\Python310\Scripts' which is not on PATH.
Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed CMake-3.25.0
However, when I tried to install dlib again, I got the same error even though I installed CMake successfully.
How could I install dlib now? For reference, I am using a Windows 10 or 11 system, and Python 3.11 64-bit.
Update/Install Visual C++
Maybe try installing/updating Visual C++. Because this is necessary for CMake to run. You can install it from here, https://visualstudio.microsoft.com/thank-you-downloading-visual-studio/?sku=Community&rel=15#
Installation with Wheel File
Run this:
pip install https://pypi.python.org/packages/da/06/bd3e241c4eb0a662914b3b4875fc52dd176a9db0d4a2c915ac2ad8800e9e/dlib-19.7.0-cp36-cp36m-win_amd64.whl#md5=b7330a5b2d46420343fbed5df69e6a3f
Installation from Internet
Install CMake from https://cmake.org/download/
Run this,
set PATH="%PATH%;C:\Program Files\CMake\bin
to add CMake to your path. You can also do this manually by Editing The Environment Variables.
3)Download the following,
https://pypi.org/project/dlib/#files.
In the specified folder in which you extracted the install files run the following,
python setup.py install.

Problem in importing tensorflow_data_validation

I tried to import and use the tensorflow_data_validation library, but I faced this error:
ContextualVersionConflict: (google-api-core 1.25.1 (c:\users\amoosi\anaconda3\lib\site-packages), Requirement.parse('google-api-core[grpc]!=2.0.*,!=2.1.*,!=2.2.*,!=2.3.0,<3.0.0dev,>=1.31.5'), {'google-cloud-bigquery-storage'})
I'm using Python 3.9.12
The error is telling you that the package google-api-core has a version conflict with the package google-cloud-bigquery-storage.
The current installed version of google-api-core is 1.25.1, and the error is giving you a list of the accepted versions, which are above the one that you have.
To update type this in a terminal:
pip install --upgrade google-api-core

pip3 Install delta-lake-reader[aws] fails on MacOS Mojave

I am trying to install delta-lake-reader[aws] on my MacBook Pro with MacOS Mojave and it is failing. I have Python 3.9.1 installed on my laptop.
$ pip3 install delta-lake-reader[aws]
Collecting delta-lake-reader[aws]
Using cached delta_lake_reader-0.2.2-py3-none-any.whl (7.4 kB)
Collecting pyarrow<3.0.0,>=2.0.0
Using cached pyarrow-2.0.0.tar.gz (58.9 MB)
Installing build dependencies ... |
After that it hangs for a while, then fails with a lot of errors, and finally, it gives the following output before ending:
ERROR: Cannot install delta-lake-reader[aws]==0.1.0, delta-lake-reader[aws]==0.1.1, delta-lake-reader[aws]==0.2.1 and delta-lake-reader[aws]==0.2.2 because these package versions have conflicting dependencies.
The conflict is caused by:
delta-lake-reader[aws] 0.2.2 depends on pyarrow<3.0.0 and >=2.0.0
delta-lake-reader[aws] 0.2.1 depends on pyarrow<3.0.0 and >=2.0.0
delta-lake-reader[aws] 0.1.1 depends on pyarrow<3.0.0 and >=2.0.0
delta-lake-reader[aws] 0.1.0 depends on pyarrow<3.0.0 and >=2.0.0
To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict
ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/user_guide/#fixing-conflicting-dependencies
$
I tried uninstalling pyarrow but it installs 3.0.0 again and fails the same way.
How can I overcome this?
The problem lays in the explicit dependency, that doesn't include pyarrow 3.0.0, but requires 2.x.x version. And pyarrow 2.x.x is not compatible with Python 3.9, that's why your build fails, but it works with Python 3.8, I was able to install it with pip3.8 install 'delta-lake-reader[aws]==0.2.2'. So you have following choice:
Use Python 3.8
Download repository, and make change in the pyproject.toml to use pyarrow 3.0.0, and after that use poetry tool to build wheel
File issue in the project, and wait until author fixes it.
If you don't need additional functionality, then you can use official Delta Lake python package that could be installed with pip install deltalake command

Unable to build opencv-python with python 3.8

OS:ubuntu
I am able to install opencv-python from the command line. However,when I tried to install my self-built package with opencv-python dependencies, it failed to biuld:
Building wheels for collected packages: opencv-python
Building wheel for opencv-python (PEP 517): started
Building wheel for opencv-python (PEP 517): finished with status 'error'
ERROR: Complete output from command /usr/local/bin/python /usr/local/lib/python3.6/site-packages/pip/_vendor/pep517/_in_process.py build_wheel /tmp/tmp7jntqv2r:
ERROR: Not searching for unused variables given on the command line.
CMake Error: CMake was unable to find a build program corresponding to "Ninja". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-utbicth7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
Not searching for unused variables given on the command line.
CMake Error: CMake was unable to find a build program corresponding to "Unix Makefiles". CMAKE_MAKE_PROGRAM is not set. You probably need to select a different build tool.
-- Configuring incomplete, errors occurred!
See also "/tmp/pip-install-utbicth7/opencv-python/_cmake_test_compile/build/CMakeFiles/CMakeOutput.log".
-- Trying "Unix Makefiles" generator - failure
--------------------------------------------------------------------------------
********************************************************************************
scikit-build could not get a working generator for your system. Aborting build.
Building Linux wheels for Python 3.6 requires a compiler (e.g gcc).
It can be installed using debian package manager:
sudo apt-get install build-essential
To build compliant wheels, consider using the manylinux system described in PEP-513.
Get it with "dockcross/manylinux-x64" docker image:
https://github.com/dockcross/dockcross#readme
For more details, please refer to scikit-build documentation:
http://scikit-build.readthedocs.io/en/latest/generators.html#linux
********************************************************************************
----------------------------------------
ERROR: Failed building wheel for opencv-python
I suspect issue is with scikit-build. I checked I have ninja, make/gcc all available. I set manually CMAKE_MAKE_PROGRAM=/usr/bin/make.
But still failed with same error. I
You are missing dependencies. Please see this part of the error message you have provided above:
Building Linux wheels for Python 3.6 requires a compiler (e.g gcc).
It can be installed using debian package manager:
sudo apt-get install build-essential
Therefore, please use apt-get to install the build tools required to build your package.
Run pip3 install -U pip before install opencv-python.
Finally figured out, when I installed locally I had a requirements with version 4.1.x and no issues. When I install with the dependencies, it fetches the latest version 4.4 and the issue is that 1) pip version is 19.1 and2) since 4.3 opencv, the wheels has been replaced.

How to install torch==0.3.1 in python=3.6

I am trying to install deepmatcher package in python 3.6. To let this package to run in python you need have a torch==0.3.1 version. So I am trying to install torch==0.3.1 by running :
pip install torch==0.3.1
Error during installation:
Collecting torch==0.3.1
ERROR: Could not find a version that satisfies the requirement torch==0.3.1 (from versions: 0.1.2, 0.1.2.post1)
ERROR: No matching distribution found for torch==0.3.1
I even tried installing it using "peterjc123" package but still unable to uninstall it.
torch 0.3.1 is not listed official anymore. To install torch 0.3.1 one can either build it by source or using a whl file for the specific version.
Using a whl file
whl files can be found here provided by pytorch
The downloaded file can then be installed with pip install [path to downloaded file]
Build by source
To build torch by source one can checkout the desired version via git
git checkout v[version number]
For torch==0.3.1 this would be git checkout v0.3.1
After this follow the install instructions provided by README.md
More information can be found at: https://pytorch.org/get-started/previous-versions/
check if you have right python installed for you os architecture or
create a virtual env using conda and then try installing its better this way

Resources