Sublime text 2 build tools - nothing happens - build

I've tried to use sublime text 2 to write lua\corona program, but I've faced with a problem.
When i add a build tool with such a text:
{
"cmd": ["C:/Program Files/Corona Labs/Corona SDK/Corona Simulator.exe", "main.lua"]
}
After F7 or ctrl+b or build button in menu - only blank small window shows and "Building" text appears on bottom of the window - nothing else happen (even when I try to check other available build tools).
I even try to put other commands in "cmd" - this blank field on the bottom of sublime still blank and this simulator doesn't appear (if I write in command line "C:/Program Files/Corona Labs/Corona SDK/Corona Simulator.exe" simulator starts).
UPDATE
I've opened console and there is some log:
Running C:/Program Files/Corona Labs/Corona SDK/Corona Simulator.exe main.lua
Traceback (most recent call last):
File ".\sublime_plugin.py", line 337, in run_
File ".\exec.py", line 154, in run
File ".\exec.py", line 45, in __init__
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc4 in position 7: ordinal not in range(128)

Try this : http://www.sublimetext.com/forum/viewtopic.php?f=3&t=8512
In Packages/Default/exec.py at line 45
Replace :
proc_env[k] = os.path.expandvars(v).encode(sys.getfilesystemencoding())
With :
os.path.expandvars(v.decode(sys.getfilesystemencoding())).encode(sys.getfilesystemencoding())

Related

Spyder Launch Error [UnicodeDecodeError] : ubuntu 14.04; Anaconda4.2; Python 2.7.12; Spyder 3

When I run spyder on command line, I got error message like below.
Traceback (most recent call last): File
"/home/park/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py",
line 2998, in main
mainwindow = run_spyder(app, options, args) File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py",
line 2902, in run_spyder
main.setup() File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py",
line 1153, in setup
self.setup_layout(default=False) File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py",
line 1414, in setup_layout
self.setup_default_layouts('default', settings) File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/app/mainwindow.py",
line 1593, in setup_default_layouts
widget.toggle_view(True) File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/plugins/ipythonconsole.py",
line 677, in toggle_view
self.create_new_client(give_focus=False) File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/plugins/ipythonconsole.py",
line 886, in create_new_client
self.connect_client_to_kernel(client) File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/plugins/ipythonconsole.py",
line 903, in connect_client_to_kernel
km, kc = self.create_kernel_manager_and_kernel_client(connection_file) File
"/home/park/anaconda2/lib/python2.7/site-packages/spyder/plugins/ipythonconsole.py",
line 1276, in create_kernel_manager_and_kernel_client
kernel_manager._kernel_spec = self.create_kernel_spec() File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/plugins/ipythonconsole.py",
line 1256, in create_kernel_spec
uv = to_text_string(v) File "/home/park/anaconda2/lib/python2.7/site-packages/spyder/py3compat.py",
line 136, in to_text_string
return unicode(obj) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 73: ordinal not in range(128)
I have been searching the solution but I can not get the solution.
I have tried :
Reinstall using "pip install spyder"
Reinstall using "conda install spyder"
How do I fix it. If you give me some ideas, I can really appreciate for this.
Thanks.
I also had some problems with Spyder 3 on Ubuntu 14.04. So I uninstalled it and reinstalled Spyer 2, which then worked just fine for me. If you don't mind using Spyder 2, you can run the following command to see if it works for you
conda install -c spyder-ide spyder=2.3.9

Error in Tkinter; TclError: missing newline on line...)

I am really working with a bigger program in Tkinter but this code raises the same error:
import Tkinter as tk
root=tk.Tk()
root.title('ROOT')
root.configure(background='blue')
root.option_readfile('tkinter_style_sheet.txt')
Button(root, text='Press Me!' ).grid(row=1, column=1)
mainloop()
The "tkinter_style_sheet.txt" in question, is a .txt file written in Notepad whith text as follows:
*font: Times 8 bold
*Button*font: Times 10 bold
*Button*borderwidth:3
*Button*relief: raised
*Button*width: 3
*Button*height: 1
*Button*pady:3
With the given text file and code, I receive the following output:
Traceback (most recent call last):
File "C:/Python27/problem_with_tkinter.py", line 7, in <module>
root.option_readfile('tkinter_style_sheet.txt')
File "C:\Python27\lib\lib-tk\Tkinter.py", line 658, in option_readfile
self.tk.call('option', 'readfile', fileName, priority)
TclError: missing newline on line 7
I don't understand the error, I tried adding a '\n' character at line 7 but, not surprisingly, it didn't solve the problem. Anyone having an idea what's wrong?
do this on line 7:
*font:Times 8 bold
*Button*font:Times 10 bold
*Button*borderwidth:3
*Button*relief: raised
*Button*width: 3
*Button*height: 1
*Button*pady:3
enter a newline after the end of the last line.

Trouble with pip install selenium

