我应该使用Python 32位还是Python 64位

时间:2022-12-28 07:10:45

I have a win7 64bit installation. Must I use Python 64bit? What are the differences between the 32bit and 64bit Python versions anyway? Do different Python packages (such as south, django, mysqldb etc) support only 32bit\64bit?

我有一个win7 64bit安装。我必须使用Python 64bit吗?无论如何,32位和64位Python版本之间有什么区别?不同的Python包(例如south,django,mysqldb等)是否只支持32bit \ 64bit?

5 个解决方案

#1


66  

64 bit version will allow a single process to use more RAM than 32 bit, however you may find that the memory footprint doubles depending on what you are storing in RAM (Integers in particular).

64位版本将允许单个进程使用比32位更多的RAM,但是您可能会发现内存占用量会增加一倍,具体取决于您在RAM中存储的内容(特别是整数)。

For example if your app requires > 2GB of RAM, so you switch from 32bit to 64bit you may find that your app is now requiring > 4GB of RAM.

例如,如果您的应用需要> 2GB的RAM,那么从32位切换到64位您可能会发现您的应用现在需要> 4GB的RAM。

Check whether all of your 3rd party modules are available in 64 bit, otherwise it may be easier to stick to 32bit in the meantime

检查所有第三方模块是否以64位可用,否则在此期间可能更容易坚持32位

#2


9  

In my experience, using the 32-bit version is more trouble-free. Unless you are working on applications that make heavy use of memory (mostly scientific computing, that uses more than 2GB memory), you're better off with 32-bit versions because:

根据我的经验,使用32位版本更加无故障。除非您正在处理大量使用内存的应用程序(主要是科学计算,使用超过2GB内存),否则最好使用32位版本,因为:

  1. You generally use less memory.
  2. 通常使用较少的内存。
  3. You have less problems using COM (since you are on Windows).
  4. 使用COM的问题较少(因为您使用的是Windows)。
  5. If you have to load DLLs, they most probably are also 32-bit. Python 64-bit can't load 32-bit libraries without some heavy hacks running another Python, this time in 32-bit, and using IPC.
  6. 如果你必须加载DLL,它们很可能也是32位。 Python 64位无法在没有运行另一个Python的重度黑客的情况下加载32位库,这次是32位,并且使用IPC。
  7. If you have to load DLLs that you compile yourself, you'll have to compile them to 64-bit, which is usually harder to do (specially if using MinGW on Windows).
  8. 如果你必须加载你自己编译的DLL,你必须将它们编译为64位,这通常更难做(特别是如果在Windows上使用MinGW)。
  9. If you ever use PyInstaller or py2exe, those tools will generate executables with the same bitness of your Python interpreter.
  10. 如果您使用PyInstaller或py2exe,那些工具将生成与Python解释器具有相同位数的可执行文件。

#3


5  

You do not need to use 64bit since windows will emulate 32bit programs using wow64. But using the native version (64bit) will give you more performance.

您不需要使用64位,因为Windows将使用wow64模拟32位程序。但使用本机版本(64位)将为您提供更多性能。

#4


3  

Use the 64 bit version only if you have to work with heavy amounts of data, in that scenario, the 64 bits performs better with the inconvenient that John La Rooy said; if not, stick with the 32 bits.

只有当您需要处理大量数据时才使用64位版本,在这种情况下,64位版本表现更好,而John La Rooy说的不方便;如果没有,坚持32位。

#5


0  

I had trouble running python app (running large dataframes) in 32 - got MemoryError message, while on 64 it worked fine.

我在32位运行python app(运行大型数据帧)时遇到了麻烦 - 得到了MemoryError消息,而在64位它运行正常。

#1


66  

64 bit version will allow a single process to use more RAM than 32 bit, however you may find that the memory footprint doubles depending on what you are storing in RAM (Integers in particular).

64位版本将允许单个进程使用比32位更多的RAM,但是您可能会发现内存占用量会增加一倍,具体取决于您在RAM中存储的内容(特别是整数)。

For example if your app requires > 2GB of RAM, so you switch from 32bit to 64bit you may find that your app is now requiring > 4GB of RAM.

例如,如果您的应用需要> 2GB的RAM,那么从32位切换到64位您可能会发现您的应用现在需要> 4GB的RAM。

Check whether all of your 3rd party modules are available in 64 bit, otherwise it may be easier to stick to 32bit in the meantime

检查所有第三方模块是否以64位可用,否则在此期间可能更容易坚持32位

#2


9  

In my experience, using the 32-bit version is more trouble-free. Unless you are working on applications that make heavy use of memory (mostly scientific computing, that uses more than 2GB memory), you're better off with 32-bit versions because:

根据我的经验,使用32位版本更加无故障。除非您正在处理大量使用内存的应用程序(主要是科学计算,使用超过2GB内存),否则最好使用32位版本,因为:

  1. You generally use less memory.
  2. 通常使用较少的内存。
  3. You have less problems using COM (since you are on Windows).
  4. 使用COM的问题较少(因为您使用的是Windows)。
  5. If you have to load DLLs, they most probably are also 32-bit. Python 64-bit can't load 32-bit libraries without some heavy hacks running another Python, this time in 32-bit, and using IPC.
  6. 如果你必须加载DLL,它们很可能也是32位。 Python 64位无法在没有运行另一个Python的重度黑客的情况下加载32位库,这次是32位,并且使用IPC。
  7. If you have to load DLLs that you compile yourself, you'll have to compile them to 64-bit, which is usually harder to do (specially if using MinGW on Windows).
  8. 如果你必须加载你自己编译的DLL,你必须将它们编译为64位,这通常更难做(特别是如果在Windows上使用MinGW)。
  9. If you ever use PyInstaller or py2exe, those tools will generate executables with the same bitness of your Python interpreter.
  10. 如果您使用PyInstaller或py2exe,那些工具将生成与Python解释器具有相同位数的可执行文件。

#3


5  

You do not need to use 64bit since windows will emulate 32bit programs using wow64. But using the native version (64bit) will give you more performance.

您不需要使用64位,因为Windows将使用wow64模拟32位程序。但使用本机版本(64位)将为您提供更多性能。

#4


3  

Use the 64 bit version only if you have to work with heavy amounts of data, in that scenario, the 64 bits performs better with the inconvenient that John La Rooy said; if not, stick with the 32 bits.

只有当您需要处理大量数据时才使用64位版本,在这种情况下,64位版本表现更好,而John La Rooy说的不方便;如果没有,坚持32位。

#5


0  

I had trouble running python app (running large dataframes) in 32 - got MemoryError message, while on 64 it worked fine.

我在32位运行python app(运行大型数据帧)时遇到了麻烦 - 得到了MemoryError消息,而在64位它运行正常。