expat module issue on Sublime Text 2 - sublimetext2

I am using sublime text 2.0.2 on a Debian testing x64, and whenever I try to use the xml ElementTree in a plugin script, it just fails :
ImportError: No module named expat; use SimpleXMLTreeBuilder instead
The Simple XMLTreeBuilder doesn't seem to work either..
But with my system's python ( 2.7.5 and 2.6 ) ElementTree works find.
What can I do to fix that ?

Related

Robotframework: Create Webdriver reports bluetooth_adapter_winrt.cc error

We have developed some tests using a Robotframework Ride 1.7.4 / Python 2.7 environment, and tests are running correctly.
We have now created a new environment using Robotframework ride v2.0b1 / Python 3.8.4 and the following commands are no longer working as expected.
Both environments use robotframework 3.2.1
${options}= Create Dictionary binary=C:/path_to_application/application_name.exe
${caps}= Create Dictionary chromeOptions=${options}
Create Webdriver Chrome desired_capabilities=${caps}
[Arguments] ${url}
${options}= Create Dictionary androidPackage=com.android.chrome
${caps}= Create Dictionary chromeOptions=${options}
Create Webdriver Chrome desired_capabilities=${caps}
We are trying to test "applications" using robotframework .
Instead of starting application_name.exe (in the case of windows app ) or an emulated android client (in the case of android package) we get a chrome browser appearing (for error message see below)
Partial list of libraries we have installed (new environment)
robotframework 3.2.1
robotframework-appiumlibrary 1.5.0.6
robotframework-archivelibrary 0.4.0
robotframework-autoitlibrary 1.2.5
robotframework-difflibrary 0.1.0
robotframework-eyes 1.3.3
robotframework-lint 1.1
robotframework-pabot 1.8.0
robotframework-ride 2.0b1
robotframework-selenium2library 3.0.0
robotframework-seleniumlibrary 4.4.0
robotframeworklexer 1.1
robotremoteserver 1.1
selenium 3.141.0
setuptools 41.2.0
six 1.15.0
soupsieve 2.0.1
tqdm 4.47.0
urllib3 1.25.9
webdriver-manager 3.2.1
webdrivermanager 0.8.0
Werkzeug 1.0.1
wheel 0.34.2
wxPython 4.0.7.post2
chromedriver.exe is the latest version (for Chrome 84)
I have tried using older versions of chromedriver, but this has not fixed the problem.
Libraries used in the "working" environment
robotframework 3.2.1
robotframework-archivelibrary 0.4.0
robotframework-databaselibrary 1.2
robotframework-difflibrary 0.1.0
robotframework-eyes 0.64
robotframework-lint 0.9
robotframework-pabot 0.44
robotframework-ride 1.7.4.2
robotframework-selenium2library 3.0.0
robotframework-seleniumlibrary 4.4.0
robotframeworklexer 1.1
robotremoteserver 1.1
selenium 3.141.0
setuptools 20.10.1
six 1.12.0
urllib3 1.25.10
Werkzeug 0.15.0
wxPython 4.0.4
Thanks
Gwyn
I have simplified things, and just run a few lines of .robot code from the command line robot test.robot (test.robot contains above lines and selenium library reference)
The new environment shows the following error
DevTools listening on ws://127.0.0.1:56934/devtools/browser/426cb694-b5e1-4cc7-ad64-1f47db368449
.[10456:14676:0723/141008.354:ERROR:device_event_log_impl.cc(208)] [14:10:08.358] Bluetooth: bluetooth_adapter_winrt.cc:1074 Getting Default Adapter failed.
Launch Windows NativeApp | FAIL |
Element 'logo' did not appear in 15 seconds.
Original question was mixing up version of Robot Framework IDE (RIDE), with what it seemed to be the version of the framework itself.
The problem you want to solve, is that a Robot Framework test suite script was working in a Python 2.7 configuration, and now it does not, in a Python 3.8 configuration.
You need to make sure, your configuration in Python 2.7 is still working, and take note of the versions of libraries installed there. Then do the same but on Python 3.8 (you already shown those).
This confirmation is independent of the IDE or Editor you use to edit the test suite script. Just focus on running it from the command window/prompt/terminal/shell.
RIDE 1.7.4.2 can be used to run Robot Framework installed either in Python 2.7 or 3.8.
The same happens with RIDE 2.0b1 installed on Python 3.8, it can run Robot Framework installed either in Python 2.7 or 3.8. It all depends on what Robot Framework installation is found first in the PATH environment variable. Or on other words, the actual robot when you open a command window/prompt/terminal/shell and issue the command, for example: robot --version.
Other thing you mention is Appium not working with the style of command you used. The option binary is meant to pass to Webdriver the path of chromedriver or other webdriver like, for example operadriver. I never saw that use to start an mobile phone App.
Looks like chromedriver, just ignored the binary option (because it does not need it).
Resolved by ensuring we only had chromedriver v37 in our path in the "new" environment.
Later versions of Chromedriver (I tried v79, and v84) don't work.

