Running Monkeyrunner from pydev - jython

Hi I want to run python scripts developed from Monkeyrunner in Eclips-Pydev setup.
I have installed Jython and mapped the Jython interpreter and added the Monkeyrunner.jar to Pydev also.
But still I'm not able to import com.android.monkeyrunner package in Pydev.
Any Help??
Regards,
ram

At First You have to set the path of monkeyrunner which is :
export PATH=/home/<Directory name where android-sdk is located>/android-sdk-linux_x86/tools:$PATH
After that open your terminal and run the command monkeyrunner

Related

Pycharm giving error on a script which is working from terminal (Module: Tensorflow)

I was working with the tensorflow(GPU version) module in Pycharm. If I run a script from terminal, it works as expected. However when I run the script from pycharm, it says:
ImportError: libcudart.so.7.5: cannot open shared object file: No
such file or directory
How do I resolve this?
Pycharm interpreter shows tensorflow as a package.
In the terminal, when I check for the version of tensorflow, it was the same as in pycharm (0.10.0rc0)
Looks like your CUDA_HOME or LD_LIBRARY_PATH configured correctly in the console, but not in PyCharm. You can check and compare their values, in console do
echo $CUDA_HOME
echo $LD_LIBRARY_PATH
In PyCharm (say, in your main script):
import os
print(os.environ.get('CUDA_HOME'))
print(os.environ.get('LD_LIBRARY_PATH'))
You can configure them for the given Run Configuration in Environment Variables section.
Better approach would be configuring those environment variables globally, so every process in the system would have an access to them. To do that you have to edit /etc/environment file and add original values, which you got from console.
Here are very similar problems: one, two, three.

PyQt5 - pyuic5 module PyQt5.uic not found

I've upgraded my deveolpment environment from python-3.2/ Qt-4.8/ PyQt4 to python 3.4.2 / Qt5.3 / PyQt5.
Everything is Ok but the python source code generation with pyuic5.
When calling this commands I get the error
/usr/bin/python3: No module named uic
The Qt uic program is located at
~/Qt/5.3/gcc_64/bin/uic
The PyQt5 pacjakge is located at
/usr/local/lib/python3.4/site-packages/PyQt5
Even if the PyQt5 environment is operational as runtime I can't build any new GUI interface, so I can't move forward with this application upgrade.
Any idea ?
Thanks for help.
Thanks for the answer from #Akhil. The code below really helps me avoid the "module not found" problem, and successfully create a .py file from a .ui file.
exec python -m PyQt5.uic.pyuic youruifile -o yourpyfile -x
call python -m PyQt5.uic.pyuic -x filename.ui -o filename.py
this one worked for me (28th june 2017, PyQt5, python 3.6, win10, 64bit)
I faced the same issue. I had installed PyQt into a virtual environment and the issue was the the pyuic5 script was not using the python interpreter for that virtual environment.
So I opened up the pyuic5 script
exec pythonw2.7 -m PyQt5.uic.pyuic ${1+"$#"}
to
exec python -m PyQt5.uic.pyuic ${1+"$#"}'
This resolved the issue for me.
I know this is late, but I just recently encountered this issue when setting up external tools for Qt Creator. I know its not exactly what you ran into but it produces the same error. I don't like the idea of modifying files in my anaconda/bin directory so I didn't want to implement either of the other answers.
What I did find is that when you are setting up an external tool Qt Creator operates as if you are working in a new environment (i.e. your PATH is not the same as your development path). What I found is that you need to set the Environment field to have the same path as your development environment. This occurs by default when you setup Build and Run Settings for your project, but not for external tools.
Like #ekhumoro said in his comment You must pay attention to your PATH at all times.
I believe you are a Mac user and I had faced a similar issue.
It seems you'll simply have to provide the full path of the pyuic file (for me, it was under a hidden folder usr in the home directory: /usr/local/Cellar/pyqt/5.10.1_1/bin/pyuic5).
In your terminal, change directory to where the *.ui files( which you wish to convert to a *.py file) lies.
So for instance, if you have a Qt designer file saved by the name untitled.ui on your desktop, put in the following command in your terminal:
Amars-MacBook-Pro:Desktop amaradak$ /usr/local/Cellar/pyqt/5.10.1_1/bin/pyuic5 -x untitled.ui -o untitled.py
Hope this helps...
Cheers
Try this: i've been searching for 2 days and all problem solved!
First Rule in Python: Don't use .XML this is not Java instead use .PY for me i don't need uic at all
Let's begin, my pyuic5 actually there is no in PyQt5 folder instead in Scripts Folder
C:\......Python\Python37-32\Scripts\pyuic5.exe
you have to make sure that the yourFile.ui is in the same location of your pyuic5.exe
Follow the pict below, you will be understand:
How to convert ui to py for easy way
uic not found solved
it works like a Charm !
Hi everybody , see last pict, i just converted ui to py for the first time in my life !

