Cannot install mapping for python 2 (ERROR: No matching distribution found for oldest-supported-numpy) - python-2.7

I have a strange problem, being unable to install Mapping library for python 2 via pip. Have the following error:
ERROR: Command errored out with exit status 1:
command: /home/pavloh/miniconda3/envs/deezer2/bin/python2.7 /home/pavloh/miniconda3/envs/deezer2/lib/python2.7/site-packages/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-eWQJap/overlay --no-warn-script-location --no-binary :none: --only-binary :none: -i https://pypi.org/simple -- wheel setuptools oldest-supported-numpy
cwd: None
Complete output (7 lines):
DEPRECATION: Python 2.7 reached the end of its life on January 1st, 2020. Please upgrade your Python as Python 2.7 is no longer maintained. pip 21.0 will drop support for Python 2.7 in January 2021. More details about Python 2 support in pip, can be found at https://pip.pypa.io/en/latest/development/release-process/#python-2-support
Collecting wheel
Using cached wheel-0.37.1-py2.py3-none-any.whl (35 kB)
Collecting setuptools
Using cached setuptools-44.1.1-py2.py3-none-any.whl (583 kB)
ERROR: Could not find a version that satisfies the requirement oldest-supported-numpy (from versions: none)
ERROR: No matching distribution found for oldest-supported-numpy
The numpy in installed in the environment:
_libgcc_mutex 0.1 conda_forge conda-forge
_openmp_mutex 4.5 2_gnu conda-forge
ca-certificates 2022.9.24 ha878542_0 conda-forge
certifi 2019.11.28 py27h8c360ce_1 conda-forge
httplib2 0.20.4 pypi_0 pypi
ld_impl_linux-64 2.36.1 hea4e1c9_2 conda-forge
libffi 3.2.1 he1b5a44_1007 conda-forge
libgcc-ng 12.1.0 h8d9b700_16 conda-forge
libgomp 12.1.0 h8d9b700_16 conda-forge
libsqlite 3.39.4 h753d276_0 conda-forge
libstdcxx-ng 12.1.0 ha89aaad_16 conda-forge
libzlib 1.2.12 h166bdaf_4 conda-forge
ncurses 6.3 h27087fc_1 conda-forge
openssl 3.0.5 h166bdaf_2 conda-forge
pip 20.1.1 pyh9f0ad1d_0 conda-forge
pyparsing 2.4.7 pypi_0 pypi
python 2.7.18 h02575d3_0
python_abi 2.7 1_cp27mu conda-forge
readline 8.1.2 h0f457ee_0 conda-forge
setuptools 44.0.0 py27_0 conda-forge
sqlite 3.39.4 h4ff8645_0 conda-forge
tk 8.6.12 h27826a3_0 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
zlib 1.2.12 h166bdaf_4 conda-forge
Can someone advise on an issue?

oldest-supported-numpy doesn't work with Python 2.7. Even the oldest release 0.1 (Nov 26, 2019) requires Python >= 3.5.
But Mapping doesn't depend on oldest-supported-numpy, it requires just numpy. Perhaps oldest-supported-numpy is in your requirements.txt? Remove it or replace with just numpy.

Related

Conda - import Geopandas error: DLL load failed: The application has failed to start because its side-by-side configuration is incorrect

