Tableau SDK TableException (40200) - python

Issue: Error being thrown: tableausdk.Exceptions.TableauException: TableauException (40200): The system cannot find the path specified.
- OS::mkdir(CreateDirectory path="C:\PATH\Tableau-SDK\tdetmp2A0E0E5E")
I am attempting to to create a tableau extract from oracle data using python and the tableauSDK.
The code seems to run correctly if the extract already exists. (although the produced tde is unreadable)
According to the Tableau community I should be able to create an extract from any source data without the extract already existing...
Any idea on why this is occuring?
tde_path = r'C:\PATH\test.tde'
tde_file = Extract(path=tde_path) ## ERROR Thrown here

The reason now seems obvious...
The error had the answer :
OS::mkdir(CreateDirectory path="C:\PATH\Tableau-SDK\tdetmp2A0E0E5E")
To solve the issue :
The Directory C:\PATH\Tableau-SDK\ did not exist.
Created the Directory and the code ran without error.

Related

"Spark 2.4.3 S3 MultiObjectDeleteException " in sparklyr

I am really struggling with this error which I keep getting whenever I try to do the following . And I tried all the suggestions provided in the old links as well , but in vain.
spark_write_csv(final_data_3,path = "mypath",header = T,mode = "overwrite",infer_schema=F)
This is the error I get
Spark 2.4.0 S3 MultiObjectDeleteException
I was reading through old answers for similar problem and it suggested it should below configuration in settings to avoid this error .
I added this and I also used true in place of false in script , still am getting same error .
hconf %>% sparklyr::invoke("set","fs.s3a.multiobjectdelete.enable","false")
Any suggestions to address this error ?

Chaquopy problems with nltk and download

