FreeBSD 9 中的 python sqlite3 错误

发布于 2024-12-12 21:59:40 字数 3627 浏览 6 评论 0原文

尝试安装此 ipython 版本。事实上,有一个 django-starter 项目使用 buildout 来满足他的需求。并且该脚本尝试使用 easy_install 获取 ipython 0.11。我尝试从这个包中删除所有内容,但任何文件中都没有提到 ipython。所以我无法安装较新的版本,我需要 ipython0.11 才能工作。请=)

    roman# easy_install "ipython==0.11" > errors
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1712, in main
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1716, in <lambda>
  File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 211, in run
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 446, in easy_install
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 476, in install_item
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 655, in install_eggs
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 930, in build_and_install
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 919, in run_setup
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 62, in run_setup
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 105, in run
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 64, in <lambda>
  File "setup.py", line 54, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/__init__.py", line 46, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/embed.py", line 32, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/interactiveshell.py", line 26, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/interactiveshell.py", line 36, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/history.py", line 20, in <module>
  File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
    register_adapters_and_converters()
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
    register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined

更新:

从 python 控制台导入 sqlite3 会出现此错误:

>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
    register_adapters_and_converters()
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
    register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined

Trying to install this ipython version. infact there's a django-starter project which uses buildout for his needs.. And that scripts tried to get ipython 0.11 with easy_install.I tried to grep everything out from this package but there's no ipython mentioned in any files at all. so I can't install newer version I need ipython0.11 to work. Please =)

    roman# easy_install "ipython==0.11" > errors
Traceback (most recent call last):
  File "/usr/local/bin/easy_install", line 8, in <module>
    load_entry_point('setuptools==0.6c11', 'console_scripts', 'easy_install')()
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1712, in main
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 1716, in <lambda>
  File "/usr/local/lib/python2.7/distutils/core.py", line 152, in setup
    dist.run_commands()
  File "/usr/local/lib/python2.7/distutils/dist.py", line 953, in run_commands
    self.run_command(cmd)
  File "/usr/local/lib/python2.7/distutils/dist.py", line 972, in run_command
    cmd_obj.run()
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 211, in run
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 446, in easy_install
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 476, in install_item
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 655, in install_eggs
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 930, in build_and_install
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/command/easy_install.py", line 919, in run_setup
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 62, in run_setup
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 105, in run
  File "build/bdist.freebsd-9.0-RC1-amd64/egg/setuptools/sandbox.py", line 64, in <lambda>
  File "setup.py", line 54, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/__init__.py", line 46, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/embed.py", line 32, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/frontend/terminal/interactiveshell.py", line 26, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/interactiveshell.py", line 36, in <module>
  File "/tmp/easy_install-4FA3NZ/ipython-0.11/IPython/core/history.py", line 20, in <module>
  File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
    register_adapters_and_converters()
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
    register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined

update:

importing sqlite3 from python console gives this error:

>>> import sqlite3
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python2.7/sqlite3/__init__.py", line 24, in <module>
    from dbapi2 import *
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 85, in <module>
    register_adapters_and_converters()
  File "/usr/local/lib/python2.7/sqlite3/dbapi2.py", line 80, in register_adapters_and_converters
    register_adapter(datetime.date, adapt_date)
NameError: global name 'register_adapter' is not defined

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

帥小哥 2024-12-19 21:59:40

从您的错误消息和我们在评论中的交流来看,我认为最大的问题是您可能缺少对 python 的 sqlite3 支持。

从您的错误消息来看,我认为您正在运行 FreeBSD,因此您应该从 ports 安装 databases/py-sqlite3 软件包。

我对 FreeBSD 的 ports 系统不太了解,但是在安装 py-sqlite3 软件包之后,你的问题应该会得到解决。

我将假设,通过简短的阅读,您会执行类似的操作,假设您的系统上有端口树:

cd /usr/ports/databases/py-sqlite3
make && make install

Judging from your error message and our exchange in the comments, I think the big problem is you might just be missing sqlite3 support for python.

From your error messages I take it you're running FreeBSD, so you should install the databases/py-sqlite3 package from ports.

I don't know much about FreeBSD's ports system, but after you install the py-sqlite3 package, your problem should hopefully be cleared up.

I'm going to assume, from brief reading, you do something like this, assuming you have the ports tree on your system:

cd /usr/ports/databases/py-sqlite3
make && make install
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文