You are not logged in.
I'm trying to use SQLAlchemy in a python script, but it fails to import. A simple "import sqlalchemy" gives me this:
Traceback (most recent call last):
File "/home/ntsp/workspace/numtest/src/main.py", line 2, in <module>
from numbers import *
File "/home/ntsp/workspace/numtest/src/numbers.py", line 2, in <module>
import sqlalchemy
File "/usr/lib/python3.2/site-packages/sqlalchemy/__init__.py", line 52, in <module>
from sqlalchemy.types import (
File "/usr/lib/python3.2/site-packages/sqlalchemy/types.py", line 25, in <module>
from decimal import Decimal as _python_Decimal
File "/usr/lib/python3.2/decimal.py", line 3762, in <module>
_numbers.Number.register(Decimal)
AttributeError: 'module' object has no attribute 'Number'
This happens for both python3 and python2. In a python shell, I can import and use it just fine. I'm not sure what's going on.
Offline
Maybe because your numbers.py masks the one in the stdlib?
Check out relative versus absolute imports etc.
Evil #archlinux@libera.chat channel op and general support dude.
. files on github, Screenshots, Random pics and the rest
Offline
Oh wow, I have no idea how I missed that. I feel like an idiot now :\
Thanks for the help.
Offline