Unexpected Keyword Argument 'bind'. ipython-sql magic - python

I've just downloaded ipython-sql, and I'm trying to run sql in jupyter notebook. I've verified that I've installed the package and the path locations of the files. I keep getting an error that I need to query with SQLAlchemy format.
enter image description here
What's going wrong here? I just downloaded ipython-sql and I've had friends run the exact same code and it works.
Thanks

Related

cannot load CSVs or Excel files after some updates

I was trying to schedule a new python code by running with a BAT file, but was getting an error that the statsmodels package was not present. The package loaded fine in Spyder, but not when running from a BAT file. I followed a thread here that suggested updating my packages in console (pip command) which I did.
That led to a new error that NumPy was not loading. I noticed that I now had 2 versions of NumPy (1.19.1 and 1.19.2). Further searches yielded advise to uninstall and reinstall NumPy. I had to uninstall twice to get rid of both versions, then installing left me with 1.19.2.
Now, when I run my code in Spyder, I get a strange error on pd.read_csv:
"Only callable can be used as callback"
I couldn't find anyone getting this error from pd.read_csv. Next, I tried to run pd.read_excel in Spyder, but I get this error message:
"int() argument must be a string, a bytes-like object or a number, not '_NoValueType'"
This is code that worked fine yesterday on files that have not changed, so it is not the files. I even made a couple test files and get the same error. Trying to load statsmodels in Spyder now fails:
"from statsmodels.tsa.ar_model import AutoReg"
"AttributeError: module 'numpy.core' has no attribute 'records'"
Running the same code in BAT, reading csv and excel files DO work, but still hangs up on loading statsmodels.
I think at this point, I need to reload Anaconda, but I don't understand why code that works in Spyder does not work running from BAT file, when I am referencing the only copy of python that I have in Anaconda.
Thanks,
It seems to be fine today, so perhaps I needed a full reboot to implement the updates? I don't remember doing this in the past.
I'm still having the original issue with loading the statsmodels package when running from BAT file, but I will ask that in a new post.

code execution cannot complete as python38.dll not found

i have no idea what i have done to cause this but when running C:>python .... (image 1) i get this error (image two)
i've tried repairing the install and running a full scan for any viruses and it's all going normal but then i still get this error
image 1:
image 2:
i'd just like to thank anyone who may be able to help in advance too!
When you type py command Python 3.9.2 is launched. However, when you type python the error message shows that python38.dll wasn't found which is a different version. It seems like you had different versions of Python and maybe some uninstallation process went wrong.
Are you able to check what do you have on PATH? The issue might be there. You can also try to uninstall all Python-related apps and install a fresh Python 3.9

pack individual .jpg image files into RecordIO (.rec) files

I'm trying to go through the MXNET tutorial (https://statist-bhfz.github.io/cats_dogs_finetune), but have trouble making the RecordIO ".rec" files used to process the pictures.
I have tried the suggested approach:
python C:/mxnet-20170203/tools/im2rec.py --list=1 --recursive=1 --train-ratio=0.8 cats_dogs train_pad_224x224
python C:/mxnet-20170203/tools/im2rec.py --num-thread=4 --pass-through=1 cats_dogs_train.lst train_pad_224x224
python C:/mxnet-20170203/tools/im2rec.py --num-thread=4 --pass-through=1 cats_dogs_val.lst train_pad_224x224
But i get the error: "AttributeError: 'module' object has no attribute 'MXIndexedRecordIO'"
when doing so.
Is there a way to generate the ".rec" files in R directly? And if not, how do i get pass the error?
Thanks.
Kr,
Daniel
The error you are getting seems related to the fact that you are trying to use a newer version of im2rec.py than the one that came with your installed version of mxnet, hence the missing modules.
try using the im2rec.py script located in your own mxnet installation folder, somewhere like this python2.7/site-packages/mxnet/tools/im2rec.py
Also note that if you upgrade your version of mxnet, the syntax of im2rec has changed to:
im2rec.py --list --recursive --train-ratio=0.8 cats_dogs train_pad_224x224

Thrift error while generating python client file

I'm new to Hbase and I would like to comunicate with it throught a python API which works with Thrift. I've followed this tutorial in order to install it properly on my machine, everything seemed to worked fine then I generated a .thrift file with the following command:
wget http://svn.apache.org/viewvc/hbase/trunk/hbase-thrift/src/main/resources/org/apache/hadoop/hbase/thrift/Hbase.thrift\?view\=markup
-O hbase.thrift
Then I tried to generate my client like it's showed here but i get the following error message:
[ERROR:/home/tests/hbase/hbase.thrift:12] (last token was '<')
syntax error
[FAILURE:/home/tests/hbase/hbase.thrift:12] Parser error during include pass.
I tried to lookup on internet what was the cause of this error and found this paper, I tried to lookup in thriftl.ll to see if I could correct the error but I found that the correction was already present in the file.
What can I do more in order to make this work ?
Thank you !
EDIT:
I'm using thrift 0.9.0
Using a fairly recent Thrift version and more importantly the proper URL I was able to generate Python sources without errors.
Please check if your download is actually a Thrift file or if it is a HTML source. The error message sounds very much like that, since HTML pages typically start with an <, and the right Thrift file contains the first < at line 110 (within list<Mutation>), not around line 12.
PS: Why are you using such an old version? 0.9.1 was released a year ago and 0.9.2 is actually in the process of being released.
PPS: Actually, the referenced ticket THRIFT-1274 seems not have much to do with it. But maybe I'm overlooking something.

pyrouge: 'pyrouge_set_rouge_path' is not recognized as an internal or external command

I have Windows 7 and use Python 2.7. I recently installed ROUGE (Recall-Oriented Understudy for Gisting Evaluation) in order to evaluate summaries that I have.
Unfortunately, my summaries are in .txt format, and wouldn't work with ROUGE. I therefore, installed pyrouge from pypi.
In the same website above, they have installation steps. I followed the first step, which was to use pip install. The next step says:
"Assuming a working ROUGE-1.5.5. installation, tell pyrouge the ROUGE path with this command:
pyrouge_set_rouge_path /absolute/path/to/ROUGE-1.5.5/directory"
I try that line in the command prompt:
pyrouge_set_rouge_path C:\rouge
Yet I keep getting this error:
'pyrouge_set_rouge_path' is not recognized as an internal or external command, operable program or batch file.
Any help in this matter is greatly appreciated.
Thanks
Try this:
set pyrouge_set_rouge_path=C:\rouge
Although it is an old questions, there are probably still people looking for the answer.
"Assuming a working ROUGE-1.5.5. installation" does not correspond to your pyrouge installation. It references to the following. (Maybe you got that right immediately, I did not)
https://github.com/andersjo/pyrouge/tree/master/tools/ROUGE-1.5.5
pyrouge_set_rouge_path is a script, not a variable you have to set.
The script is located at Python_PATH\Scripts.
Hence try something like:
python Python_PATH\Scripts\pyrouge_set_rouge_path C:\rouge

Categories