Python Forum
Install module without "pip" - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: Install module without "pip" (/thread-25714.html)



Install module without "pip" - hjk6734 - Apr-09-2020

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?


RE: Install module without "pip" - Gribouillis - Apr-09-2020

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



RE: Install module without "pip" - buran - Apr-09-2020

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