Octave 4.2.2 and sympy 1.6 - octave

Iam trying to use Octave 4.2.2 with Symbolic pkg v.2.9.0 but I get this error related to sympy package:
Your kit looks good for running the Symbolic package. Happy hacking!
>>
>> syms
Symbolic variables in current scope:
>> a = sym( "a" );
Symbolic pkg v2.9.0: /home/usuario/.local/lib/python3.6/site-packages/sympy/__init__.py:676: SymPyDeprecationWarning:
importing sympy.core.compatibility with 'from sympy import *' has been
deprecated since SymPy 1.6. Use import sympy.core.compatibility
instead. See https://github.com/sympy/sympy/issues/18245 for more
info.
deprecated_since_version="1.6").warn()
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 12, in octoutput_drv
File "<stdin>", line 54, in octoutput
File "<stdin>", line 55, in octoutput
File "/home/usuario/.local/lib/python3.6/site-packages/sympy/__init__.py", line 677, in __getattr__
return getattr(self.mod, name)
AttributeError: module 'sympy.core.compatibility' has no attribute 'integer_types'
Waiting................warning: readblock: timeout of 30 exceeded, breaking out
warning: called from
readblock at line 101 column 7
python_ipc_popen2 at line 99 column 14
python_ipc_driver at line 62 column 13
pycall_sympy__ at line 163 column 9
sym at line 452 column 9
no output so far
error: ipc_popen2: something wrong? timed out starting python
error: called from
python_ipc_popen2 at line 101 column 7
python_ipc_driver at line 62 column 13
pycall_sympy__ at line 163 column 9
sym at line 452 column 9
>> a
error: 'a' undefined near line 1 column 1
>>
I dig into code and find this two references:
https://github.com/sympy/sympy/pull/18245
https://github.com/sympy/sympy/pull/19316
But Iam not a programmer so any idea is greatly appreciated.
I tried to uninstall sympy-1.6 and install sympy-1.5 but that doesn't work.
Thanks for your time.
Daniel

I have managed to found the answer.
The problem is on sympy version 1.6 so I downgraded it to version 1.5.1 with pip3.

I had a similar issue, the problem seems to be that you have to install sympy for python2 not for python3. Install it with pip and then try typing in octave
sympref diagnose
And it will tell you that the current interpreter is python3, you got to change this.
setenv PYTHON python2
sympref reset
Because apparently the symbolic package was developed for python2.
I hope I could help you.

Related

cant install pygame in pycharm

