Python 2.7 upgrade scipy - python

I am trying to upgrade my scipy from version 0.13.3 to 0.17 (I need some new functions), I am working in Ubuntu 14.04
I have encountered the following problems:
the ubuntu repo does not contain the newest version but the one I have already installe.
Therefore, I have tried to install it using pip
sudo -H pip install --upgrade scipy
Collecting scipy
Using cached scipy-0.17.0.tar.gz
Building wheels for collected packages: scipy
Running setup.py bdist_wheel for scipy .../
But then the intallation procedure remains blocked here. I've looked here on the forum for solutions,
Can't upgrade Scipy
https://askubuntu.com/questions/359254/how-to-install-numpy-and-scipy-for-python
But the solutions reported here did not fix my problem.

Related

Unable to install backports.zoneinfo which is required to install Pillow through wheel

I'm setting up my project in MacOs and needed to install requirements (including Pillow). When I run the pip3 install -r requirements.txt, everything goes fine until I receive the following message:
ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects
I've seen similar question which answers are to upgrade pip, which I did, but the error remains the same.
I'm using Python 3.10 in a venv on MacOS
backport zoneinfo does not have wheels for python3.10. So you will have to use 3.9 or lower version till the 3.10 wheels are released.

Unable to install bfieldtools & mayavi packages using pip install

In order to install bfieldtools I am required to install several dependencies, one of those is a package called "Mayavi", which in itself requires the installation of two other dependencies VTK & PyQT5.
After installing these two packages, and running pip install mayavi, the installer ran smoothly until it reached the stage: Building wheel for mayavi (setup.py) ... and at this point it stays for more than 20 minutes (so far).
obviously something is faulty with the installation i just cant tell what it is.
Versions of relevant packages:
Python - 3.9.6, Pip - 21.2.4, PyQt5 - 5.15.4, Vtk - 9.0.3

how to install openCV_python with no import cv2 error?

I am trying to install the OpenCV-python on my mac and i have used the following:
$pip install opencv-python
which gave me the following error:
$pip install opencv-python
Collecting opencv-python
Using cached opencv_python-3.4.0.12-cp27-cp27m macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
Collecting numpy>=1.11.1 (from opencv-python)
Using cached numpy-1.14.2-cp27-cp27m-macosx_10_6_intel.macosx_10_9_intel.macosx_10_9_x86_64.macosx_10_10_intel.macosx_10_10_x86_64.whl
matplotlib 1.3.1 requires nose, which is not installed.
matplotlib 1.3.1 requires tornado, which is not installed.
Installing collected packages: numpy, opencv-python
Found existing installation: numpy 1.8.0rc1
Cannot uninstall 'numpy'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.
Then i did try the pip install --upgrade matplotlib which didnot change anything. It just show me:
matplotlib 2.2.2 requires backports.functools-lru-cache, which is not installed.
matplotlib 2.2.2 has requirement numpy>=1.7.1, but you'll have numpy 1.8.0rc1 which is incompatible.
As I found many ways to install the openCV-python in the internet like:
https://www.pyimagesearch.com/2015/06/15/install-opencv-3-0-and-python-2-7-on-osx/
and I installed on my other mac but i got import cv2 problem alot in my codes.
I will be more than happy if anyone have a good solution or recommendation to install the openCV-python.
Thanks
In summary, macOS comes with the Python preinstalled and you should not mess with the packages installed as some system utilities depend on them.
https://docs.python.org/3.7/using/mac.html
The Apple-provided build of Python is installed in /System/Library/Frameworks/Python.framework and /usr/bin/python, respectively. You should never modify or delete these, as they are Apple-controlled and are used by Apple- or third-party software. Remember that if you choose to install a newer Python version from python.org, you will have two different but functional Python installations on your computer, so it will be important that your paths and usages are consistent with what you want to do.
You should take a look on either venv or virtualenv.
You can read this answer: https://stackoverflow.com/a/41972262/4796844 that will get you through the basics.
In a nutshell, to solve your problem:
$ python3 -m venv ./project-name
$ . ./project-name/bin/activate
$ pip install opencv-python
And to leave the virtual environment, simply:
$ deactivate

How do I install scipy for Python3.4?

When I try to install scipy for 3.4 it throws this error when I run this command:
sudo pip3.4 install scipy
https://www.pastiebin.com/5a7c65d7e44fe
I was able to get it to install with Python 3.6 but not 3.4.. which I need.
Installing Scipy or Numpy from scratch is usually hard work. At best try a distribution that already has it installed (WinPython, Anaconda). If you are on Linux install the packages that come with your distro. On Windows you can also grab the wheels at Gohlke.

Stuck when install scipy in CentOS

Environment is Python 3.5 and CentOS 7.0 in VPS (XEN).
I use IUS repository for CentOS7 to install Python 3.5 and corresponding devel, setuptools packages.
Then upgrade pip3.5 itself by
sudo pip3.5 install upgrade pip
Numpy and Matplotlib can be installed by pip 3.5 without any problem.
sudo pip3.5 install numpy
sudo pip3.5 install matplotlib
But when I try to install scipy, it got stuck at the step running setup.py like forever. Only way to get rid of this is Ctrl+C. Tried several times, even reinstall CentOS and compile Python3.5 from source code. Always the same issue happens.
Collecting scipy
Using cached scipy-0.17.0.tar.gz
Installing collected packages: scipy
Running setup.py install for scipy ... \
Could someone help me out please?
update (Feb 9th 2016):
A 1.5GB swapfile is created manually, which is none originally. Then after about 2 hours waiting, it is finally installed. I guess the relatively low performance of server leads to this problem.

Categories