I'm trying to create a database with MSAccess using pypyodbc on Ironpython. I have this working perfectly fine on my old machine, but I must migrate to a new machine. However on the new machine I get an exception trying to run the same script.
Using python I can create a database without errors.
ipy
import pypyodbc
pypyodbc.win_create_mdb('C:\database.mdb')
pypyodbc.connect('Driver={Microsoft Access Driver (*.mdb)};DBQ=C:\database.mdb;')
However, if I try the same using ipy64 I get an Exception
"Access Driver is not found"
Traceback (most recent call last):
File "", line 1, in
File "C:\IronPython27\pypyodbc.py", line 2564, in win_create_mdb
Exception: Access Driver is not found.
I installed the AccessDatabaseEngine_x64 as I have 64-bit office products installed.
Thanks,
John.
Related
I'm trying to run this project
on my Raspberry Pi 4 but there is some errors, like some files missing, and variables not defined.
I tried to change and fix the problems but still not working.
Someone have a tutorial to build one from zero or a new version?
In every project creating my own or clone gaves me this error on the terminal:
Hello from the pygame community. https://www.pygame.org/contribute.html /home/pi/Desktop/pygame/main.py:3: RuntimeWarning: use font: libSDL2_ttf-2.0.so.0: cannot open shared object file: No such file or directory (ImportError: libSDL2_ttf-2.0.so.0: cannot open shared object file: No such file or directory) pygame.font.init() Traceback (most recent call last): File "/home/pi/Desktop/pygame/main.py", line 3, in <module> pygame.font.init() File "/home/pi/.local/lib/python3.7/site-packages/pygame/__init__.py", line 59, in __getattr__ raise NotImplementedError(missing_msg)
I resolve it in Raspberry Pi, setting it from zero, deleting all in the micro SD card and installing again Raspberry Pi OS, the problem was that I tried to install on the terminal the pygame but is already installed on Raspberry Pi, so probably was an error during the installation.
I am running Python 3.7, 64bit on Windows 10 and trying desperately to get Rtree running. I use the package Rtree-0.9.1-cp37-cp37m-win_amd64.whl from Christoph Gohlke (https://www.lfd.uci.edu/~gohlke/pythonlibs/).
I have tried for very long to get it to work, but keep on getting the following error message when running a script that uses geopandas.
Traceback (most recent call last):
File "C:\Python37\lib\site-packages\rtree\core.py", line 90, in <module>
rt = ctypes.CDLL(os.path.join(here, 'spatialindex_c.dll'))
File "C:\Python37\lib\ctypes\__init__.py", line 364, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
The installation of the whl-package should include the libspatialindex files, but they are not found when running the code. I tried to use Python 2.7 first to run it, then installed Python 3.7. I've checked all the dependencies and checked whether the "spatialindex_c.dll" files are at the right place, but nothing helps. Would be great to get an answer on that.
I'm trying to try out Airflow for the very first time and I'm trying to connect it to a local SQLite database. But I can't seem to get my head around on how to actually do it.
I've read up on Airflow's document, Set my executor to LocalExecutor and set up my sql_alchemy_conn to sqlite:////home/myName/Programs/sqlite3/DatabaseName.db but it doesn't seem to work as it throws an
Traceback (most recent call last):
File "/usr/local/bin/airflow", line 21, in <module>
from airflow import configuration
File "/usr/local/lib/python2.7/dist-packages/airflow/__init__.py", line 35, in <module>
from airflow import configuration as conf
File "/usr/local/lib/python2.7/dist-packages/airflow/configuration.py", line 520, in <module>
conf.read(AIRFLOW_CONFIG)
File "/usr/local/lib/python2.7/dist-packages/airflow/configuration.py", line 283, in read
self._validate()
File "/usr/local/lib/python2.7/dist-packages/airflow/configuration.py", line 169, in _validate
self.get('core', 'executor')))
airflow.exceptions.AirflowConfigException: error: cannot use sqlite with the LocalExecutor
error when I tried to run airflow initdb. I tried to google around and tried vipul sharma's solution found here and set the value of my sql_alchemy_conn to mysql://:#localhost:3306/ but it still doesn't work as it throws an
sqlalchemy.exc.OperationalError: (_mysql_exceptions.OperationalError) (1045, "Access denied for user 'myName'#'localhost' (using password: NO)")
error. I know that the answer should be really simple but I really don't understand how to so I hope you can guide me through on what to do/read.
Use SequentialExecutor
"This executor will only run one task instance at a time, can be used for debugging. It is also the only executor that can be used with sqlite since sqlite doesn’t support multiple connections." airflow documentation
You just didn't need to change to LocalExecutor, change it back to SequentialExecutor, change sql_alchemy_conn to point to sqlite:////home/myName/Programs/sqlite3/DatabaseName.db and stop airflow services (webserver, scheduler).
Execute airflow initdb then start up the services again.
Hopefully that works.
Im trying to run code from
http://forge.fiware.org/plugins/mediawiki/wiki/fiware/index.php/BigData_Analysis_-_User_and_Programmer_Guide
And Im stuck at line
"easy_install
https://forge.fi-ware.org/frs/download.php/1309/cosmos-0.16.0-py2.7.egg"
System print out:
Downloading https://forge.fi-ware.org/frs/download.php/1309/cosmos-0.16.0-py2.7.egg
Processing cosmos-0.16.0-py2.7.egg
removing '/usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7.egg' (and everything under it)
creating /usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7.egg
Extracting cosmos-0.16.0-py2.7.egg to /usr/lib/python2.6/site-packages
SyntaxError: ('invalid syntax', ('/usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7.egg/cosmos/cli/command_util.py', 145, 20, ' return {k: v for k, v in json.iteritems() if k not in filter_keys}\n'))
cosmos 0.16.0 is already the active version in easy-install.pth
Installing cosmos script to /usr/bin
Installed /usr/lib/python2.6/site-packages/cosmos-0.16.0-py2.7.egg
Processing dependencies for cosmos==0.16.0
Searching for cosmos==0.16.0
Reading http://pypi.python.org/simple/cosmos/
No local packages or download links found for cosmos==0.16.0
error: Could not find suitable distribution for Requirement.parse('cosmos==0.16.0')
But after that I realized that Im using image from conference and cosmos should be installed, so I run
# cosmos
And this is my system print out:
Traceback (most recent call last):
File "/usr/bin/cosmos", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 2655, in <module>
working_set.require(__requires__)
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 648, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python2.6/site-packages/pkg_resources.py", line 546, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: requests
How to run cosmos properly ??
In order to access the already deployed Hadoop-like Cosmos instance in FIWARE LAB you don't need the Cosmos CLI; that's intended to create new clusters on demand on a Hadoop-as-a-service-like Cosmos deployment, which is not the case of FIWARE LAB one.
Simply go here and create a Cosmos account by using your FIWARE LAB credentials. Then, follow the steps pointed in that web.
Regarding the Cosmos documentation, please ignore the first sections until section 2.3.
I am having a wired error while running following example code snippet
st = StanfordTagger('bidirectional-distsim-wsj-0-18.tagger')
st.tag('What is the airspeed of an unladen swallow ?'.split())
The first line worked properly but second line is giving following error.
Could not create the Java virtual machine.
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.6/dist-packages/nltk-2.0.1rc1- py2.6.egg/nltk/tag/stanford.py", line 51, in tag
return self.batch_tag([tokens])[0]
File "/usr/local/lib/python2.6/dist-packages/nltk-2.0.1rc1-py2.6.egg/nltk/tag/stanford.py", line 77, in batch_tag
stdout=PIPE, stderr=PIPE)
File "/usr/local/lib/python2.6/dist-packages/nltk-2.0.1rc1-py2.6.egg/nltk/internals.py", line 166, in java
raise OSError('Java command failed!')
OSError: Java command failed!
I have tried adding .usr/lib/jvm into path but still not working
It wasn't working for me either. So I tried the following and its working perfectly.
st = POSTagger('path-to/stanford-postagger-full-2012-07-09/models/wsj-0-18-left3words.tagger','path-to/stanford-postagger-full-2012-07-09/stanford-postagger.jar')
and use nltk's tokenize method instead of Python's split()
taggedSentence= st.tag(nltk.word_tokenize(sentence))
I see that question is very outdated, but this days I got same error for unknown reason. It gives me a lot of headache. But I found solution.
First, I installed Oracle Java (here is instructions: How To Manually Install Oracle Java on a Debian or Ubuntu VPS)
Now, my python script told me more information on error. It outputs something like:
Forking JVM: error=12, Cannot allocate memory or error=12, Not enough space
Here you can read more about such problem: Forking the JVM
And to avoid that annoying error I need to edit /etc/sysctl.conf and add the following:
vm.overcommit_memory = 1
Then restart system for the change to take effect.