First of all, I'm new to programming. So,forgive me for my mistakes. I've installed pygame in python IDLE. But when I try to install it in pycharm, this happens:
Microsoft Windows [Version 6.1.7601]
Copyright (c) 2009 Microsoft Corporation. All rights reserved.
(venv) C:\Users\ARMAN\PycharmProjects\GAMES>pip install pygame
Collecting pygame
Using cached https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"?[Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-5f1r3j6w\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-5f1r3j6w\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-5f1r3j6w\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-5f1r3j6w\pygame\buildconfig\download_win_prebuilt.py", line 302, in ask
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ARMAN\AppData\Local\Temp\pip-install-5f1r3j6w\pygame\
(venv) C:\Users\ARMAN\PycharmProjects\GAMES>py -m pip install -U pygame --user
Collecting pygame
Using cached https://files.pythonhosted.org/packages/0f/9c/78626be04e193c0624842090fe5555b3805c050dfaa81c8094d6441db2be/pygame-1.9.6.tar.gz
Complete output from command python setup.py egg_info:
WARNING, No "Setup" File Exists, Running "buildconfig/config.py"
Using WINDOWS configuration...
Download prebuilts to "prebuilt_downloads" and copy to "./prebuilt-x86"? [Y/n]Traceback (most recent call last):
File "<string>", line 1, in <module>
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-nykuwxyw\pygame\setup.py", line 194, in <module>
buildconfig.config.main(AUTO_CONFIG)
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-nykuwxyw\pygame\buildconfig\config.py", line 210, in main
deps = CFG.main(**kwds)
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-nykuwxyw\pygame\buildconfig\config_win.py", line 576, in main
and download_win_prebuilt.ask(**download_kwargs):
File "C:\Users\ARMAN\AppData\Local\Temp\pip-install-nykuwxyw\pygame\buildconfig\downloa
reply = raw_input(
EOFError: EOF when reading a line
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in C:\Users\ARMAN\AppData\Local\T
(venv) C:\Users\ARMAN\PycharmProjects\GAMES>
I get an error. I've updated everything. Found a similar problem here:
https://intellij-support.jetbrains.com/hc/en-us/community/posts/115000435070-Command-python-setup-py-egg-info-failed-with-error-code-1-whatever-package-I-try-to-install-.
But I can't understand the solution. So, please kindly help me.
This isn't my answer, but an answer from here:
Pygame docs recommends that you use Python version 3.6.1 or greater,
so I would suggest you to use the most recent non-beta version. Also,
some pygame wheels are not available to this version yet.
After the python installation make sure its added to your PATH
variable and try to install Pygame using this command given that you
are on windows:
py -m pip install -U pygame --user
If you get a PermissionError then
run the command prompt as administrator.
I hope this helps.

Windows 10 Rtree installation successful from .whl file, but error when running code

I am running Python 3.7, 64bit on Windows 10 and trying desperately to get Rtree running. I use the package Rtree-0.9.1-cp37-cp37m-win_amd64.whl from Christoph Gohlke (https://www.lfd.uci.edu/~gohlke/pythonlibs/).
I have tried for very long to get it to work, but keep on getting the following error message when running a script that uses geopandas.
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\rtree\core.py", line 90, in <module>
rt = ctypes.CDLL(os.path.join(here, 'spatialindex_c.dll'))
File "C:\Python37\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
The installation of the whl-package should include the libspatialindex files, but they are not found when running the code. I tried to use Python 2.7 first to run it, then installed Python 3.7. I've checked all the dependencies and checked whether the "spatialindex_c.dll" files are at the right place, but nothing helps. Would be great to get an answer on that.

Octave symbolic packag fails to import SymPy

I get an error message when I try to make use of symbolic package in Octave.
>> pkg load symbolic
>> syms x y
Traceback (most recent call last):
File "<string>", line 1, in <module>
ImportError: No module named sympy
OctSymPy v2.6.0: this is free software without warranty, see source.
Initializing communication with SymPy using a popen2() pipe.
error: Python cannot import SymPy: have you installed SymPy?
error: called from
assert_have_python_and_sympy at line 37 column 5
python_ipc_popen2 at line 78 column 5
python_ipc_driver at line 59 column 13
python_cmd at line 164 column 9
valid_sym_assumptions at line 38 column 10
assumptions at line 82 column 7
syms at line 97 column 13
What am I doing wrong?

cocos installation: AttributeError: 'dict' object has no attribute 'has_key'

I am following the tutorial on my mac. I have all env paths set correctly but when I start a new project I am getting an error.
I have 2 pythons installed 3.4 and 2.7; is it a reason why I have a problem?
I wrote:
cocos$ cocos new HelloWorld -p com.myname.HelloWorld -l cpp -d / Users/dev/cocos/cocosProjects/HelloWorld
and I received the following error:
Traceback (most recent call last):
File "/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py", line 904, in
if not _check_python_version():
File "/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/cocos.py", line 868, in _check_python_version
print(MultiLanguage.get_string('COCOS_PYTHON_VERSION_TIP_FMT') % (major_ver, minor_ver))
File "/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py", line 52, in get_string
fmt = cls.get_instance().get_current_string(key)
File "/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py", line 46, in get_instance
cls.instance = MultiLanguage()
File "/Users/dev/cocos/cocos2d-x-3.10/tools/cocos2d-console/bin/MultiLanguage.py", line 100, in init
if self.cfg_info.has_key(cur_lang_key):
AttributeError: 'dict' object has no attribute 'has_key'
I installed python2.7.11 once again and since then I could use cocos new to build a new project; aliasing python as python2 did not work before; I still have access to my 3.4 version for other applications but 2.7 is my default one which was the problem before.
I hope it will help those who have similar problem.
thank you all for having a look

How to install io package for Octave on Mac

I am trying to install the 'io' package for Octave on my Macbook Air, because I want to convert the .mat file into .xls file. However, when I try to install the package, the following errors appear:
octave:33> pkg install io-2.2.6.tar.gz
gzip: /Users/mlt660609/Downloads/io-2.2.6.tar.gz: not in gzip format
A(I): index out of bounds; value 3 out of bound 2
error: called from 'install' in file /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/install.m near line 102, column 19
error: called from:
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/private/install.m at line 146, column 5
error: /usr/local/octave/3.8.0/share/octave/3.8.0/m/pkg/pkg.m at line 394, column 9
Anyone can help?? Thanks.