- Abra o arquivo
symbolics_init.py
. - Ir para a linha
91
. - Substitua
sympy.abs
porsympy.Abs
Eu tentei criar este aplicativo por meio de download no link & no processo já baixei + 500mb de dados, mas em um ponto eu estou constantemente falhando ... Esta foi a saída que finalmente consegui depois de instalar muitas dependências:
sudo python main.py
Traceback (most recent call last):
File "main.py", line 28, in <module>
from mainwindow import *
File "/home/usama/Downloads/miramath/mainwindow.py", line 24, in <module>
import worksheet
File "/home/usama/Downloads/miramath/worksheet.py", line 37, in <module>
import polarplot
File "/home/usama/Downloads/miramath/polarplot.py", line 30, in <module>
from polarplotwidget import PolarPlotWidget
File "/home/usama/Downloads/miramath/polarplotwidget.py", line 29, in <module>
class PolarPlotWidget(Qwt.QwtPolarPlot):
AttributeError: 'module' object has no attribute 'QwtPolarPlot'
Por isso, fiz o download do PyQwt por meio do link
de acordo com o manual, naveguei para a pasta de configuração & correu:
python configure.py -Q ../qwt-5.2
Command line options:
{'debug': False,
'disable_numarray': False,
'disable_numeric': False,
'disable_numpy': False,
'excluded_features': [],
'extra_cflags': [],
'extra_cxxflags': [],
'extra_defines': [],
'extra_include_dirs': [],
'extra_lflags': [],
'extra_lib_dirs': [],
'extra_libs': [],
'jobs': '',
'module_install_path': '',
'modules': [],
'qt': 4,
'qwt_sources': '../qwt-5.2',
'sip_include_dirs': [],
'subdirs': [],
'timelines': [],
'trace': ''}
Found SIP-4.13.3.
Found 'posix' operating system:
2.7.3 (default, Sep 26 2012, 21:53:58)
[GCC 4.7.2]
Do not get upset by error messages in the next 3 compiler checks:
Check if 'size_t' and 'unsigned int' are the same type:
YES
Check if 'size_t' and 'unsigned long' are the same type:
size_t_check.cpp:3:6: error: prototype for ‘void a::f(long unsigned int)’ does not match any in class ‘a’
size_t_check.cpp:2:24: error: candidate is: void a::f(size_t)
NO
Check if 'size_t' and 'unsigned long long' are the same type:
size_t_check.cpp:3:6: error: prototype for ‘void a::f(long long unsigned int)’ does not match any in class ‘a’
size_t_check.cpp:2:24: error: candidate is: void a::f(size_t)
NO
Failed to import numarray: PyQwt will be build without support for numarray.
Failed to find Numeric2: PyQwt will be build without support for Numeric.
Found NumPy-1.6.2.
g++ -c -pipe -O2 -Wall -W -D_REENTRANT -DQT_WEBKIT -DQT_NO_DEBUG -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -I. -I/usr/include/qt4/QtCore -I/usr/include/qt4 -I../qwt-5.2/src -I/usr/include/python2.7 -I/usr/lib/python2.7/dist-packages/numpy/core/include -I. -o qwt_version_info.o qwt_version_info.cpp
g++ -Wl,-O1 -o qwt_version_info qwt_version_info.o -L/usr/lib/i386-linux-gnu -lQtCore -lpthread
Found Qwt-5.2.1.
Extended command line options:
{'debug': False,
'disable_numarray': False,
'disable_numeric': False,
'disable_numpy': False,
'excluded_features': ['-x HAS_PYQT_031105',
'-x HAS_NUMARRAY',
'-x HAS_NUMERIC',
'-x HAS_QWT4'],
'extra_cflags': [],
'extra_cxxflags': [],
'extra_defines': ['HAS_NUMPY'],
'extra_include_dirs': ['/usr/include/python2.7',
'/usr/lib/python2.7/dist-packages/numpy/core/include'],
'extra_lflags': [],
'extra_lib_dirs': [],
'extra_libs': [],
'iqt': 'iqt5qt4',
'iqt_sipfile': '../sip/iqt5qt4/IQtModule.sip',
'jobs': '',
'module_install_path': '/usr/lib/python2.7/dist-packages/PyQt4/Qwt5',
'modules': ['iqt', 'Qwt5'],
'qt': 4,
'qwt': 'qwt5qt4',
'qwt_sipfile': '../sip/qwt5qt4/QwtModule.sip',
'qwt_sources': '../qwt-5.2',
'sip_include_dirs': [],
'subdirs': ['iqt5qt4', 'qwt5qt4'],
'timelines': ['-t Qwt_5_2_0'],
'trace': ''}
The following modules will be built: ['iqt', 'Qwt5'].
Setup the PyQwt package build.
sip invokation:
'/usr/bin/sip -b tmp-iqt5qt4/iqt5qt4.sbf -c tmp-iqt5qt4 ../sip/iqt5qt4/IQtModule.sip'
sh: 1: /usr/bin/sip: not found
SIP failed to generate the C++ code.
Como posso resolver isso?
Os problemas acima foram resolvidos através da instalação: python-qt4-dev libqwt-dev python-sip-dev python-dev
Após criar com sucesso o PyQwt, enfrentei um novo erro ao executar o miramath
python main.py
running...
Traceback (most recent call last):
File "main.py", line 77, in <module>
main(sys.argv)
File "main.py", line 51, in main
main = MainWindow()
File "/home/usama/Downloads/miramath/mainwindow.py", line 55, in __init__
self.addTab()
File "/home/usama/Downloads/miramath/mainwindow.py", line 436, in addTab
w = worksheet.WorkSheet(self, self.runtimeStatusMessage, self.numEquationsStatusMessage, self.currentEquationStatusMessage)
File "/home/usama/Downloads/miramath/worksheet.py", line 94, in __init__
self.execution_thread = execthread.ExecThread(self)
File "/home/usama/Downloads/miramath/execthread.py", line 56, in __init__
exec symbolics_init_program in self.symbolics_global_namespace # execfile goes away in 3.0
File "<string>", line 91, in <module>
AttributeError: 'module' object has no attribute 'abs'
O problema está resolvido @ green7 answer's below
symbolics_init.py
. 91
. sympy.abs
por sympy.Abs
Tags dependencies 12.10