Python Forum
How to use/install different versions of Python packages (Scipy) on the same system? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: Data Science (https://python-forum.io/forum-44.html)
+--- Thread: How to use/install different versions of Python packages (Scipy) on the same system? (/thread-801.html)



How to use/install different versions of Python packages (Scipy) on the same system? - gzb001 - Nov-06-2016

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)



RE: How to use/install different versions of Python packages (Scipy) on the same system? - metulburr - Nov-06-2016

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.


RE: How to use/install different versions of Python packages (Scipy) on the same system? - snippsat - Nov-07-2016

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


RE: How to use/install different versions of Python packages (Scipy) on the same system? - Blue Dog - Nov-07-2016

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.