I'm trying to import the Geopandas module using Python 2.7. Example commands below:
conda create --channel conda-forge -n env_test python=2.7 geopandas
# OK
conda activate py27env
python --version
Python 2.7.15
# Import the module now.
python
import geopandas
Full error stack:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Administrator\miniconda3\envs\env_test\lib\site-
packages\geopandas\__init__.py", line 5, in <module>
from geopandas.io.file import read_file # noqa
File "C:\Users\Administrator\miniconda3\envs\env_test\lib\site-packages\geopandas\io\file.py",
line 6, in <module>
import fiona
File "C:\Users\Administrator\miniconda3\envs\env_test\lib\site-packages\fiona\__init__.py",
line 69, in <module>
from fiona.collection import Collection, BytesCollection, vsi_path
File "C:\Users\Administrator\miniconda3\envs\env_test\lib\site-packages\fiona\collection.py",
line 9, in <module>
from fiona.ogrext import Iterator, ItemsIterator, KeysIterator
ImportError: DLL load failed: The application has failed to start because its side-by-side
configuration is incorrect. Please see the application event log or use the command-line
sxstrace.exe tool for more detail.
Is there way to fix this issue?
Using:
Miniconda 4.12.0
Output of Conda list:
# Name Version Build Channel
boost-cpp 1.70.0 h099cdad_2 conda-forge
ca-certificates 2022.6.15 h5b45459_0 conda-forge
certifi 2019.11.28 py27h8c360ce_1 conda-forge
click 7.1.2 pyh9f0ad1d_0 conda-forge
click-plugins 1.1.1 py_0 conda-forge
cligj 0.7.2 pyhd8ed1ab_1 conda-forge
curl 7.65.3 h2f83ebf_0 conda-forge
enum34 1.1.10 py27h8c360ce_1 conda-forge
expat 2.2.9 h2880e7c_2 conda-forge
fiona 1.7.13 py27_0 conda-forge
freexl 1.0.5 haa51a25_1002 conda-forge
gdal 2.2.2 py27h58389d3_1
geopandas 0.6.3 py_0 conda-forge
geos 3.6.2 heec837b_2
hdf4 4.2.13 ha32470c_1003 conda-forge
hdf5 1.10.1 vc9_2 conda-forge
intel-openmp 2022.1.0 h57928b3_3787 conda-forge
jpeg 9c h0c8e037_1001 conda-forge
kealib 1.4.7 vc9_4 conda-forge
krb5 1.16.4 h7fea353_0 conda-forge
libblas 3.9.0 8_mkl conda-forge
libcblas 3.9.0 8_mkl conda-forge
libcurl 7.65.3 h2f83ebf_0 conda-forge
libgdal 2.2.2 h75964b3_1
libiconv 1.15 h0c8e037_1006 conda-forge
libkml 1.3.0 h59e3451_1010 conda-forge
liblapack 3.9.0 8_mkl conda-forge
libnetcdf 4.4.1.1 vc9_10 conda-forge
libpng 1.6.37 h7a46e7a_0 conda-forge
libpq 11.5 h5e4800f_1 conda-forge
libspatialindex 1.8.5 h2880e7c_4 conda-forge
libspatialite 4.3.0a he01c9b4_1023 conda-forge
libssh2 1.8.2 hd5c6ab6_2 conda-forge
libtiff 4.0.10 h52ad3ab_1002 conda-forge
libxml2 2.9.10 h00b1425_0 conda-forge
mkl 2020.4 hb70f87d_311 conda-forge
munch 2.5.0 py_0 conda-forge
numpy 1.16.5 py27h0d21db5_0 conda-forge
openjpeg 2.3.1 hb90df43_1 conda-forge
openssl 1.1.1e h0c8e037_0 conda-forge
pandas 0.24.2 py27h0e003f4_0 conda-forge
pip 20.1.1 pyh9f0ad1d_0 conda-forge
proj4 4.9.3 h0c8e037_9 conda-forge
pyproj 1.9.5.1 py27he834874_1006 conda-forge
python 2.7.15 h2880e7c_1011_cpython conda-forge
python-dateutil 2.8.1 py_0 conda-forge
python_abi 2.7 1_cp27m conda-forge
pytz 2020.1 pyh9f0ad1d_0 conda-forge
rtree 0.8.3 py27_0
setuptools 44.0.0 py27_0 conda-forge
shapely 1.6.4 py27hc31c106_1000 conda-forge
six 1.16.0 pyh6c4a22f_0 conda-forge
sqlite 3.30.1 h0c8e037_0 conda-forge
tk 8.6.10 h0c8e037_0 conda-forge
vc 9 h2eaa2aa_6
vs2008_runtime 9.0.30729.6161 0 conda-forge
wheel 0.37.1 pyhd8ed1ab_0 conda-forge
wincertstore 0.2 py27_1003 conda-forge
xerces-c 3.2.2 hc56fc5f_1004 conda-forge
xz 5.2.4 h3cc03e0_1001 conda-forge
zlib 1.2.11 h3cc03e0_1006 conda-forge
zstd 1.3.3 vc9_1 conda-forge
System OS is Windows Server 2019, but I have also tested on a Windows 10 workstation. Same error occurs when importing Geopandas. The issue is not present when using a newer version of Python, for example Python 3.9.

AWS CLI v2 does not pick environment variables

