2

在 ubuntu lucid 中,我默认有。我python2.6想安装python 3.3.1.

我从Python-3.3.1.tar.bz2我的主文件夹中提取出来,/home/me/Python-3.3.1以便包含所有文件。然后按照我所做的自述文件

./configure
make
make test
sudo make install

这创建了一个在文件夹中命名的可执行python文件/home/me/Python-3.3.1

另外,现在我的目录中有几个python3*文件/usr/local/bin

其中 ,

python3 是可执行文件的链接,

python3.3 是一个可执行文件,

python3.3m 是一个可执行文件。

我想为python3创建一个virtualenv并尝试了以下

sudo virtualenv envpy331 --distribute --no-site-packages --python=/home/me/Python-3.3.1/python

这产生了一个 AssertionError

File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.8.2-py2.6.egg/virtualenv.py", line 2471, in <module>
    main()
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.8.2-py2.6.egg/virtualenv.py", line 942, in main
    never_download=options.never_download)
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.8.2-py2.6.egg/virtualenv.py", line 1043, in create_environment
    site_packages=site_packages, clear=clear))
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.8.2-py2.6.egg/virtualenv.py", line 1207, in install_python
    copy_required_modules(home_dir)
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.8.2-py2.6.egg/virtualenv.py", line 1159, in copy_required_modules
    dst_filename = change_prefix(filename, dst_prefix)
  File "/usr/local/lib/python2.6/dist-packages/virtualenv-1.8.2-py2.6.egg/virtualenv.py", line 1134, in change_prefix
    (filename, prefixes)
AssertionError: Filename /home/me/Python-3.3.1/Lib/os.py does not start with any of these prefixes: ['/usr/local']

我需要什么来纠正这个?我需要删除 python3 安装,还是需要重新配置它prefix=/usr/local?并再次运行安装?

4

1 回答 1

2

您已经安装了它。只需指向已安装的python3。尝试这个:

virtualenv envpy331 --python=/usr/local/bin/python3.3
于 2013-04-20T15:56:03.107 回答