Jython easy_install error

My purpose to add some python libraries to jython i.e suds package
To do this tried to follow the instruction from http://www.jython.org/jythonbook/en/1.0/appendixA.html#setuptools
and also checked;
How can I install various Python libraries in Jython?
Installed Jython 2.5.2 and added JYTHON_HOME=C:\jyhon252 to environment variables and %JYTHON_HOME%\bin to path
jython is working fine.
As second step tried to install easy_install on top of Jython 2.5.2
got ez_setup.py from;
http://peak.telecommunity.com/dist/ez_setup.py
Tried to install ez_setup.py and got following error that I couldnt find any clue how to solve it.
same thing happening with Jython 2.5.3 also.
C:\tmp\ez_setup>jython ez_setup.py
Downloading http://pypi.python.org/packages/2.5/s/setuptools/setuptools-0.6c11-py2.5.egg
Processing setuptools-0.6c11-py2.5.egg
Removing c:\jython252\lib\site-packages\setuptools-0.6c11-py2.5.egg
Copying setuptools-0.6c11-py2.5.egg to c:\jython252\lib\site-packages
error: c:\jython252\lib\site-packages\setuptools-0.6c11-py2.5.egg: Unknown error: 20047
I had Windows 7 64bit OS and 32 Bit jre 1.6.0_38 available on my device.
Does anyone have any idea how I can solve this? May I missing some thing ?
Thanks in advance..
It was because of windows 7, just use another OS.
Remove older versions of java and install jdk7
Install JYTHON from jar:
java -jar jython-installer-2.7-b2.jar
Set up environment variables:
Add to existing PATH:
C:\jython2.7b2;C:\Program Files (x86)\Java\jdk1.7.0_67\bin
Create PYTHON and add:
C:\jython2.7b2\Lib\site-packages\;
Install easy_install
Download ez_setup.py
Open file and copy paste intall url into browser to download the setuptools-5.7.zip file.
Move the zip into the same folder as ez_setup.py.
Then run it: jython setup.py install
The easy_install will have moved files to your C:\Python27
copy all the files from C:\Python27\Lib\site-packages to C:\jython2.7b2\Lib\site-packages
copy all the files from C:\Python27\Scripts to C:\jython2.7b2\bin
Delete C:\Python27
Finally, you need to edit all the scripts so that they don't use Python.exe.
Change it to: #!C:\jython2.7b2\jython.bat

Command line to run a program with both xlwt and abaqusConstants modules

Windows Machine, Python 2.4.
I have a program that imports both xlwt/xlrd and abaqusConstants module.
When I run my program with the command line: abaqus python abc.py, I get "ImportError: No module named xlwt/xlrd"
When I run my program with the command line: c:\python24\python.exe abc.py, I get "ImportError: No module named abaqusConstants".
The program ran perfectly when I ran it on my system where xlrd/xlwt was present in c:\python24\lib and Abaqus was installed in C-drive. When I tried to access xlrd/xlwt from my organisation's common share, the above problem appeared.
Is it because Abaqus is not present in the common share? How do I rectify this issue? Please tell me what command line to use.
the module abaqusConstants is only available in abaqus kernel executions of python so you need to be running it with abaqus python. Make sure that your PYTHONPATH variable is set properly to include the directory where xlwt/xlrd exists. see Using matplotlib (for python 2.6) with Abaqus 6.12 for a similar issue.

"#php_bin#" is not recognized as an internal or external command,operable program or batch file

I using PHPUnit and Selenium Server to testing Yii Application,
i m using xp operating system. and i install PHPUnit_Selenium (1.0.1) and other software.actually i follow this bellow instruction to install http://www.yiiframework.com/forum/index.php?/topic/14995-wamp-netbeans-phpunit-selenium-yii/
and i also download the selenium-server-standalone-2.20.0.jar file and through command prompted i started server using java -jar selenium-server-standalone-2.0b3.jar command..
and after that i opened new command prompt and i tried to test my simple hello world yii application. and i invoked this command phpunit functional/SiteTest.php and ya i also set the Test_Base_URL in webtestcase ..
but after invoking above command for test.. some process going on and 2 or 3 times firefox opened and closed automatically and at the end i got this error
"#php_bin#" is not recognized as an internal or external command,operable program or batch file
even i attached screen shots of both cmd prompt ...
http://s14.postimage.org/o057x7wox/1cmd.jpg
You should replace #php_bin# by the path to the php binary. I guess PEAR or PHPUnit installer was supposed to do that.