Decimal problem


D

durumdara

Hi!

In the prev. week I tested my home Python projects with KinterBasDB
embedded, PsyCOPG, and SQLite.

All of them worked well, and everything was good.

But the database blob table deletion was slow in SQLite, so I thought
I will try this with FireBird and PGSQL.

Today I tried to copy the SQLite DataBase into FireBird, and PGSQL.

Psycopg drop this error:

import psycopg2
pdb = psycopg2.connect("dbname=testx user=postgres password=x")

C:\Python26\lib\site-packages\psycopg2\__init__.py:62: RuntimeWarning:
can't import decimal module probably needed by _psycopg
RuntimeWarning)

I wondered, because this was working before...

Then I tried to start KinterBasDB:

File "C:\Python26\lib\site-packages\kinterbasdb\__init__.py", line
478, in con
nect
return Connection(*args, **keywords_args)
File "C:\Python26\lib\site-packages\kinterbasdb\__init__.py", line
644, in __i
nit__
self._normalize_type_trans()
File "C:\Python26\lib\site-packages\kinterbasdb\__init__.py", line
1047, in _n
ormalize_type_trans
self.set_type_trans_out(_NORMAL_TYPE_TRANS_OUT)
File "C:\Python26\lib\site-packages\kinterbasdb\__init__.py", line
1073, in se
t_type_trans_out
return _k.set_Connection_type_trans_out(self._C_con, trans_dict)
File "C:\Python26\lib\site-packages\kinterbasdb\__init__.py", line
1907, in _m
ake_output_translator_return_type_dict_from_trans_dict
return_val = translator(sample_arg)
File "C:\Python26\lib\site-packages\kinterbasdb
\typeconv_fixed_decimal.py", li
ne 91, in fixed_conv_out_precise
from decimal import Decimal
ImportError: cannot import name Decimal

I deleted my complete Python with all packages, and I reinstalled it.
But the problem also appeared...

What is this? And what the hell happened in this machine that
destroyed my working python apps...?

Thanks:
dd
 
Ad

Advertisements

M

Mark Dickinson

ne 91, in fixed_conv_out_precise
    from decimal import Decimal
ImportError: cannot import name Decimal

Is it possible that you've got another file called decimal.py
somewhere in Python's path? What happens if you start Python manually
and type 'from decimal import Decimal' at the prompt?
 
Ad

Advertisements

D

durumdara

Is it possible that you've got another file called decimal.py
somewhere in Python's path?  What happens if you start Python manually
and type 'from decimal import Decimal' at the prompt?

Hi!

Ahhhhhhhh....

I found the problem. But before this I destroyed my machine fully... :-
(

The problem is ACTUAL PATH. My script name was copy.py.
If I tried to start python here, and type "import decimal" the python
was crashed on.

Because decimal is uses copy and number modules. The decimal is
imported my module, not the system...

Ajjjjjjajjjj...

I need to reinstall all tools that was in this machine, because I
uninstalled/deleted everything to find the source of the problem -
what was next to my eyes... :-(

Thanks for your help:
dd
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top