Python Forum

Full Version: Relations between python 2.7 3 3.7, scipy, pip?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Basically, I don't understand is scipy, numpy an extension on all python or a particular version of python? cause I installed python 2.7, 3.6 together with my ubuntu, and I installed pip and scipy, which is version only 0.19. And then I installed python3.7 through ppa, and I need to run it with
python3.7
, and when in python3.7, run
import scipy
, errors shows, looks like scipy is not installed at all.

the same problems goes for pip too.

Do I need to install pip for each version of python?
Do I need to install scipy, numpy for each version of python?

Thanks alot!
(May-05-2019, 03:58 AM)larkypython Wrote: [ -> ]And then I installed python3.7 through ppa, and I need to run it with
Look at pyenv Simple Python Version Management
(May-05-2019, 03:58 AM)larkypython Wrote: [ -> ]Do I need to install pip for each version of python?
Do I need to install scipy, numpy for each version of python?
Yes to both.
Example see that both python and pip command point to 3.7.
Then will only install to 3.7.
# Check "python" command if point to python 2,try "python3"
tom@tom-VirtualBox:~$ python -V
Python 3.7.3

# Check "pip" command,if point to 2 "pip3"
tom@tom-VirtualBox:~$ pip -V
pip 19.0.3 from /home/tom/.pyenv/versions/3.7.3/lib/python3.7/site-packages/pip (python 3.7)

# Install scipy,see that numpy also automatic will be installed 
tom@tom-VirtualBox:~$ pip install scipy
Collecting scipy
  Downloading .......
Installing collected packages: numpy, scipy
Successfully installed numpy-1.16.3 scipy-1.2.1

# Test that it work
tom@tom-VirtualBox:~$ python
Python 3.7.3 (default, Apr 17 2019, 11:23:54) 
[GCC 7.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import scipy
>>> scipy.__version__
'1.2.1'
>>> exit()
You should be able do install pip through the command
Output:
python3.7 -m ensurepip --upgrade
as indicated in python's documentation.
Then you should be able to install scipy etc with the command
Output:
python3.7 -m pip install --user numpy scipy matplotlib ipython jupyter pandas sympy nose
as suggested in scipy documentation.
Quote:Do I need to install scipy, numpy for each version of python?
Yes, every module needs to be installed for each version of python (not only scipy and numpy).