Python Forum
problem in import module from other folder
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
problem in import module from other folder
#5
I have a few home-made "modules" which do things for me. I keep them all in /home/pedro/myPython/myModules/

If I need one of them, I start my Python program like this:

#! /usr/bin/python3
import sys, os, glob
sys.path.append('/home/pedro/myPython/myModules/')
import score_oralsOMR
Then my modules are available. I don't add the path permanently to $PATH because I don't use them very frequently.

Not sure if this is good practice, but it works for me!
Reply


Messages In This Thread
RE: problem in import module from other folder - by Pedroski55 - Sep-01-2023, 05:47 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  problem with memory_graph module akbarza 5 1,793 Jan-14-2025, 04:31 PM
Last Post: Gribouillis
  'import requests' problem Curbie 2 836 Aug-14-2024, 01:04 AM
Last Post: Curbie
  problem using coloeama module akbarza 3 1,527 Jan-08-2024, 07:31 AM
Last Post: akbarza
  Compare folder A and subfolder B and display files that are in folder A but not in su Melcu54 3 1,517 Jan-05-2024, 05:16 PM
Last Post: Pedroski55
  is import cointegration_analysis a recognized module mitcht33 1 1,161 Nov-06-2023, 09:29 PM
Last Post: deanhystad
  problem in using subprocess module akbarza 5 3,514 Sep-24-2023, 02:02 PM
Last Post: snippsat
  problem in using pyqrcode module to create QRcode akbarza 9 6,776 Aug-23-2023, 04:17 PM
Last Post: snippsat
  can not import anaconda pandas module. PySpark pandas module is imported!! aupres 0 1,390 Aug-06-2023, 01:09 AM
Last Post: aupres
  [WORKED AROUND] Problem installing elitech-datareader, 'cannot import build_py_2to3' NeilUK 4 4,401 Jul-09-2023, 10:01 AM
Last Post: NeilUK
  Problem with Pyinstaller. No module named '_tkinter' tonynapoli2309 0 1,928 May-15-2023, 02:38 PM
Last Post: tonynapoli2309

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020