Installing Pandas for PyPy on Alpine Linux? - pandas

As documented in the following question
, installing Pandas and Numpy is slow with Alpine Linux. For those using normal Python, there are workarounds that involve adding prebuilt versions of Pandas. However, these versions are for Python3. What is the best way to handle this with PyPy?

the solution would be to provide prebuilt versions for Alpine Linux. Someone has to do the work of building them and uploading to a public site. It seems the distro provides these for cpython, perhaps they could be convinced to do so for pypy as well.

New Versions of PyPy Already supports Pandas and Numpy
https://doc.pypy.org/en/latest/release-v5.9.0.html
So ,Official Image on docker should be supporting . So no need to build your Dockerfile from alpine
https://hub.docker.com/_/pypy

Do update first:
apk add --update py-pip
Or:
apk update
apk add py-pip
Or: install anaconda navigator : Click Here
Or: Last option : Click Here

Related

Conda and Jupyter Notebook Environment Confusion

I am using Jupyter Notebook to help debug some issues I'm having moving between JSON and pandas. The specific application isn't important.
The important part is that I needed to use pandas.json_normalize() which apparently first showed up in pandas version 1.0.3. I was confused when Jupyter said it doesn't exist. I did a version check and got:
In[]: pd.__version
Out[]: 0.25.2
This is not the version of python installed in either my base environment or the conda environment that Jupyter Notebook is running in or that the app is running in. Version checks in both environments in Anaconda Prompt (outside of Jupyter Notebook) confirm this.
What is going on here? Looking around I haven't seen a good answer, but it does appear that other people have had the same issue --- Jupyter defaulting to pandas 0.25.2 for some reason.
It seems that your Notebook is using a different kernel/environment than what you want.
run this in the notebook to see which environment you are using
! which python
or try
import sys
print(sys.executable)
which would show you which environment it's using, if you have env named venv then you will get something like.
/home/your_home_directory/anaconda3/envs/venv/bin/python
If you don't care about all of that and you just want to update the pandas that it's using then copy that path and do this.
! pip install --upgrade pandas
Note that this will also depend on which version of python you are using

Is there an specific order to install the following packages?

I want to install numpy, scipy, matplotlib, and opencv
I do not want to mess it up. Not sure if there is a specific order I should install them or if I can do any.
I know opencv should be the last because requires numpy.
What about the others?
Thank you
As per OP's interest, I would like to suggest the installation of Anaconda distribution. It includes the packages NumPy, SciPy, Scikit Image, Matplotlib, Jupyter and over 100 libraries as pre-built packages as documented here. (choose specific python version as you like)
Once anaconda installation is finished, you can easily install opencv from the command prompt like:
# install opencv
$ conda install opencv
It's very easy to search for a package and install it using the conda package manager.
First I suggest always to use a virtualenv for all projects (see here: http://docs.python-guide.org/en/latest/dev/virtualenvs/). Think of it as a type of insurance that enables you to roll back or re-do things in case you mess things up.
Second, when you usually install a python package python checks for dependencies and install them (at least with pip install). However, it does not hurt to do things in the right order- you can find those dependencies on the python documentation of these specific packages. For example, opencv requires numpy as a dependency (see https://pypi.python.org/pypi/opencv-python).
Order:
1) numpy
2) scipy
3) matplotlib and opencv

Python Packaging Fix: Understand Differences between Wheel and Egg; How to get local fix to wider audience?

I'm trying to understand why the easy_install of pyicu works and pip install doesn't (see below). also trying to understand "What is the difference between a PyPi project with a universal wheel and one without?" Will installs be "easier?". If so, will this merge request solve the problem of polyglot not installing on an Anaconda machine?
Need help/advice/solutions on how to best resolve python project install issue that is tied to underlying dependencies. I have two local fixes in GitHub Gists but would like to know the best way to have this fix "out there" so people like me can find it. What is the normal Python Community approach? The problem centers around three projects:
polyglot - a python multilingual NLP toolkit
pyicu - Python extension wrapping IBM's International Components for Unicode C++ library (ICU).
pycld2 - CLD (Compact Language Detection) library as maintained by Dick Sites
The goal:
Install polyglot on a MacOSX computer running Python Anaconda Distribution
Make the fix I found available to everyone; lots of issues published about the problem.
Here's the error trace:
The Problem (Lots of them):
Core polyglot dependency, pyicu, does not properly install when you use pip install. Discovered you must use easy_install for it build properly and work on MacOSX. If you don't use the easy_install, you get:
polyglot requires icu 54.1.1 to run in Anaconda, but...
Homebrew, the MacOSX tool to install icu, only installs version 58.1. That version is too new. Old stackoverflows advise brew install icu4c to fix problem, but Homebrew evolution makes that advice obsolete now.
pyicu does not have a universal wheel; but I created a merge request to add one to pyicu. Only way to fix this is with this channel's icu, https://anaconda.org/ccordoba12/icu. conda install icu will not work, but that's the normal conda way of doing things.
*pycld2 - CLD (Compact Language Detection) becomes a problem because after I build the wheel file locally, have to download the project and run setup.py install locally. There has to be a better way to do this right?
What I've Done to Solve the problem (should I do more, what should I do next?)
Created two Gists that can successfully install polyglot on a Mac running Anaconda for Python 2.7 or Python 3.5
Python 2.7 fix
Python 3.5 fix
created the merge request for pyicu
Both Gist fixes work. But, is this error in install tied to the wheel? If I installed pyicu with easy_install, the install works. But, with pip, it doesn't?
What are the steps to take in the Python community to fix it so people can find the solution or just pip install with no problems?
I did a test, and if the wheel file is built, the pip works with no issues.

Installing Pandas using Pip on Windows 7

Having issues installing Pandas with Pip on Windows 7.
EDIT:
Seems like I did not have Microsoft Visual C++ installed.
The much easier approach, as someone kindly mentioned, was to install Anaconda and use it as the package manager as opposed to Python's native pip, although, for some packages (i.e PyBullet), you might have to default back to using Pip.
From your tags I guess you are using Windows as OS. Many people use Anaconda. It comes with many packages including pandas. The line is here It should be easy to install. Do you use any IDE?

Using Anaconda Python 3.4 with PyQt5

I have an existing PyQt5/Python3.4 application that works great, and would now like to add "real-time" data graphing to it. Since matplotlib installation specifically looks for Python 3.2, and NumPhy / ipython each have there own Python version requirements, I thought I'd use a python distribution to avoid confusion.
But out of all the distros (pythonxy, winpython, canopy epd) Anaconda is the only one that supports Python 3.4, however it only has PyQt 4.10.4. Is there a way I can install Anaconda, and use matplotlib from within my existing PyQt5 gui app?
Would I be better off just using another charting package (pyqtgraph, pyqwt, guiqwt, chaco, etc) that might work out of the box with PyQt5/Python3.4?
I was able to install it from dsdale24's and asmeurer's channels but then, when trying to run a qt script with a QApplication object, I got an error message regarding to cocoa library not being found.
Then, following asmeurer's comment, I could install PyQt5 on anaconda with python 3.4 using the mmcauliffe package:
conda install -c https://conda.anaconda.org/mmcauliffe pyqt5
Now it works great!
We are working on adding pyqt5, but for now, you can install it from https://binstar.org/dsdale24/pyqt5.
conda config --add channels dsdale24
conda install pyqt5
create an env like this:
conda create –name my_env python=3.5 pyqt=5
works great.
I use Anaconda and with Python v2.7.X and qt5 doesn't work. The work-around I found was
Tools -> Preferences -> Python console -> External modules -> Library: PySlide