Cythonizing sklearn/_isotonic.pyx failed - python-2.7

I'm trying to install the OCRF-Examples (https://github.com/ngoix/OCRF).
The installation instructions said:
conda create -n OCRF_env python=2.7 anaconda
source activate OCRF_env
conda install -n OCRF_env numpy scipy cython matplotlib
git clone https://github.com/ngoix/OCRF
cd OCRF
pip install --upgrade pip
pip install pyper
python setup.py install
I was able to run all the commands of the installation instructions without any problems - except for the last one:
python setup.py install
Here I got this error:
Cython is installed with the latest version (0.29.13) and no other Cython versions are installed.
If relevant: I already had Python 3.6.9 installed on my Macbook. Due to the OCRF installation, I now have Python 2.7. as additional environment.
Am I doing something wrong?

Related

Trying to install Pyramid package with "python setup.py install" gives error searching for a package

I'm working on a Pyramid project that has to be deployed in a Debian 7 server.
The Debian 7 server has the python version 2.7.3 as from the archives repositories.
After creating a virtual environment with virtualenv command the pip version installed in this virtualenv is 1.1.
First thing noted: I can't upgrade pip with pip install --upgrade pip. The version is not updated and remains in 1.1 version.
After installing the OS packages needed to install the project I ran python setup.py install but I get the error:
Searching for zipp==0.5
Reading http://pypi.python.org/simple/zipp/
Couldn't find index page for 'zipp' (maybe misspelled?)
Scanning index of all packages (this may take a while)
Reading http://pypi.python.org/simple/
No local packages or download links found for zipp==0.5
error: Could not find suitable distribution for Requirement.parse('zipp==0.5')
So, the python setup.py install command could not recognize the zipp package.
I thought that this was related to the older version of pip (1.1). So I could update pip version successfully using the index-url option:
$ pip install --index-url https://pypi.python.org/simple --upgrade pip
That updated pip version from 1.1 to 20.3b1. Then I tried python setup.py install again, but the same error occurred.
What I could see is that, after updating pip version, the zipp==0.5.0 package is installed if I ran pip install zipp==0.5.
I'm new to Pyramid and the package installing using the setup.py module. I'm not understanding why I can install the zipp package with pip and can't with python setup.py install.
I'm not putting the content of setup.py here because I think it's not a problem of the setup.py script. With more recent versions of python and pip in an Ubuntu 18.04 machine the setup.py works like a charm.
Someone could explain how to solve this issue?
When you run python setup.py install directly, you are not using pip, so the version of pip you have installed is irrelevant. This command is antiquated, should not be used, etc, etc. The right answer is to use pip install . as a replacement for python setup.py install and to use pip install -e . as a replacement for python setup.py develop.
With respect to what you're seeing, when you run python setup.py install this using the version of easy_install bundled with setuptools to talk to PyPI and install dependencies. This should be avoided for a lot of reasons but just know that to override urls it uses they go in ~/.pydistutils.cfg and have nothing to do with pip. HTTPS is one problem that you looked at, another is that old versions of Python do not have the right CA trust store, nor support the minimum required TLS 1.2 to handshake with PyPI. So expect lots of problems using old tools - at the very least try to use pip instead of easy_install.

CentOS 6.8 - Installing Python 2.7 leads to a circular dependency error impossible to fix

