RPYC library is not importing - python-3.6

I am running python code and keep the rpyc libary folder inside the project directory. But when I import rpyc it returns an error no module name rpyc.
Can anyone advise me on how to properly use rpyc library folder in project directory to execute code.

Related

jar file trouble to have path to file inside jar

I have a .jar file, compiled with the help of the sbt assembly. The program that the sbt builds, inside has a reference to a file with a direct path indication - src/bla/bla.txt. When I run a jar file not from the project's directory, the program can not find the file bla.txt on the specified path. How to correctly specify the path to the file so that the program can have access
What you probably want to do is to put the bla.txt to
src/main/resources/ -folder
and then you can read it using Source.
import scala.io.Source
scala 2.12
val blaLines = Source.fromResource("bla.txt").getLines
scala 2.11
val blaLines = Source.fromInputStream( getClass.getResourceAsStream("/bla.txt") ).getLines

How to use extensions

Could someone please explain how one uses the premake extensions. I added the eclipse extension in a directory under my premake installation. And in the premake script I added recuire "eclipse".
Running the script with premake5 eclipse, I get an error module "eclipse.lua" not found.
I added the path of the modules directory to my environment variables.
I'm using premake (premake5) on Windows 8.
Thanks
addons need to reside in a folder. You need to create a "eclipse" folder, then copy all the files in it, and the "eclipse" folder should be located where premake can load it (either next the executable or some other place handled through environment variables)
I got this working by adding the full path to the require statement.
require "C:/premake/eclipse/eclipse"
and running the command as premake5 eclipse
Note: This plugin does not generate project files that one can import into Eclipse.

py2exe PyQt5 "ImportError: No module named 'Qt'"

im trying to use py2exe (0.9.2.0) to convert a python script into an executable.
I've failed so far because py2exe does not find the module Qt:
C:\Users\Tobias\eclipse\workspace\pydevTest>python setup.py py2exe
running py2exe
5 missing Modules
------------------
? Qt imported from __SCRIPT__
? WizardPage imported from __SCRIPT__
? readline imported from cmd, code, pdb
? win32api imported from platform
? win32con imported from platform
Building 'dist\Test.exe'.
Building shared code archive 'dist\library.zip'.
Copy c:\windows\system32\python34.dll to dist
Copy C:\Python34\DLLs\_hashlib.pyd to dist\_hashlib.pyd
Copy C:\Python34\lib\site-packages\PyQt5\QtGui.pyd to dist\PyQt5.QtGui.pyd
Copy C:\Python34\lib\site-packages\PyQt5\QtCore.pyd to dist\PyQt5.QtCore.pyd
Copy C:\Python34\DLLs\unicodedata.pyd to dist\unicodedata.pyd
Copy C:\Python34\DLLs\_ssl.pyd to dist\_ssl.pyd
Copy C:\Python34\DLLs\_elementtree.pyd to dist\_elementtree.pyd
Copy C:\Python34\DLLs\select.pyd to dist\select.pyd
Copy C:\Python34\lib\site-packages\sip.pyd to dist\sip.pyd
Copy C:\Python34\lib\site-packages\PyQt5\QtWidgets.pyd to dist\PyQt5.QtWidgets.pyd
Copy C:\Python34\DLLs\pyexpat.pyd to dist\pyexpat.pyd
Copy C:\Python34\DLLs\_lzma.pyd to dist\_lzma.pyd
Copy C:\Python34\DLLs\_socket.pyd to dist\_socket.pyd
Copy C:\Python34\DLLs\_bz2.pyd to dist\_bz2.pyd
Copy C:\Python34\DLLs\_ctypes.pyd to dist\_ctypes.pyd
Copy DLL C:\Python34\lib\site-packages\PyQt5\Qt5Core.dll to dist\
Copy DLL C:\Python34\lib\site-packages\PyQt5\icudt53.dll to dist\
Copy DLL C:\Python34\lib\site-packages\PyQt5\icuuc53.dll to dist\
Copy DLL C:\Python34\lib\site-packages\PyQt5\icuin53.dll to dist\
Copy DLL C:\Python34\lib\site-packages\PyQt5\Qt5Gui.dll to dist\
Copy DLL C:\Python34\lib\site-packages\PyQt5\Qt5Widgets.dll to dist\
My setup.py looks as follows:
import py2exe
from distutils.core import setup
setup(windows=["./src/Test.py"], options={"py2exe" : {"includes" : ["sip", "PyQt5.QtGui","PyQt5.QtWidgets","PyQt5.QtCore","PyQt5.QtCore"]}})
The script is rather simple. After getting rid of the first error, I might also help with the four other missing modules...
Thanks a lot!
you need to add the following dlls:
C:\Windows\SYSTEM32\msvcp100.dll
C:\Windows\SYSTEM32\msvcr100.dll
C:\Python34\Lib\site-packages\PyQt4\plugins\platforms\qwindows.dll
somethings like this:
data_files = (
('', glob(r'C:\Windows\SYSTEM32\msvcp100.dll')),
('', glob(r'C:\Windows\SYSTEM32\msvcr100.dll')),
('platforms', glob(r'C:\Python34\Lib\site-packages\PyQt4\plugins\platforms\qwindows.dll')),
),
Sorry, the previous answer did not work for me: https://stackoverflow.com/a/37622355/7426109
(and I have different versions)
What did work on the other hand is to add this to your path: "C:\Program Files (x86)\Python38-32\Lib\site-packages\PyQt5\Qt\bin".
My temporary fix:
You copy the "Qt" ("C:\Program Files (x86)\Python38-32\Lib\site-packages\PyQt5\Qt") folder to "dist", and use a batch script to add ".dist\Qt\bin" to PATH in the current CMD window. (of course, this is not perfect, but at least can be executed on another machine)
Info
Windows 10 x64, Python 3.8.6 x32, PyQt5==5.15.1, py2exe==0.10.0.2

