Platform: Excess onDemand (EoD) with Red hat version6.10
Here I have launched spyder3 application and spyder3 comes up with black display.
I even can not see its toolbar.
I suspect this is pyqt problem and but dont know how to debug it below are details
Python 3.6.4 (default, Jan 31 2018, 22:47:26)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-18)] on linux
>>> >>> >>> PYQT_VERSION = 329473
PYQT_VERSION_STR = 5.7.1
QOpenGLVersionProfile = <class 'PyQt5.QtGui.QOpenGLVersionProfile'>
QT_VERSION = 329473
QT_VERSION_STR = 5.7.1
Related
I am trying to use pwntools to control a python3 session. Here is my code:
from pwn import process
r = process(['python3'])
r.interactive()
However, after I enter r.interactive(), when I type into the terminal, the python3 sub-process has strange reactions. At least I do not see my commands echoed back most of the times.
I also tried to call python3 in a bash session, but the same thing happens.
$ python3
Python 3.8.5 (default, Jan 27 2021, 15:41:15)
[GCC 9.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pwn import process
>>> r = process(['bash'])
[x] Starting local process '/usr/bin/bash'
[+] Starting local process '/usr/bin/bash': pid 119080
>>> r.interactive()
[*] Switching to interactive mode
echo hello
hello
echo this is bash
this is bash
python3
print(1)
print(2)
print(3)
exit
echo hello
File "<stdin>", line 5
echo hello
^
SyntaxError: invalid syntax
Why is this happening? Is it a bug in pwntools, or are there some configurations I overlook?
You need to specify the PTY in your shell, so like this:
$ python3
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from pwn import *; r = process(['python3'], stdin=PTY, raw=False); r.interactive()
[x] Starting local process '/usr/bin/python3'
[+] Starting local process '/usr/bin/python3': pid 2984281
[*] Switching to interactive mode
Python 3.9.2 (default, Feb 28 2021, 17:03:44)
[GCC 10.2.1 20210110] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> 1+1
1+1
2
>>>
I can't run my python programs in pycharm. I installed python3, pycharm and anaconda. I can open the project and write python code, but can't run the program in pycharm. I can use the terminal to run my program and it works fine. Any ideas how to use the right interpreter? Where can I find it? BTW I work with a mac.
When I try to add an interpreter I can add an Virtualenv Environment, Conda Environment or System Interpreter. When I click on System interpreter and choose one, it wont work. I tried to find my python version with the terminal and use it in pycharm, but it wont do anything.
Thats what I see:
entire screen
The icon also seems weird (red cross):
weird icon
Greetings, Stefan
Inspect your conda python installation via:
$ conda info
Mine is: /root/miniconda, so basic grepping shows what pythons do I have:
root#d03107c14a07:/notebook# ls -al /root/miniconda/bin/ | grep python
-rwxrwxr-x 1 root root 129 Apr 16 16:20 ipython
-rwxrwxr-x 1 root root 129 Apr 16 16:20 ipython2
lrwxrwxrwx 1 root root 9 Apr 16 16:20 python -> python2.7
-rwxrwxr-x 1 root root 1689 Apr 16 16:20 python-config
lrwxrwxrwx 1 root root 9 Apr 16 16:20 python2 -> python2.7
-rwxrwxr-x 1 root root 10302 Dec 21 2016 python2.7
And running it like below shows it works:
root#d03107c14a07:/notebook# /root/miniconda/bin/python
Python 2.7.13 |Anaconda 4.4.0 (64-bit)| (default, Dec 20 2016, 23:09:15)
[GCC 4.4.7 20120313 (Red Hat 4.4.7-1)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
Anaconda is brought to you by Continuum Analytics.
Please check out: http://continuum.io/thanks and https://anaconda.org
>>>
We have the path, for me it's: /root/miniconda/bin/python
So, as we have it localized, we need to set it up with our Pycharm.
Go to Settings/Preferences and into Project interpreter, choose a settings wheel and Add - On the left you've got three options, choose Conda, your env might be found automatically, but if it isn't then you have the path to paste ;)
Official docs ref
conda info ref
I have Apache Livy installed. Got this error when submit my code to Livy. How to change default Python Version in Apache Livy?
Exception: Python in worker has different version 3.5 than that in driver 2.6, PySpark cannot run with different minor versions
import sys
print(sys.version)
{'id': 2, 'state': 'available', 'output': {'data': {'text/plain':
'2.6.6 (r266:84292, Jul 23 2015, 15:22:56) \n[GCC 4.4.7 20120313 (Red
Hat 4.4.7-11)]'}, 'status': 'ok', 'execution_count': 2}}
Thanks
With Emacs 24.3.1, I get this when editing through Tramp/ssh in eshell:
/<remotepath> $ bash
/<remotepath> $ python test.py
hello world!
/<remotepath> $ exit
exit
/<remotepath> $ python test.py
Python 2.6.6 (r266:84292, Oct 12 2012, 14:23:48)
[GCC 4.4.6 20120305 (Red Hat 4.4.6-4)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
The file test.py is:
print "hello world!"
Bash is version 4.1.2. Does anyone have any explanation for this behavior?
I don't know eshell, but my guess is you forget to pass the positional parameters when creating your alias:
# don't forget the quotes
# ▼ ▼
~ $ alias python '/path/to/alternate/python $*'
# ▲▲
# don't forget positional parameters
See http://www.emacswiki.org/emacs/EshellAlias
I installed Python 2.7 today using:
./configure --prefix=/home/zhanwu/local --enable-shared --enable-profiling --with-pydebug
make install
Then I keep getting something like "[37745 refs]" on screen after each function call:
[zhanwu#cluster ~]$ ~/local/bin/python
Python 2.7.1 (r271:86832, Jun 16 2011, 17:45:05)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-44)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
[37745 refs]
>>> print 'test'
test
[37745 refs]
>>> sys.exit()
[18048 refs]
[zhanwu#cluster ~]$
What does those numbers mean? Anything wrong here and can I get rid of them?
uname -a result:
[zhanwu#cluster ~]$ uname -a
Linux cluster.xxx.xxx.xxx 2.6.18-128.1.14.el5 #1 SMP Wed Jun 17 06:38:05 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
You get these because you configured the build with --with-pydebug. They denote the number of references Python is currently keeping track of. To get rid of them, configure without --with-pydebug.