There is scipy.optimize.minimize method in my script. The “bounds” option is important to me, which works in python 3. However, the same script uses libraries that work in python 2.7. How do I install them in the pycharm community for python 3.1 or is there an alternative? They are used to work with root files. Here they are: tkFileDialog, tkMessageBox, Tkinter, ScrolledText.
import tkFileDialog, tkMessageBox, sys, os, time
import ROOT, numpy
from Tkinter import*
from ScrolledText import ScrolledText
import matplotlib.pyplot as plt
import numpy as np
import math
import sys, os, time, shutil
import ROOT
from tkinter import filedialog, StringVar, IntVar, Menu, Label, Checkbutton, Button, mainloop, Tk, messagebox, W, Toplevel, scrolledtext, Spinbox, CENTER, Frame, END, filedialog, Entry
from tkinter.ttk import Combobox
from scipy import optimize
def f(params):
phi, teta = params
count = 0.
for u in range(len(X)):
count += ((R0[u] - X[u]*math.sin(teta)*math.cos(phi) - Y[u]*math.sin(teta)*math.sin(phi) - Z[u]*math.cos(teta))/(len(X) + 2))**2
return count
for q in range(len(fi)):
for w in range(len(theta)):
p = []
p = [fi[q], theta[w]]
p = optimize.minimize(f, p, method='Nelder-Mead', options=dict(maxiter=SIMPLEX_CALCU_LIMIT, maxfev=5*SIMPLEX_CALCU_LIMIT,
xatol=SIMPLEX_SIZE_LIMIT, fatol=SIMPLEX_SIZE_LIMIT, return_all=True, disp=False),
bounds=[(0, 2*math.pi), (0, 0.5*math.pi)])
print(p.x)
I tried searching for these packages in the settings