I've installed AWS CLI v2 via conda (macOS):
~ ❯ conda list
# packages in environment at /Users/opal/miniconda3/envs/whatever:
#
# Name Version Build Channel
awscliv2 1.5.2 pyhd8ed1ab_0 conda-forge
ca-certificates 2020.12.5 h033912b_0 conda-forge
certifi 2020.12.5 py37hf985489_1 conda-forge
colorama 0.4.3 pypi_0 pypi
libcxx 11.1.0 habf9029_0 conda-forge
libffi 3.3 h046ec9c_2 conda-forge
ncurses 6.2 h2e338ed_4 conda-forge
openssl 1.1.1k h0d85af4_0 conda-forge
pip 21.1.1 pyhd8ed1ab_0 conda-forge
python 3.7.10 h7728216_100_cpython conda-forge
python_abi 3.7 1_cp37m conda-forge
pyyaml 5.4.1 pypi_0 pypi
readline 8.1 h05e3726_0 conda-forge
setuptools 49.6.0 py37hf985489_3 conda-forge
sqlite 3.35.5 h44b9ce1_0 conda-forge
tk 8.6.10 h0419947_1 conda-forge
wheel 0.36.2 pyhd3deb0d_0 conda-forge
xz 5.2.5 haf1e3a3_1 conda-forge
zlib 1.2.11 h7795811_1010 conda-forge
~ ❯ aws --version
1.5.0
AWS CLI v2 command: docker run -i --rm -v /Users/opal/.aws:/root/.aws -v /Users/opal:/aws amazon/aws-cli
aws-cli/2.2.3 Python/3.8.8 Linux/5.10.25-linuxkit docker/x86_64.amzn.2 prompt/off
I've no environment variables set and when I run:
~ ❯ aws sts get-caller-identity
Unable to locate credentials. You can configure credentials by running "aws configure"
which is as expected.
The problem is that when I export either AWS_PROFILE environment variable or AWS_ACCESS_KEY_ID or AWS_SECRET_ACCESS_KEY pair it works exactly the same. The only option to make it work is to pass the profile name via --profile switch.
What's the problem? Actually it's very annoying. It seems as if AWS CLI was unable to pick the values from environment variables.
I've set it on ZSH with oh-my-zsh.
EDIT
As far as I see/understand this command is run in a aws-cli docker container to which environment variables are not passed.

Use pip to manage two versions of python 2.7 on RHEL7