How to install HTML package for python3.7

I want to install HTML package for python3.7 but It's is giving error while installing
I tried command pip install html but getting errors in console
ModuleNotFoundError: No module named 'html.parser'; 'html' is not a package
Command "python setup.py egg_info" failed with error code 1 in C:\Users\username\AppData\Local\Temp\pip-install-apo0cgnw\html\
I am getting the same error: archlinux running a virtualenv. I'm looking around it appears to be a problem with a file in there called 'six.py'. Not sure what the problem is but it appears the project has been orphaned because it was consistently updated until 2011. (Also not sure what all of this code is doing in there, similar libraries like 'vapory' are much smaller. - less bloat, less stuff to go wrong) I would suggest either trying it on Python2.x (since it appears that's where it was developed), contacting the developer, or using a different package.
1) download the .tar.gz file OR .zip file according to your OS from this
link .
2) After downloading , install that downloaded package by the following code : pip install ./downloads/SomeProject-1.0.4.tar.gz
And then again follow the below step
You can import the html package as shown below. pip install is not required, as html comes with the Standard library, post Python v3.x,
>>> from html import HTML
>>> h = HTML()
>>> h.p('Hello, world!')
>>> print h # or print(h) in python 3+
<p>Hello, world!</p>
See the html 1.16 project description for more detail .

Sublime Text 2's phpfmt plugin is not available anymore?

I was used to the phpfmt plugin for Sublime Text, and I'm not able to install it on a fresh installation : the package controller does not seem to find it anymore.
While waiting for a fix, I tried to copy/paste phpfmt folder from Sublime Text's packages folder to my new laptop, but it doesn't seem to work : on the first launch, the plugin is recognized but its directory is deleted.
How can I manually install this plugin ?
As you can see on the Package Control page you linked, the package only supports Sublime Text 3. There's a post on Y Combinator explaining the original author has deleted his version of the package. There is a guide on how to downgrade the package, but I'm not sure that includes Sublime Text 2.

cppcheck in SublimeLinter doesn't work

I'm new to sublime text and I'm stuck with a problem - I installed SublimeLinter via Package Control, and installed cppcheck via sudo apt-get install cppcheck (I'm using linux mint 13). SublimeLinter works fine with python source code, but don't show any vital signs when I save/load .cpp files and ask to show lint errors in C++ source code. What am I doing wrong?
UPD
Here is my sublime text console output:
...
SublimeLinter: c_cpplint loaded
SublimeLinter: C loaded
...
SublimeLinter: c enabled (using "cppcheck" for executable)
SublimeLinter: python enabled (built in)
...
Shall I set up support for .cpp code manually?

Change python interpreter - Sublime Text 2

I just started using Sublime Text 2 and was wondering, to sort of make it a full featured python IDE, if there was a way to change the integrated python interpreter to target the system python install rather than the one that came with Sublime. The reason is because I would like to use my python libraries that I have on my computer with the python interpreter.
I am aware of running python code in sublime using my version of python as explicitly shown here: How do I run Python code from Sublime Text 2?
However, this does not change the version of the python interpreter that you are running.
Any ideas?
Tools > Build System > New Build System. Insert the file and with your python version:
{
"cmd": ["python3", "-u", "$file"],
"file_regex": "^[ ]*File \"(...*?)\", line ([0-9]*)",
"selector": "source.python"
}
According to the documentation referenced by the Sublime Text website itself, the embedded Python intrepreter is not intended for general development. This restricted usage recommendation even applies to ST2 for OS X, which is the only version that does use the system's Python version. So it's probably better to use the Build System workflow, or use a ST plug-in. Or switch to a purpose-built IDE.