Python Forum
How to run python script which has dependent python script in another folder?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to run python script which has dependent python script in another folder?
#1
Hi All,

I need your help for following issue-

I have a structured python project where there are 3 directories- A,B,C
Inside these directories there are python files-f1.py,f2.py,f3.py

folder A's f1.py file has some function which are from folder B's f2.py.

I have imported B's f2.py in f1.py file and it works in Pycharm IDE.

Now if I want to run f1.py file from a terminal(linux terminal) then it say there is no module named B.f2.py.

How can I define dependency to run my files from a terminal/cmd?

I set the PYTHONPATH and all working fine now.
Reply


Messages In This Thread
How to run python script which has dependent python script in another folder? - by PrateekG - May-23-2018, 10:35 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Problems passing arguments containing spaces to bash script and then on to python kaustin 6 465 Apr-03-2024, 08:26 PM
Last Post: deanhystad
  Using a script to open multiple shells? SuchUmami 9 618 Apr-01-2024, 10:04 AM
Last Post: Gribouillis
  How to include one script into another? MorningWave 8 564 Mar-21-2024, 10:34 PM
Last Post: MorningWave
  ChromeDriver breaking Python script genericusername12414 1 351 Mar-14-2024, 09:39 AM
Last Post: snippsat
  using PowerShell from Python script for mounting shares tester_V 8 577 Mar-12-2024, 06:26 PM
Last Post: tester_V
  No Internet connection when running a Python script basil_555 8 692 Mar-11-2024, 11:02 AM
Last Post: snippsat
Question Running Python script through Task Scheduler? Winfried 8 569 Mar-10-2024, 07:24 PM
Last Post: Winfried
  Combine console script + GUI (tkinter) dejot 2 457 Feb-27-2024, 04:38 PM
Last Post: deanhystad
Question How to add Python folder in Windows Registry ? Touktouk 1 302 Feb-20-2024, 01:04 PM
Last Post: DeaD_EyE
  How to receive two passed cmdline parameters and access them inside a Python script? pstein 2 377 Feb-17-2024, 12:29 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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