I've recently imported one of my projects to another computer. It uses the same jdk(Java8u40) and IDE (Netbeans 8.0.2) as the previous machine. However, after I've imported the project, it appears that the TextFormatter class is missing. I'm not sure why it would be missing a single import from the same .jar file.
My imports:
import javafx.scene.control.TextFormatter;
import javafx.scene.control.TextFormatter.Change;
Error Message:
error: cannot find symbol import javafx.scene.control.TextFormatter;
symbol: class TextFormatter
location: package javafx.scene.control
Any help would be appreciated. Thank you.
Related
Used the following import on Jupyter for API:
import requests
But got the following error:
ImportError: No module named requests
Is there a way around this?
I trying to make SqlSensor to work with Oracle database, I've installed all the required provider and successfully tested the connection. When I run SqlSensor I got this error message
ERROR - Failed to execute job 32 for task check_exec_date (The connection type is not supported by SqlSensor. The associated hook should be a subclass of `DbApiHook`. Got OracleHook; 419)
I'm running Apache Airflow version 2.3.3 and installed Oracle provider apache-airflow-providers-oracle version 3.2.0
TL;DR:
You are probably importing the sensor as:
from airflow.sensors import SqlSensor
Which cause the issue.
If you will import as
from airflow.providers.common.sql.sensors import SqlSensors
It will work.
Full Details:
There is a bug in apache-airflow-providers-common-sql==1.0.0 which causes
from airflow.sensors import SqlSensor not to work properly.
The bug is fixed in https://github.com/apache/airflow/pull/25293
thus upgrading to apache-airflow-providers-common-sql>1.0.0 will allow also the old import style.
Regardless of the bug, you should use
from airflow.providers.common.sql.sensors import SqlSensors
as from airflow.sensors import SqlSensor is deprecated.
I have written a Dag file with contain ssh hook implementation.
I get import error in the DAG file
File "/usr/local/lib/python3.6/dist-packages/paramiko/transport.py", line 91, in
from paramiko.dsskey import DSSKey
File "/usr/local/lib/python3.6/dist-packages/paramiko/dsskey.py", line 25, in
from cryptography.hazmat.primitives import hashes, serialization
ImportError: cannot import name 'serialization'
how to resolve this?
thanks in advance
Sundar
I've installed Qt5.2.1 / SIP 4.5.15 and PyQt5 on my Ubuntu 12.4 desktop. Everything seemed OK until I try to import QtWebKitWidgets. This module is very important in my code.
>>> from PyQt5 import QtWebkitWidgets
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: cannot import name QtWebkitItems
>>>
No error raised during the installation phase. in my /opt/Qt5.2.1/5.2.1/gcc_64/lib directory I can see the corresponding Qt libs.
Does anyone have an idea ?
Thank you in advance
I'm not sure where you're getting "QtWebkitItems" from (a web-search gets no hits other than this page), but the real problem is a simple typo. The import statement should be:
from PyQt5 import QtWebKitWidgets # upper-case K!
PS: it's nicely ironic that you managed to spell it right in your question, and even highlighted it in bold!
I've just migrated from the Python 2.5 to the 2.7 runtime, and most of server I've written runs fine. However I'm occassionaly seeing this odd stack trace (I've hacked it down for brevity):
ERROR 2013-04-23 10:40:15,598 wsgi.py:235]
Traceback (most recent call last):
File "/Applications/GoogleAppEngineLauncher.app/Contents/Resources/GoogleAppEngine-default.bundle/Contents/Resources/google_appengine/lib/jinja2-2.6/jinja2/environment.py", line 894, in render
return self.environment.handle_exception(exc_info, True)
File "templates/querystart.html", line 30, in top-level template code
{% for session in sessions %}
ImportError: No module named _sqlite3
I've not imported sqlite3 myself, and I don't rely on it. The code that's calling it is pretty simple (perhaps bordering on the dumb side of things):
class UserIdQuery(BaseHandler):
def get(self):
sessionQuery=Session.all().order("userid")
template_values = {
'sessions': sessionQuery,
}
self.render_template('querystart.html',**template_values)
The above simply extends the below (taken from a very helpful migration tutorial)
class BaseHandler(webapp2.RequestHandler):
#webapp2.cached_property
def jinja2(self):
return jinja2.get_jinja2(app=self.app)
def render_template(self, filename, **template_args):
self.response.write(self.jinja2.render_template(filename, **template_args))
Anyone know what might be triggering the import error? Thanks,
Appengine uses sqlite for the datastore, my bet is your python2.7 installed on OSX is missing the sqlite binary library. Do a quick test, start a python interpreter (outside of appengine) and try to import sqlite3
$ python
Python 2.7.3 (default, Sep 26 2012, 21:53:58)
[GCC 4.7.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlite3
>>>
If that fails you know you have an incomplete 2.7 runtime installed.
I was having the same problem and fixed it.
I was running python 2.7.3 that I installed from Ninite.com.
Uninstalled python, downloaded and installed 2.7.5 installer directly from python.org and problem has gone away.