Python Forum
Relations between python 2.7 3 3.7, scipy, pip?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Relations between python 2.7 3 3.7, scipy, pip?
#1
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!
Reply
#2
(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()
Reply
#3
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).
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Appropriate data-structure / design for business-day relations (week/month-wise) sx999 2 2,754 Apr-23-2021, 08:09 AM
Last Post: sx999
  ModuleNotFoundError: No module named 'scipy.optimize'; 'scipy' is not a package AaronKR 1 10,093 Jul-09-2020, 02:36 AM
Last Post: bowlofred
  Python scipy odeint: solving with solution-dependent functions etienne 0 2,707 Jun-05-2020, 01:29 PM
Last Post: etienne
  Path to python, matplotlib, scipy, numpy, etc. dcollett 6 2,888 Mar-29-2020, 07:59 PM
Last Post: dcollett
  How to plot implicit functions (with two variables) in scipy python using matplotlib? Jay_Nerella 1 7,886 May-11-2019, 01:17 AM
Last Post: scidam

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020