Goal: Have python 2.7.14 and python 3.6 on my RHEL server and use pip2/pip3 to manage both.
Note: Although this server lacks an internet connection, I can download them separately and upload them to this server.
I recently installed RHEL 7.2 on a VM, this installs python 2.7.5 by default.
I decided upgrade this by doing a parallel install of 2.7.14 (using make altinstall method and keeping the existing 2.7.5 intact). Also installed python 3.6 as I plan to port all my existing python code to it in the future.
The problem arises when I try to install pip for the Python 2.7.14 or any libraries (as you will see in a little bit).
I first did a easy_install of pip:
[root#VMW01 bin]# easy_install pip
Searching for pip
Best match: pip 9.0.1
Adding pip 9.0.1 to easy-install.pth file
Installing pip script to /usr/local/bin
Installing pip3 script to /usr/local/bin
Installing pip3.5 script to /usr/local/bin
Using /usr/local/lib/python3.6/site-packages
Processing dependencies for pip
Finished processing dependencies for pip
This installs pip for python 2.7.5 and 3.6 but not for python 2.7.14.
Next, I downloaded the get-pip.py:
This gets installed fine for python 2.7.5 but not for python 2.7.14:
[root#VMW01 pshah]# python get-pip.py
Collecting pip
Downloading pip-9.0.1-py2.py3-none-any.whl (1.3MB)
100% |████████████████████████████████| 1.3MB 978kB/s
Collecting wheel
Downloading wheel-0.30.0-py2.py3-none-any.whl (49kB)
100% |████████████████████████████████| 51kB 9.2MB/s
Installing collected packages: pip, wheel
Successfully installed pip-9.0.1 wheel-0.30.0
[root#VMW01 pshah]# /usr/local/bin/python2.7 get-pip.py
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Collecting pip
Could not fetch URL https://pypi.python.org/simple/pip/: There was a problem confirming the ssl certificate: Can't connect to HTTPS URL because the SSL module is not available. - skipping
Could not find a version that satisfies the requirement pip (from versions: )
No matching distribution found for pip
This seems like a lack of a SSL libray.
First, I did install this using yum:
[root#VMW01 pshah]# yum install openssl
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package 1:openssl-1.0.1e-42.el7_1.9.x86_64 already installed and latest version
Nothing to do
[root#VMW01 pshah]# yum install openssl-devel
Loaded plugins: langpacks, product-id, search-disabled-repos, subscription-manager
This system is not registered to Red Hat Subscription Management. You can use subscription-manager to register.
Package 1:openssl-devel-1.0.1e-42.el7_1.9.x86_64 already installed and latest version
Nothing to do
Second, this seems to be present for python 2.7.5
[root#VMW01 pshah]# python
Python 2.7.5 (default, Oct 11 2015, 17:47:16)
[GCC 4.8.3 20140911 (Red Hat 4.8.3-9)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import ssl
>>>
Am I overarching too much? Should I settle with the default installation of 2.7.5 and python 3.6?
I know virtualenv might be a solution here, but i'm not sure how I can make it work with Apache executing python scripts.
Thanks.
As it mentions here: https://pip.pypa.io/en/latest/installing I did a local install of pip but called the python executable for python 2.7.14.
Downloaded the .whl files for wheel, setuptools and pip and then ran the below:
[root#VMW01 pshah]# /usr/local/bin/python2.7 get-pip.py --no-index --find-link=.
Collecting pip
Collecting setuptools
Collecting wheel
Installing collected packages: pip, setuptools, wheel
Successfully installed pip-9.0.1 setuptools-36.5.0 wheel-0.30.0
I believe calling pip2.7 will install packages for the python 2.7.14 now.
Tested this by installing the xlrd library (Note - I had the xlrd tarball in the local directory):
[root#VMW01 pshah]# pip2.7 install xlrd-1.1.0.tar.gz
pip is configured with locations that require TLS/SSL, however the ssl module in Python is not available.
Processing ./xlrd-1.1.0.tar.gz
Building wheels for collected packages: xlrd
Running setup.py bdist_wheel for xlrd ... done
Stored in directory: /root/.cache/pip/wheels/b9/dc/43/e6acfa12bc48cdf3654dd7f44c66880548ea0322324bc6095f
Successfully built xlrd
Installing collected packages: xlrd
Successfully installed xlrd-1.1.0
[root#VMW01 pshah]# /usr/local/bin/python2.7
Python 2.7.14 (default, Oct 6 2017, 18:31:52)
[GCC 4.8.5 20150623 (Red Hat 4.8.5-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import xlrd
>>>

How to install BeautifulSoup4 to python3 on Mac

I have original Python 2.7.5 in /usr/bin/python, and I installed Python3 by downloading Python 3.5.1 package in /usr/local/bin/python3, then I installed BeautifulSoup4 as below:
sudo easy_install BeautifulSoup4
Searching for BeautifulSoup4
Best match: beautifulsoup4 4.4.1
Processing beautifulsoup4-4.4.1-py2.7.egg
beautifulsoup4 4.4.1 is already the active version in easy-install.pth
Using /Library/Python/2.7/site-packages/beautifulsoup4-4.4.1-py2.7.egg
Processing dependencies for BeautifulSoup4
Finished processing dependencies for BeautifulSoup4
This way that I can't use bs4 in python3, how can I install bs4 on python3?
You should use the pip3 executable:
sudo pip3 install beautifulsoup4
If you don't have the pip3 installed:
curl bootstrap.pypa.io/get-pip.py | python3

Installing pip in different versions of python

I have multiple versions of Python installed(2.5,2.7). I am using Ubuntu. Python2.7 is my default Python interpreter. So all packages like PIL is installed in python2.7. Now i want to install some packages in Python 2.5 version.
I need to install Pip so that i could install the packages. Now i do understand some would give the advice of virtualenv. I tried that too.
But installing Pil through that too doesn't show the packages in the python2.5 version. It installs it in python2.7 version. So i need to do something so that when pip installs the package it installs it in Python2.5 version. Any suggestions?
I also tried this:
python2 -m pip install SomePackage # default Python 2
python2.5 -m pip install SomePackage # specifically Python 2.5
but it says no module named pip
According to this answer: pip: dealing with multiple Python versions?
You have to try like this if pip >= 1.5:
$ pip2.5 install SomePackage
$ pip2.7 install SomePackage
Else:
$ pip-2.5 install SomePackage
$ pip-2.7 install SomePackage