Python Forum

Full Version: Install module without "pip"
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I need to use "openpyxl" module but I can't install it with "pip" (not available on the system). So far I downloaded and placed "openpyxl" in the same directory where I run my python script where I added this line:

from .openpyxl import Workbook

but when I run my python script I get error: "ValueError: Attempted relative import in non-package".

I tried different things but didn't come to a solution...any help?
You can perhaps use the old way to install packages
  • download the source tree
  • open a terminal (or Cmd window or something similar)
  • change current directory to the package's directory containing the 'setup.py' file
  • run the command python setup.py install or perhaps python setup.py install --user
install pip.
without pip you will go through nightmare every time you try to install packages.

You can install from source - run the setup.py directly, but you will need to install dependencies in advance.
So, again, use pip