When i try to execute gpload from Windows based ETL host.
Using gpload in a Windows environment produces the following error:
Error I Get:
gpload.py -f gpload.yml
gpload was unable to import The PyGreSQL Python module (pg.py) - DLL load failed with error code 193
You should check whether your pygresql installed correctly or not. Because from the gpload code
try:
from pygresql import pg
except Exception, e:
errorMsg = "gpload was unable to import The PyGreSQL Python module (pg.py) - %s\n" % str(e)
sys.stderr.write(str(errorMsg))
sys.exit(2)
we can know that this is an error about import pygresql (installed or not, version is right ?). If pygresql installed correctly, whether python version or PATH is right ? Please check them.
Related
I am trying to run the demo program for the python module Dominate. It is supposed to create an html file using python code.
(python 3.6.13 from microsoft store)
import dominate
from dominate.tags import *
doc = dominate.document(title='Dominate your HTML')
with doc.head:
link(rel='stylesheet', href='style.css')
script(type='text/javascript', src='script.js')
with doc:
with div(id='header').add(ol()):
for i in ['home', 'about', 'contact']:
li(a(i.title(), href='/%s.html' % i))
with div():
attr(cls='body')
p('Lorem ipsum..')
print(doc)
I ran 'pip install dominate' and it installed successfully.
When I try to run this code, it gives me the following error:
I tried to run 'pip install dominate.tags', but it says that there is no such module.
What could be the problem?
Thanks for your help.
I try to deploy some .yaml file with code of Kubernetes, but get error
TASK [/cur/develop/inno/777/name.k8s/roles/deploy_k8s_dashboard : Apply the Kubernetes dashboard] **************************************************************************************************************************************************************************************
Monday 17 October 2022 13:52:07 +0200 (0:00:00.836) 0:00:01.410 ********
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named kubernetes.dynamic.resource
fatal: [cibd1]: FAILED! => changed=false
error: No module named kubernetes.dynamic.resource
msg: Failed to import the required Python library (kubernetes) on bvm's Python /usr/bin/python. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: ImportError: No module named kubernetes.dynamic.resource
fatal: [cibd1]: FAILED! => changed=false
error: No module named kubernetes.dynamic.resource
msg: Failed to import the required Python library (kubernetes) on bvm's Python /usr/bin/python. Please read the module documentation and install it in the appropriate location. If the required library is installed, but Ansible is using the wrong Python interpreter, please consult the documentation on ansible_python_interpreter
Could you please help with advice, How can I fix it?
I've had a similar problem. locally I had to execute the following
ansible-galaxy collection install kubernetes.core
On the target server make sure that you have python3 installed as python2 won't be enough. Once that is installed, I also had to define the below in my vars:
ansible_python_interpreter: /bin/python3
This question already has answers here:
Invalid syntax (SyntaxError) in except handler when using comma
(5 answers)
Closed last month.
I have installed Python 3.6 or 3.7 with Cassandra 3.11.3.
But it does not supporte cqlsh, it only supports the Python 2.7 version.
This is the error message:
\apache-cassandra-3.11.3\bin\\cqlsh.py", line 146
except ImportError, e:
^
SyntaxError: invalid syntax
What may be the problem?
Change
except a, b:
to
except a as b:
Add parens to prints
Change:
except ImportError, e:
To:
except ImportError as ex:
or
except ImportError:
Cqlsh is written in Py2.7, so it'll not build on py3 wrapper env. Even if you change the exception line, it'll not compile the. For example, take this line:
File "/home/usr/.local/bin/cqlsh", line 212
print '\nWarning: Specified cqlshrc location `%s` does not exist. Using `%s` instead.\n' % (CONFIG_FILE, HISTORY_DIR)
^
SyntaxError: invalid syntax
Optional solutions:
Downgrade your python version using sudo-alternatives (check versions with update-alternatives --list python)
Correct the entire file (not viable)
Connect throug datastax or similar driver and query.
If you have the both version, set the Python2.7 as the main one. You can check the principal version using the command python -V. Then change using this command sudo ln -sf /usr/bin/python3.6 /usr/bin/python (use your path python 3x and 2x). Check if it was ok using python -V. Call the $cqlsh again.
Ps.: If necessary check the cqlsh file, if the header is correct. If it is #!/usr/bin/python3 fix to #!/usr/bin/python. You can use $find / -name cqlshto find the files.
I just want to get status from gammu
import gammu.smsd
smsd = gammu.smsd.SMSD('/etc/gammu-smsdrc')
print smsd.GetStatus()
I saved code to /home/pi/mypython.py
and ran it from terminal
sudo pyhton /home/pi/mypython.py
I'm getting an error
ImportError : No module named gammu.smsd
My target is getting Gammu Status, then if gammu status is stopped I will start it automaticly from other python code.
I was trying:
service gammu-smsd status
Result: No help - just shown usage of gammu-smsd
service --status-all
Result: I'm getting [?] gammu-smsd < unknown is started or stopped
'
Whats wrong with my code? Is there any step I need to do?
The python bindings are separate package, so you need to install it separately even if you already have Gammu installed.
In my virtualenv, where I have pyodbc installed, when trying to import pyodbc in python it returns this error.
ImportError:
dlopen(/Users/junruchen/.python-eggs/pyodbc-3.0.7-py2.7-macosx-10.9-intel.egg-tmp/pyodbc.so, 2):
Symbol not found: _GetPrivateProfileString
Referenced from: /usr/lib/libiodbc.2.dylib
Expected in: flat namespace
I have no idea what's going on, I checked site-packages in the venv/lib/python2.7 and the pyodbc files are there. Can anyone direct me to the right path?
I have downloaded iODBC and installed it on the system
then I installed pyodbc by downloading the source and running:
$python setup.py build
$python setup.py install
I did this both within and outside of the virtualenv and neither seems to be working. Both are giving me the same error.
when I open iodbctest I get:
iODBC Demonstration program
This program shows an interactive SQL processor
Driver Manager: 03.52.0709.0909
Enter ODBC connect string (? shows list): ?
DSN | Driver
------------------------------------------------------------------------------
Enter ODBC connect string (? shows list):
does this mean that I haven't done the configuration properly?