简体   繁体   English

安装最新版本的Python时遇到问题:出错?

[英]Having trouble installing newest version of Python: make error?

I have Python 2.7 on my Fedora VM and I want to upgrade to Python 3.3.2. 我在Fedora VM上安装了Python 2.7,并且想升级到Python 3.3.2。 I did this: 我这样做:

wget http://python.org/ftp/python/3.3.2/Python-3.3.2.tar.bz2
tar xf Python-3.3.2.tar.bz2
cd Python-3.3.2
./configure --prefix=/usr/local

And then tried 然后尝试

make

Only to get this error: 只得到这个错误:

Objects/abstract.c:2281:20: error: variable 'countva' is uninitialized when
      used here [-Werror,-Wuninitialized]
        Py_VA_COPY(countva, va);
        ~~~~~~~~~~~^~~~~~~~~~~~
Include/pyport.h:875:37: note: expanded from:
#define Py_VA_COPY(x, y) Py_MEMCPY((x), (y), sizeof(va_list))
                                    ^
Objects/abstract.c:2278:20: note: initialize the variable 'countva' to
      silence this warning
    va_list countva;
                   ^
                    = NULL
1 error generated.
make: *** [Objects/abstract.o] Error 1

...what? ...什么? How do I fix this? 我该如何解决? There shouldn't be something wrong with the Python installation file, should there? Python安装文件应该没有问题,应该存在吗?

There is nothing wrong with the Python archive, it must be your environment. Python档案库没有错,它一定是您的环境。

I reproduced your exact steps on my system and it runs on my system. 我在您的系统上重现了您的确切步骤,并且它在我的系统上运行。 I think the -Werror switch is to blame. 我认为-Werror开关应该受到谴责。 It will turn warnings into errors. 它将警告变成错误。 What your compiler actually encounters is merely a warning. 您的编译器实际遇到的仅仅是警告。

Can you type in the same terminal echo $CFLAGS and post the output? 您可以在同一终端输入echo $CFLAGS并发布输出吗? On my system, this command will produce an empty line. 在我的系统上,此命令将产生一个空行。 Maybe you have some CFLAGS set in your ~/.bashrc ? 也许您在~/.bashrc设置了一些CFLAGS Or maybe you do source a file in your ~/.bashrc which sets CFLAGS ? 或者,也许您确实在~/.bashrc中获取设置CFLAGS的文件的source

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM