Python Forum
Relations between python 2.7 3 3.7, scipy, pip? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Relations between python 2.7 3 3.7, scipy, pip? (/thread-18082.html)



Relations between python 2.7 3 3.7, scipy, pip? - larkypython - May-05-2019

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!


RE: Relations between python 2.7 3 3.7, scipy, pip? - snippsat - May-05-2019

(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()



RE: Relations between python 2.7 3 3.7, scipy, pip? - Gribouillis - May-05-2019

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).