Python Forum
How to use/install different versions of Python packages (Scipy) on the same system?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to use/install different versions of Python packages (Scipy) on the same system?
#1
I am new to Python and a I need to performe some calculations using the package Scipy.
I installed Scipy (0.14) from synaptic and implemented the desired code.
Everything worked well.
Now, I realized that I need to download a newer version of the source code (more precisely, https:// github.com/ scipy/scipy/blob/master/scipy/optimize/ slsqp.py) and modify it before performing the calculations.

How can I use the modified code without changing the installed version?

It follows a simple version of the problem I need to solve
import numpy as np
import scipy
from scipy.optimize import minimize # here I need to insert the modified code

#######################

def blackbox(x):
fit = 0
for val in x:
fit = fit + val*val

return fit


#######################


x0=[1,1]


print scipy.__version__

res = minimize(blackbox, x0, method='SLSQP', options={'disp': True, 'maxiter':10, 'eps': 0.01, 'ftol': 1e-05})

print(res.x)
Reply
#2
A safe way would be to install a second identical python version in a different path. Then one python install would have one scipy version and the other python install would have another scipy version.
Recommended Tutorials:
Reply
#3
(Nov-06-2016, 10:14 PM)gzb001 Wrote: How can I use the modified code without changing the installed version?
The obvious choice is to use Virtualenv intro Virtual Environments.
Reply
#4
I wish I knew that 3 days ago, I would not have to lose all of my 3.5 stuff.
I ma going to try that and see if it works.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Use Python Packages to Increment a Column(not a row) ricmacharia 0 1,808 Jun-10-2019, 09:57 AM
Last Post: ricmacharia
  Python Packages for Excel ImranBhatti 8 113,427 Oct-03-2018, 04:58 AM
Last Post: pcsailor
  Solve a system of non-linear equations in Python (scipy.optimize.fsolve) drudox 7 22,633 Aug-18-2018, 02:27 AM
Last Post: scidam
  Multiple python versions on MacOS boring_accountant 4 5,315 Feb-07-2018, 01:51 AM
Last Post: boring_accountant
  [Python][Scipy]Help with Sound Recognition Testing Protocol WebsterAugust 0 2,533 Nov-12-2017, 01:46 AM
Last Post: WebsterAugust
  Security verification of Python "pip" packages? futurity 7 5,293 Aug-23-2017, 04:02 PM
Last Post: Larz60+
  how to install scipy pikm57 2 4,352 Jun-22-2017, 07:52 PM
Last Post: pikm57

Forum Jump:

User Panel Messages

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