SciPy in Python 2.7 and Python 3 - python-2.7

I would like to use a module (that requires scipy) in Python 2.7, but for some reason the Python interpreter tells me that I am missing a scipy.special. I do not know why is this, because such an error did not occur when running the Python 3 interpretor.
I have attempted to install scipy through Anaconda and pip, but neither of those options seemed to help.

Related

Python 2.7 with Spyder 3.0

I installed Spyder 3.0 and also python 2.7. I want to run python 2.7 codes with spyder 3.0
I tried to change python interpreter in spyder preferences. "Preferences->Python Interpreter-> Use the following Python interpreter". I chose Python 2.7 but it did not work. I also searched Python 2.7 executable file but I could not find it in the location usr/bin (ubuntu 18.04).
How can deal with this problem?
Spyder installation is specific to one version of Python.
1) install python 2.7
2) run python2.7 -m pip install spyder in cmd
3) you should find spyder in C:\Users\YOUR_NAME\AppData\Local\Programs\Python\Python27\Scripts\spyder.exe (for Windows at
least)
4) You can make a shortcut of it
you should see the python version in the Spyder window title

Installing NumPy + SciPy in Python 2.7 now fails with "RuntimeError: Python version >= 3.5 required"

Installing numpy and scipy from source like this (say, in a fresh Python 2.7 pyenv virtualenv):
pip install numpy==1.14.6 scipy==1.0.1 --no-binary numpy,scipy
gets their installers to use a ~/.numpy-site.cfg file that points to my openblas installation.
This used to work. Now it produces a long stack trace ending with:
File "/usr/local/var/pyenv/versions/2.7.16/envs/issue/lib/python2.7/site-packages/setuptools/sandbox.py", line 45, in _execfile
exec(code, globals, locals)
File "/var/folders/_b/q30qg_l50b5gvqd8y4_wb9h00000gn/T/easy_install-o9MJ5E/numpy-1.17.1/setup.py", line 31, in <module>
if sys.version_info[0] < 3:
RuntimeError: Python version >= 3.5 required.
----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.
Q. What changed?
Q. Why does it say Python version >= 3.5 required. in a Python 2.7 installation?
Q. How to fix it?
The scipy 1.0.1 installer requires numpy as a prerequisite, but the multiple installers working together end up getting the latest version of numpy unless numpy is already present.
What changed: The latest version of numpy requires Python 3.5+, hence the error message.
So even though the pip command explicitly asked to install numpy==1.14.6 scipy==1.0.1, it triggers a newer numpy installer that fails on Python 2. (The last entry in the stack trace shows numpy-1.17.1 requiring Python 3.)
The problem arises in the interaction between pip, the scipy and numpy installers, and easy_install. Details in pip issue #6945.
Workaround: Install numpy first. Then install scipy. Alternatively, the one-line install might work if you don't need the --no-binary option.
I also encountered an issue where scipy was been installed through a script and it was trying to install a version 1.7.1 which required python 3.7 at least and i hand 3.6. The workaround was i installed scipy myself and the version i got was 1.5.4.

Can't install external packages in Python

My problem is when I'm trying to install an external package via Command Prompt, I'm getting an error. I've just started programming and I don't understand everything yet.
That's an error:
If Python 2 and Python 3 are both installed on the system, they can interfere and cause easy_install to break.
Hence, you will need to specify which version of Python and easy_install you want, like this:
python-2.7 -m easy_install <module>
For any other version of Python, just change the -2.7 to your major.minor version.

Error "from scipy.linalg import _fblas importerror: DLL load failed"

I found a code on internet which implement a paper "Effective 3D Action
Recognition Using EigenJoints" code. They implement in Python so I tried to install Python 2.7.9 and numpy, scipy, scikit-learn. All these libraries installed successfully. In the cmd when i tried to run python eigen.py it gives me this error.
Please anyone download this code and run it by yourself or help me to solve this error.
You have to do 2 steps:
download anaconda according to your system and specifications.
Make sure that Anaconda is installed on python version installed on your system. For example, if you have python 3.4, and anaconda in installled on 2.7, then you should remove python 3.4.
Afterwards, the code will run smoothly and all libraries will be well defined. I have made the same ;) Please, let me know if you face new problems.

No module named numpy error in python 2.7.8

I'm trying to get Numpy working in Python 2.7.8, on a Ubuntu 12.0.4 operating system. I installed Python 2.7.8 as my default python, then installed the SciPy stack according to the site instructions. I double-checked that numpy installed in the /usr/lib/Python2.7 directory. When I run python the version is 2.7.8, but of course it can't find Numpy. Is there any way to fix this? Or should I just throw this computer out the window?
Edit: Apparently I have both 2.7.8 and 2.7.3 installed, both to Python2.7 directory. I have no idea how to get rid of either one...