Forums

Make VirtualEnv Packages Take Up Less Space?

I'm currently on the free plan, but thinking of upgrading to the $5/mo plan for the 1 GB disk size. However, I am getting worried that even the 1 GB won't be enough, and I'll have to upgrades to the $12/year plan instead. I am trying to install a bunch of packages for my virtualenv, and they are already taking up greater than the 512 MB provided in the free plan. Is there any way to shrink the sizes of packages that are downloaded, or do they come at their default sizes, with no way to change them?

Thanks!

Packages take the space they take. We have batteries included packages for free users to by-pass the space limitations.

You are not bound by $5 and $12 thresholds. In the "Custom" plan you can choose any features you like on top of the $5 plan. So you can, for example, add only the storage.

What exactly is a batteries included package? For example, the main module I am trying to import is seaborn, which I notice is not among the batteries included list. The reason the module takes up so much space is because I am required to download things like pandas, matplotlib, and scipy for seaborn to work. Specifically, the scipy module is rather large, and is the main issue storage-wise. How do these modules by-pass space limitations, when I still have to download them to use them?

Batteries included are installed globally and work if you use python directly, without a virtual environment.

This situation is similar to what I have found working with the virtual environment in pythonanywhere using a free account.

In my case, my application written in Flask without using the virtual environment allows me to install the libraries I need (With a bit of luck not to exceed the quota of 512M)

When I tried to configure my application using a virtual environment I found the error: "ERROR: Could not install packages due to an OSError: [Errno 122] Disk quota exceeded"

I did perform a test to determine whether the virtual environment occupies more space than the required quota allocated to the free accounts without subscription.

So, I did execute the command:

"du -hs /tmp ~/.[!.] ~/ | sort -h"

and I found that the virtual environment without the libraries that I require with the versions that I need occupies in my case 312MB (about 60%) of the 512MB of which are allowed.

For example: (myvirtualenv) 16:26 ~ $ du -hs /tmp ~/.[!.] ~/ | sort -h 4.0K /home/myaccount/.bashrc 4.0K /home/myaccount/.gitconfig 4.0K /home/myaccount/.profile 4.0K /home/myaccount/.python_history 4.0K /home/myaccount/.pythonstartup.py 4.0K /home/myaccount/README.txt 4.0K /home/myaccount/requirements_for_recordsv1.0.132.txt 8.0K /home/myaccount/.vimrc 2.3M /tmp 22M /home/myaccount/.local 93M /home/myaccount/.cache 312M /home/myaccount/.virtualenvs

I believe that this is the reason why using a virtual environment it is necessary to have a subscription account with the storage capacity required by the application.

In conclusion. When creating a virtual environment in pythonanywhere using a free account, more than half (60%) of the 512MB allocated space is sacrificed since only the virtual environment after being created occupies 312M and that does not include libraries with specific versions that a user wants to install in the virtual environment.

So, if you are working in free account mode, it is recommended to stay as far as possible with the batteries included and if you want to migrate to a virtual environment, the user must purchase a subscription to have more storage capacity.

I'm not sure how you created the virtualenv or checked the size, but I just created an empty virtualenv that took up only 13M.