I have Vista(please avoid comment ;D)... I'm sure of the right install of pip because I have installed other package but when I try to install selenium by pip that's the result.:
C:\Program Files\Python2.7.6>pip install selenium
Downloading/unpacking selenium Running setup.py
(path:c:\users\gianlu~1\appdata\local\temp\pip_build_Gianluca
«\selenium\setup.py) egg_info for package selenium
Cleaning up...
The line below are in red(this is my comment)
Exception:
Traceback (most recent call last):
File "C:\Program Files\Python2.7.6\lib\site-packages\pip\basecommand.py", line
122, in main
status = self.run(options, args)
File "C:\Program Files\Python2.7.6\lib\site-packages\pip\commands\install.py",
line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundl
e=self.bundle)
File "C:\Program Files\Python2.7.6\lib\site-packages\pip\req.py", line 1234, i
n prepare_files
req_to_install.assert_source_matches_version()
File "C:\Program Files\Python2.7.6\lib\site-packages\pip\req.py", line 464, in
assert_source_matches_version
% (display_path(self.source_dir), version, self))
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 65: ordinal
not in range(128)
End of the red
Traceback (most recent call last):
File "C:\Program Files\Python2.7.6\lib\runpy.py", line 162, in _run_module_as_
main
"__main__", fname, loader, pkg_name)
File "C:\Program Files\Python2.7.6\lib\runpy.py", line 72, in _run_code
exec code in run_globals
File "C:\Program Files\Python2.7.6\pip.exe\__main__.py", line 9, in <module>
File "C:\Program Files\Python2.7.6\lib\site-packages\pip\__init__.py", line 18
5, in main
return command.main(cmd_args)
File "C:\Program Files\Python2.7.6\lib\site-packages\pip\basecommand.py", line
161, in main
text = '\n'.join(complete_log)
UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 80: ordinal
not in range(128)
I'm new of Phyton and that is over for me. The only thing that I can suppose and investigate is that the matter is about the last line "Unicode...".
Thank you for any suggestion.
Yes, really a bad question. I was very tired after a code marathon ;D. Starting from my edit of investigate the unicode error and only after a few hours of sleep I find a lot of intresting and working solution. Here the more considerable and useful link:
Python ez_install : UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 11
UnicodeDecodeError : 'ascii' codec can't decode byte 0xe0 in position 0: ordinal not in range(128)
pip install tabulate UnicodeDecodeError

encoding errors when replacing unwanted characters in utf-8 encoded file

Code can be downloaded here:
https://github.com/kelrien/pyretrieval/
whenever I execute my example.py, the following error pops up:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "example.py", line 21, in <module>
docs.append(proc.process(line.decode("utf-8")))
File "pyretrieval\processor.py", line 61, in process
tokens = self.tokenize(string)
File "pyretrieval\processor.py", line 47, in tokenize
temp = temp.replace(char, self.replace_characters[char])
UnicodeDecodeError: 'ascii' codec can't decode byte 0xfc in position 0: ordinal not in range(128)
As you can see - the error happens when trying to replace german umlauts I specified. If I don't use the replace_characters dict and just ignore those umlauts, I'm not getting the error.
I already tried a lot of stuff:
Using the codecs module
Using encode("utf-8") and decode("utf-8") at different
I found a solution. I had to encode the characters I wanted to replace in unicode too(in processor.py).
I already pushed the necessary changes to github. https://github.com/kelrien/pyretrieval

portia (scrapy/slybot) errors on windows

i installed portia and got it to work i annotated some websites (looks really good)
but when i try to run the spiders i get some errors and nothing gets crawled
im running python 2.7.6 on win 7
C:\Python27\Scripts>python portiacrawl C:\portia\slyd\data\projects\new_project
Traceback (most recent call last):
File "portiacrawl", line 7, in <module>
execfile(__file__)
File "C:\portia\slybot\bin\portiacrawl", line 56, in <module>
main()
File "C:\portia\slybot\bin\portiacrawl", line 54, in main
subprocess.call(command_spec)
File "C:\Python27\lib\subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "C:\Python27\lib\subprocess.py", line 709, in __init__
errread, errwrite)
File "C:\Python27\lib\subprocess.py", line 957, in _execute_child
startupinfo)
WindowsError: [Error 2] O sistema nÒo conseguiu localizar o ficheiro especificado
I am troubleshooting portia on Windows 8.1 and encountered the same error, exactly.
Try running 'python portiacrawl' by itself to determine if there is a subsequent menu. You should be able to see Help info on 'portiacrawl'. I suspect that you need to name the [spider] & [options] as well as change the terminal directory to see the output from the crawler. I suggest trying the following but rename [spider] to actual name of your spider w/o brackets:
Enter into terminal: C:\portia\slyd\data\projects <------Change to proper directory in cmd
Make sure you are in the terminal directory "C:\portia\slyd\data\projects"
The Cmd propmpt should look like: C:\portia\slyd\data\projects> <----waiting for portia initiation.
Enter into terminal:
python portiacrawl C:\portia\slyd\data\projects\new_project [spider] -t csv -o test.csv; or,
python portiacrawl [spider] -t csv -o test.csv
Report back. I am curious as to the terminal response. Did it initiate portiacrawl & return "access is denied."