I’m making a Discord.js bot and also using python code to do some things. For running the python script I am using the “child_process
” package and it is working fine. However my Python script is trying to import Pillow module - "from PIL import Image, ImageFont, ImageDraw
", but Pillow just isn’t getting installed.
I already tried running pip3 install Pillow --user
in the shell however it still doesn’t work. I also added this line in the Python file - os.system('pip3 install Pillow')
, but still nothing. Please someone help on how to install pillow. Btw my replit.nix file looks like this :-
{ pkgs }: {
deps = [
# Node.JS Template
pkgs.python39Packages.pip
pkgs.nodejs-18_x
pkgs.nodePackages.typescript-language-server
pkgs.yarn
pkgs.replitPackages.jest
# Python Template
pkgs.strace
pkgs.python310Full
pkgs.replitPackages.prybar-python310
pkgs.replitPackages.stderred
];
env = {
PYTHON_LD_LIBRARY_PATH = pkgs.lib.makeLibraryPath [
# Needed for pandas / numpy
pkgs.stdenv.cc.cc.lib
pkgs.zlib
# Needed for pygame
pkgs.glib
# Needed for matplotlib
pkgs.xorg.libX11
];
PYTHONBIN = "${pkgs.python310Full}/bin/python3.10";
LANG = "en_US.UTF-8";
STDERREDBIN = "${pkgs.replitPackages.stderred}/bin/stderred";
PRYBAR_PYTHON_BIN = "${pkgs.replitPackages.prybar-python310}/bin/prybar-python310";
};
}