I have a fresh new minimal installation of CentOS 6.8 where I'm trying to have Python 2.7 with its tools.
First, I started with:
yum -y update
yum groupinstall -y development
yum install -y zlib-dev openssl-devel sqlite-devel bzip2-devel
Then I downloaded the Python 2.7.13 package and installed it normally with:
./configure
make
make altinstall
But then, when trying to install setuptools with:
wget http://url.to.setup.tools.package
tar xf file
cd folder
python2.7 setup.py install
it says that the six package is missing.
If I want to install the six package, it says that the packaging package is missing. If I want to install the packaging package, it says that the pyparsing package is missing. If I want to install the pyparsing package, it says that the setuptools package is missing.
How can this happen? Is now Python 2.7.13 installing itself without anything?
Is there any other way to install Python 2.7 separately from the original Python 2.6 that CentOS 6.8 has?
Thank you very much.
You could manually install EPEL repo and then IUS repo:
wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-6.noarch.rpm
rpm -Uhv epel-release-latest-6.noarch.rpm
wget https://centos6.iuscommunity.org/ius-release.rpm
rpm -Uhv ius-release.rpm
Then you can install Python-2.7 like this:
yum -y install python27 python27-devel python27-pip python27-setuptools python27-virtualenv --enablerepo=ius
Then whatever python script you might have that you want to use Python 2.7.x instead of 2.6 (which is default installed on CentOS 6.x) you have to edit that script and do a simple replace (replace python with python2.7) and you're good to go!

Python/Installing cvxpy package error - setup.py egg_info with error code 1

I'm trying to install cvxpy on my Mac through pip and through PyCharm and I'm getting the following error: "Command "python setup.py egg_info" failed with error code 1 in /private/tmp/pip-build-azdpOA/CVXcanon/". Would anyone know what's that and how to fix this?
My python is 2.7
My pip is 8.1.2
My PyCharm is 4.5.4
My OSX is 10.8.5
The module CVXcanon is a dependency by the official installation instructions.
We recommend using Anaconda rather than the Python that comes with the Mac and installing pip, nose, NumPy, SciPy, and CVXOPT through Anaconda (i.e., conda install pip nose numpy scipy cvxopt). But it is not necessary to have Anaconda to install CVXPY, and the instructions below assume you do not have Anaconda.
Install the command line tools xcode-select --install and then install the module with all dependencies pip install cvxpy. You can use the Terminal tab in PyCharm.

Pip installation bug

So I tried to install pip using the get-pip.py file, and when I ran the file, terminal told me I already had pip installed on 2.7. However, when I try to find the version of my pip, terminal tells me pip doesn't exist and points to a version of 3.5 I have installed. Clearly my issue is that I have pip installed on v2.7 but the pip command is linked to v3.5. Any clues on how to fix?
Here's a picture of my terminal output:
To install a package in a particular version of python, use the following commands always:
For python 2.x:
sudo python -m pip install [package]
For python 3.x:
sudo python3 -m pip install [package]
This should resolve the doubt of which python version is the given package getting installed for.
Note: This is assuming you have not created aliases for the python command

pip, easy_install commands not working in Ubuntu. Python 2.7 and 3.4 are installed

I'm fairly new to python. I'm using Ubuntu 14.04 and have both python 2.7.6 and python 3.4.0 installed. I was trying to install BeautifulSoup but couldn't because I get an error saying
The program 'pip' is currently not installed.
I found that it comes bundles with python 3.4. I tried to install pip using sudo easy_install pip as mentioned in another question on stackoverflow. But this gives an error sudo: easy_install: command not found.
What is the problem?
pip appears to have turned into python -m pip (in your case, python3 -m pip, as Ubuntu's keeping the 2.x line available as python) in Python 3.4.
easy_install for Python 2.7 comes as part of the python-setuptools package. Once installed, running easy_install pip would install pip for your Python 2.7 installation's use.
How aboutapt-get install python-pip? At least, Debian official repository has python-pip even from wheezy.
Unfortunately, effective as of April 2018, python-setuptools no longer ships with easy_install, as per Matthias's update:
https://ubuntu.pkgs.org/18.04/ubuntu-main-i386/python-setuptools_39.0.1-2_all.deb.html
However, you can still compile from the source code yourself, and it does work. I just tried it with sudo easy_install shodan, and it ran successfully.
git clone https://github.com/pypa/setuptools.git
cd ./setuptools
python3 bootstrap.py
sudo python3 setup.py install
Hope this helps.