According to Chaquopy Not able to download Resource i'm not sure if the problem got solved.
So here is question in the nltk context.
After including one of the nltk.download line:
nltk.download('popular')
or
nltk.download('punkt')
or
nltk.download('all')
I get this stack trace:
2020-08-26 13:33:45.742 19765-19765/com.pro.useyournotes E/ExceptionTag: com.chaquo.python.PyException: BadZipFile: File is not a zip file
com.chaquo.python.PyException: BadZipFile: File is not a zip file
at <python>.zipfile._RealGetContents(zipfile.py:1335)
at <python>.zipfile.__init__(zipfile.py:1268)
at <python>.nltk.data.__init__(data.py:936)
at <python>.nltk.compat._decorator(compat.py:41)
at <python>.nltk.data.__init__(data.py:396)
at <python>.nltk.compat._decorator(compat.py:41)
at <python>.nltk.data.find(data.py:544)
at <python>.nltk.data.find(data.py:557)
at <python>.nltk.tag.perceptron.__init__(perceptron.py:168)
at <python>.nltk.tag._get_tagger(__init__.py:106)
at <python>.nltk.tag.pos_tag_sents(__init__.py:178)
at <python>.uyn_pre_processing.pre_processing(uyn_pre_processing.py:88)
at <python>.uyn_analysis_workflow.analyse_new_data(uyn_analysis_workflow.py:62)
at <python>.uyn_main.main(uyn_main.py:266)
at <python>.chaquopy_java.call(chaquopy_java.pyx:285)
at <python>.chaquopy_java.Java_com_chaquo_python_PyObject_callAttrThrows(chaquopy_java.pyx:257)
at com.chaquo.python.PyObject.callAttrThrows(Native Method)
at com.chaquo.python.PyObject.callAttr(PyObject.java:209)
at com.pro.useyournotes.MainActivity.getPythonHello(MainActivity.kt:70)
at com.pro.useyournotes.MainActivity.onCreate(MainActivity.kt:59)
at android.app.Activity.performCreate(Activity.java:7136)
at android.app.Activity.performCreate(Activity.java:7127)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2893)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3048)
at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1808)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6669)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
The code where this error occurs is:
tagged_words=nltk.pos_tag_sents(tokenized_sentences)
at <python>.uyn_pre_processing.pre_processing(uyn_pre_processing.py:88)
I also don't know where the nltk-files are placed. Earlier when i just programmed on the python side i onlyremember using the import nltk command. Hopefully some already found a solution for using nltk.
I was able to reproduce something similar on the emulator. In my case the root cause was that the download failed with a DECRYPTION_FAILED_OR_BAD_RECORD_MAC error, leaving behind an incomplete ZIP file.
This appears to be a low-level problem with the emulator which isn't specific to Python. If you can confirm you have the same problem (by seeing DECRYPTION_FAILED_OR_BAD_RECORD_MAC in the nltk.download logcat output), then please add a star on the Android issue tracker here, to help encourage them to fix it.
You can work around this by calling nltk.download repeatedly in a loop until it returns true. To save time, you should probably only download the data files you need. You can find out what these are by simply calling the corresponding function and looking at the error message, e.g.:
>>> nltk.pos_tag_sents([["hello", "world"]])
...
LookupError:
**********************************************************************
Resource [93maveraged_perceptron_tagger[0m not found.
Please use the NLTK Downloader to obtain the resource:
[31m>>> import nltk
>>> nltk.download('averaged_perceptron_tagger')
Then you can add this to your code:
while not nltk.download('averaged_perceptron_tagger'):
print("Retrying download")
This succeeded after a few iterations, and I was then able to call nltk.pos_tag_sents successfully.
Add this to your python script:
while not nltk.download('punkt'):
return ("Retrying download punkt")
Also in your AndroidManifest don't forget to add these permissions:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

How can I parse system hive on Python?

My objective is to analyze interest files from windows registries and output useful information.
I already have it for SOFTWARE registers and it worked perfectly, however it doesn't seem to work for SYSTEM registers.
When I apply the same method an error message came up;
"RAISE PARSE EXCEPTION ( FORMAT NOT SUPPORTED)"
So the problem seems to raise when I declare the system hive and registry variable
In the following code, 'ifind()' method is my own method which allows to ignore case sensitive.
I also show you lines which worked for software registry. 'softhive' and 'softreg' are working but the error is raised on the last line
softhive = ifind(os_root + os.sep + 'WINDOWS/system32/config/software')
softreg = Registry.Registry(softhive)
syshive = ifind(os_root + os.sep + 'WINDOWS/system32/config/system')
sysreg = Registry.Registry(syshive) <==
Actual result is shown as following in my log:
Registry.registry Excpetion format not supported

WEKA - Cant read CSV generated with Python pandas

I've been working on some dataframes with Python. I load them in using readCSV(filename, index=0) and it's all fine. The files also open fine in Excel. I also opened them in notepad, and the seem alright; below is an example line:
851,1.218108787,0.636454978,0.269719611,-0.849476404,-0.143909689,0.050626813,-0.094248374,-0.3096134,-0.131347142,0.671271112,0.167593329,0.439417259,-0.198164647,-0.031552824,-0.215189948,-0.1791156,0.092648696,-0.107840318,-0.162596466,0.019324121,0.040572892,-0.008307331,-0.077819297,-0.023809355,-0.148229913,-0.041082835,0.138234498,-0.070986117,0.024788437,-0.050982962,0.24689969,0
The first column is as I understand it an index column. Then there's a bunch of Principal Components, and at the end is a 1/0.
When I try and load the file into WEKA, however, it gives me a nasty error and urges me to use the converter, saying:
Reason:
32 Problem encountered on line: 2
When I attempt to use the converter with the default settings, it states a new error:
Couldn't read object file_name.csv invalid stream header: 2C636F6D
Could anyone help with any of this? I can't provide the entire data file but if requested I can try and maybe cut out a few rows and only paste those if the error still occurs. Are there any flags I need to specify when saving a file to CSV in python? At the moment I just use a .toCSV('x.csv').
I think the index column not having an issue would prevent weka from reading it, when you write using pandas.to_csv() set the index = False
df.to_csv(index = False)

create vm on opennebula with python api

As the title says, i am trying to create a vm on opennebula with the python api. (this is my first time working with one and i have zero clue of anythings, so plz be not too hard with me)
#!/usr/bin/python3
import oca
client = oca.Client('username:passwd', 'ip:2633/RPC2')
oca.VirtualMachine.allocate(client, 'test')
#'test' is the name of the template i want to use
it gives me this error:
oca.exceptions.OpenNebulaException: [VirtualMachineAllocate] Error allocating a new virtual machine. Parse error: syntax error, unexpected $end, expecting EQUAL or EQUAL_EMPTY at line 1, columns 1:5
anyone an idea how to fix this?
thanks in advance.
ok.. i am stupid and have searched only after 4h trying in the right place --> the git repository and the 'issues' tab.
vm_templ = oca.VmTemplatePool(client)
vm_templ.info()
for templ in vm_templ:
if templ.name == "Ubuntu 14.04 - KVM":
templ.instantiate("oca-test")
that is a way you can create a vm of an existing template via python.
(the connection part is missing, but that is trivial).
i don't delete this question, perhaps somebody out there will have a hard time too with this.

Categories

Resources