【问题标题】:Installing distribute for Python 3.3为 Python 3.3 安装分发版
【发布时间】:2013-09-16 16:59:28
【问题描述】:

我尝试在 Ubuntu 12.04 上使用 python 3.3 安装分发来安装 pymongo。

我下载了distribute_setup.py

curl -O http://python-distribute.org/distribute_setup.py

后来我尝试了

python3 distribute_setup.py install

但我接受了

Downloading http://pypi.python.org/packages/source/d/distribute/distribute-0.6.49.tar.gz
Traceback (most recent call last):
  File "distribute_setup.py", line 556, in <module>
    sys.exit(main())
  File "distribute_setup.py", line 552, in main
    tarball = download_setuptools(download_base=options.download_base)
  File "distribute_setup.py", line 211, in download_setuptools
    src = urlopen(url)
  File "/usr/local/lib/python3.3/urllib/request.py", line 156, in urlopen
    return opener.open(url, data, timeout)
  File "/usr/local/lib/python3.3/urllib/request.py", line 475, in open
    response = meth(req, response)
  File "/usr/local/lib/python3.3/urllib/request.py", line 587, in http_response
    'http', request, response, code, msg, hdrs)
  File "/usr/local/lib/python3.3/urllib/request.py", line 507, in error
    result = self._call_chain(*args)
  File "/usr/local/lib/python3.3/urllib/request.py", line 447, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.3/urllib/request.py", line 692, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/usr/local/lib/python3.3/urllib/request.py", line 469, in open
    response = self._open(req, data)
  File "/usr/local/lib/python3.3/urllib/request.py", line 492, in _open
    'unknown_open', req)
  File "/usr/local/lib/python3.3/urllib/request.py", line 447, in _call_chain
    result = func(*args)
  File "/usr/local/lib/python3.3/urllib/request.py", line 1310, in unknown_open
    raise URLError('unknown url type: %s' % type)
urllib.error.URLError: <urlopen error unknown url type: https>

有人可以帮帮我吗?似乎分发使用的代码不能用 python 3.3 编译..

我按照以下步骤在我的主文件夹中安装了 Python 3.3.2:

./configure
make
make test
sudo make install

如果我尝试从我收到的源安装 pymongo:

Extracting in /tmp/tmpth91z4
Traceback (most recent call last):
  File "setup.py", line 22, in <module>
    from setuptools import setup, Feature
ImportError: No module named 'setuptools'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/dev/pymongo/ez_setup.py", line 130, in use_setuptools
    import pkg_resources
ImportError: No module named 'pkg_resources'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "setup.py", line 25, in <module>
    use_setuptools()
  File "/home/dev/pymongo/ez_setup.py", line 132, in use_setuptools
    return _do_download(version, download_base, to_dir, download_delay)
  File "/home/dev/pymongo/ez_setup.py", line 111, in _do_download
    _build_egg(egg, tarball, to_dir)
  File "/home/dev/pymongo/ez_setup.py", line 83, in _build_egg
    tar = tarfile.open(tarball)
  File "/usr/local/lib/python3.3/tarfile.py", line 1571, in open
    raise ReadError("file could not be opened successfully")
tarfile.ReadError: file could not be opened successfully

谢谢

【问题讨论】:

  • 您的 Python 安装似乎不支持 SSL。
  • 我从 Python 主页安装了 Python 3.3.2。还安装了 Openssl。 build-essential libncursesw5-dev libreadline5-dev libssl-dev libgdbm-dev libc6-dev libsqlite3-dev tk-dev和zlib1g-dev也安装了

标签: python ubuntu pymongo distribute


【解决方案1】:

您确定在编译 Python 之前安装了 openssl-devel 吗?我遇到了同样的问题,但是我通过之前安装 openssl-devel 然后编译 Python 3 + 分发来修复它。

【讨论】:

  • 在 Debian/Ubuntu 中是 libssl-dev 包
猜你喜欢
  • 1970-01-01
  • 2014-01-24
  • 2011-02-19
  • 1970-01-01
  • 2013-05-31
  • 1970-01-01
  • 1970-01-01
  • 2013-12-01
  • 1970-01-01
相关资源
最近更新 更多