My department has version < 1.4 version numpy isntalled in /usr/lib/somewhere/numpy. Since I don't have the permission to replace it with a new version. I installed numpy 1.5 in my home directory. However, later when I install scipy, it complained that the version in /usr/lib/somewhere/numpy has version < 1.4. How can I solve this problem?
Change sys.path so that your numpy directory comes in front of the global numpy directory.
That way your version should be imported instead of the other version. If you really want to make sure that the other version isn't used than you can use virtualenv to get your own private environment with all of your own libraries.
You should use virtualenv to create an environment isolated from system packages with the --no-site-packages option to avoid any conflicts with your system packages. You can then install numpy with pip or easy_install specifying the version you want. There are many tutorials out there about how to use virtualenv.
Related
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
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
I have installed virtualenvwrapper in a 3.5.0b1 virtualenv, called setupenv, to be able to generate new python 3.5 test environments easily.
Looking over the list of installed packages, I did see argparse version 1.3.0 installed. This (latest) version of argparse has not been tested with 3.5.
Is this dangerous?
As far as I know 3.2+ comes with its own argparse. Could this install break other packages relying on argparse? Why is this installed at all?
This is probably not dangerous. If you run:
python3.5 -c "import argparse; print(argparse.__file__)"
, you can see that the arparse.py installed with the interpreter takes precedence over the superfluously installed argparse package.
A bit of digging (or using the pipdeptree package) will show you that stevedore is dependent on argparse. This is just sloppy programming (or disregard of possible bandwidth issues).
In a package's setup.py you can easily test if you are running python < 2.7 or 3.0 <= python < 3.2 and only install argparse for those cases.
I would just de-install argparse from your setupenv virtualenv (pip uninstall argparse -y), virtualenvwrapper is not affected by the removal in my experience.
This is actually a bug in stevedore, it uses the pbr package and that supports specification of the python version using environment markers
but stevedore is not using that. The irony is that the example for this in pbr is with argparse, by specifying in the requirements.txt:
argparse; python=='2.6'
A bug report against stevedore was filed, but although the fix was trivial, it was not implemented for several releases. Finally the issue was
set to won't fix, probably because dropped support for 2.6 removed the
need for argparse altogether.
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
I've installed new instance of python-2.7.2 with brew. Installed numpy from pip, then from sources. I keep getting
numpy.distutils.npy_pkg_config.PkgNotFound: Could not find file(s) ['/usr/local/Cellar/python/2.7.2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages/numpy/core/lib/npy-pkg-config/npymath.ini']
when I try to install scipy, either from sources or by pip, and it drives me mad.
Scipy's binary installer tells me, that python 2.7 is required and that I don't have it (I have 2 versions installed).
EPD distribution saved the day.