Warm tip: This article is reproduced from serverfault.com, please click

Can I increase the amount of memory used by Python in a virtual environment

发布于 2020-12-04 22:00:09

I have written a code that connects to google spreadsheet and post the data to a MySQL database. However, I am having an issue with my code. When I run it on my Mac it works when I run it on my Windows server I receive a MemoryError. Note that I am using a virtual environment in both systems. When I type python after activating the virtual environment It shows this

Python 3.8.5 (tags/v3.8.5:580fbb0, Jul 20 2020, 15:43:08) [MSC v.1926 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.

Any idea what I should do, it's a virtual server, should I increase the ram? Here are the current specs of the server I am using:

Windows Edition: Windows Server 2016 Standard Processor: Intel(R) Xeon(R) CPU E5-2680 v4 @ 2.4GHz 2.40 GHz (2 processors) Installed memory (RAM): 16 GB System Type: 64-bit Operating System, x64-based processor.

My Mac specs:

MacBook Pro (15-inch, 2018) Processor: 2.9 GHz 6-Core Intel Core i9 memory: 16 GB 2400 MHz DDR4

Thanks for any help in advance!

Questioner
Arianna Newman
Viewed
0
iBug 2020-12-05 06:07:32

Your Python.interpreter shows

[MSC v.1926 32 bit (Intel)]

This is a clear sign you've installed a wrong version that couldn't use more than 4 GB RAM per process.

The correct solution is to uninstall the current Python from your Windows server and delete your virtual environment, and re-install the 64-bit version and start over.