Package does not exist - error

I am trying to compile a .java file (TransformRTDE.java) that uses several import statements. These statements import .class files present in five external JAR files: dataextract.jar, jna.jar, JRI.jar, JRIEngine.jar and REngine.jar. I have read documentation on how to deal with these import statements while trying to compile your .java file from the command line. However, I do not seem to succeed.
I set up the directory in the command line to be the folder in which my .java file resides. In that same folder, I have put the JAR files. When I try to compile the code using java -cp dataextract.jar jna.jar JRI.jar JRIEngine.jar REngine.jar TransformRTDE.java, I get a package does not exist error. I have set up the class path to include the folder in which all my .java and .jar files reside.
I have searched for hours on this without success. Any ideas what I'm doing wrong?
Thanks in advance!
EDIT: I forgot to mention I also get an error related to annotation processing.
Picture can be found here: https://www.dropbox.com/s/p9ul0olydzmkl6s/error.png

How to give the path to run a jar file from a servlet?

I am facing a problem in running a jar file from my servlet.
I have to run a jar file of another java application with arguments in a separate sevlet in web project in Eclipse.
I use the code as
Runtime.getRuntime().exec("java -jar myproject.jar param1 param2 abc.xml");
In above code, on running the above jar file with parameters param1 and param2 , it will store output in abc.xml.
But the problem is that i dont know how to give the path of myproject.jar in code.
I copied myproject.jar to the project directory and it does not give any output.
I have tried to use
I dont know how to give path of jar file and where to put the jar file and where the out put file will come .
This code works fine with simple core java application where i put my myproject.jar file in the core java project directory and the output file abc.xml is created in the core java project directory.
Please guide me.
Thanks in advance.
This is not the right way of invoking Java code contained in some JAR in the classpath (I assume that you have placed it in /WEB-INF/lib). Just import and invoke the code contained in that JAR file directly.
import com.packagefromjar.SomeMainClassInJar;
// ...
SomeMainClassInJar.main(new String[] { "param1", "param2", "/path/to/abc.xml" });
Or if that API is well designed, then just use its entry classes directly instead of calling a main() method.

Resources