-1

I don't know python but I need to install a python utility. when running it using python ./main.py I am getting a message "No module named web" I downloaded the web.py . My question is how to install it and where to put the webpy-master directory (that was downloaded when searching for the web.py ) or the web dir under it and what exactly to do

Note that I am running in an environment without web access so I can't just do pip install and my python version is 2.7 (this is what the utility needs) I saw this answer

Python Packages Offline Installation

but since I don't know python and i can't download other things ( it's complicated , need to go to security department etc ) also I don't understand how to use environment.txt

please don't set it as duplicate.

RMagen
  • 612
  • 2
  • 9
  • 23
  • 1
    You don't need to install it just to `import` it in your project. You can either put it in your packages in your virtual environment or inside your project. The only thing you should be careful about is to import it from the correct path. – Kostas Charitidis Sep 19 '19 at 06:24
  • sorry for the stupid question but how do I import it ? ( I don't know python ) .just put the downloaded dir in the same dir of the utility ? – RMagen Sep 19 '19 at 06:36
  • 1
    https://realpython.com/absolute-vs-relative-python-imports/ – Kostas Charitidis Sep 19 '19 at 06:36
  • 1
    put `web.py` in folder with `main.py` and use `import web` (without `.py`) in `main.py`. – furas Sep 19 '19 at 08:09
  • thank you !! I put the Web directory where the main.py and added the import and it worked ! thank you ! – RMagen Sep 19 '19 at 09:57

1 Answers1

0

I put the Web directory where the main.py is and added

import web

to the main.py and it worked ! thank you !

RMagen
  • 612
  • 2
  • 9
  • 23